diffpy / diffpy.pdfgui

graphical user interface for real space structure refinement to PDF
Other
18 stars 27 forks source link

py3 pickel encoding incompatible #44

Closed dragonyanglong closed 2 years ago

dragonyanglong commented 3 years ago

In diffpy.pdfgui/src/diffpy/pdfgui/gui/fittree.py", line 565, py3 cannot combine bytes and str directly together. cdatastring = "pdfgui_cliboard=" + cdatastring

I tried to add .encode() after the str then combien two bytes together, ie. cdatastring = "pdfgui_cliboard=".encode() + cdatastring. But a new bug appears:

diffpy/pdfgui/gui/fittree.py", line 565, in CopyBranch
    textdata = wx.TextDataObject(cdatastring)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 16: invalid start byte

It may be due to the pickel problem.

dragonyanglong commented 3 years ago

Hi @tienhungvuong, can you help take a look on this py3 pickel issue, which results into some encode/decode problem that I am not familiar with, we can discuss together. I bet there should be some quick fixes if we can spend more time on googling for answers.

hufngvuowng commented 3 years ago

Yes I'll take a look at this!

dragonyanglong commented 2 years ago

Fixed.