Hi @aPeter1, I will provide the pickel .ddp files for you in the email. I did a few tests before in the PR review #42 and it seems like the first condition works if I remember correctly (ie. use the py2 pdfgui to open the py3 saved ddp file)
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 .
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:
I can confirm that changing CtrlUnpickler.loads() in pdfguicontrol.py from
returnpickle.loads(s)
to
returnpickle.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.
Activity
dragonyanglong commented on Oct 9, 2020
Hi @aPeter1, I will provide the pickel .ddp files for you in the email. I did a few tests before in the PR review #42 and it seems like the first condition works if I remember correctly (ie. use the py2 pdfgui to open the py3 saved ddp file)
dragonyanglong commented on Oct 9, 2020
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
I 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)dragonyanglong commented on Dec 18, 2021
ref: https://rebeccabilbro.github.io/convert-py2-pickles-to-py3/
sbanerjee23 commented on Aug 23, 2026
Hey 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:
I can confirm that changing CtrlUnpickler.loads() in pdfguicontrol.py from
to
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.