Repository navigation
ddp project files compatible problem between py2 and py3 #46
Copy link
Copy link
Open
Milestone
Description
dragonyanglong
opened on Oct 9, 2020
Issue body actions
- Use py3 pdfgui to save a ddp file, then use py2 pdfgui to open it.
- vice versa
Reactions are currently unavailable
Activity
But the second case doesn't work properly (use the py3 pdfgui to open the py2 saved ddp file). You can find more detailed information about the pickel propotols in the PR commits #42 .
dragonyanglong commented
on Dec 18, 2021 CollaboratorAuthorMore actionsI tried some py2 ddp files. And it seems like some can be opened successfully by py3, but some still couldn't, and raise error as
Traceback (most recent call last): File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/gui/errorwrapper.py", line 59, in _f return func(*args, **kwargs) File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/gui/mainframe.py", line 2132, in onOpen treelist = self.control.load(fullpath) File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/pdfguicontrol.py", line 404, in load org = fit.load(z, projName + '/' + rdname + '/') File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/fitting.py", line 206, in load return Organizer.load(self, z, subpath) File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/organizer.py", line 157, in load struc.load(z, subpath + 'structure/' + strucName + '/') File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/fitstructure.py", line 776, in load self.custom_spacegroup = CtrlUnpickler.loads(spkl) File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/pdfguicontrol.py", line 564, in loads return pickle.loads(s) UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 22: ordinal not in range(128)- ddp files that works: ddp files at the
doc/tutorialfolder. - ddp files that doesn't work: cryostat Ho2Ti2O7_0_60A.ddp or BFTO_Pm-3m.ddp (ask Long for the file)
- ddp files that works: ddp files at the
dragonyanglong commented
on Dec 18, 2021 CollaboratorAuthorMore actionsHey guys,
A small note on this. I just ran into this issue with a fresh install of PDFgui 3.1.0 on Python 3.12 when opening an older .ddp project. The traceback ended with:
return pickle.loads(s) UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 ...
I can confirm that changing
CtrlUnpickler.loads()inpdfguicontrol.pyfromreturn pickle.loads(s)
to
return pickle.loads(s, encoding="latin1")
fixed the problem for me and I was able to use the old .ddp normally, in a new conda-forge PDFgui install. I'm not sure if this exists in a PR or something already.
Metadata
Metadata
Assignees
Labels
No labels