[Biopython-dev] Pickle problem on 64 bit Windows with Python 3.4
Peter Cock
p.j.a.cock at googlemail.com
Mon Apr 21 16:27:57 UTC 2014
Hi Manlio,
One of the new errors you reported under Python 3.4 on Windows 7 was:
======================================================================
ERROR: test_SubsMat
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\Public\BioPython3\biopython\Tests\run_tests.py", line
408, in runTest
suite = unittest.TestLoader().loadTestsFromName(name)
File "C:\Python34\lib\unittest\loader.py", line 105, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "C:\Users\Public\BioPython3\biopython\Tests\test_SubsMat.py",
line 38, in <module>
acc_rep_mat = pickle.load(handle)
_pickle.UnpicklingError: the STRING opcode argument must be quoted
Except copied from test log here:
http://lists.open-bio.org/pipermail/biopython-dev/2014-April/011265.html
I suspect this could be a problem in Python itself, since pickle was
changed in Python 3.4:
https://docs.python.org/3.4/whatsnew/2.3.html#pep-307-pickle-enhancements
http://www.python.org/dev/peps/pep-0307
Can you try this example on your machine - from my Mac:
$ cd Tests/SubsMat
$ python3.4 -c "import pickle; h = open('acc_rep_mat.pik', 'rb'); m =
pickle.load(h); h.close(); print(m)"
{('D', 'W'): 22, ..., ('A', 'E'): 207}
>From 32 bit Windows XP, it also works for me:
C:\repositories\biopython\Tests\SubsMat>c:\python34\python -c "import
pickle; h = open('acc_rep_mat.pik', 'rb'); m = pickle.load(h);
h.close(); print(m)"
{('H', 'S'): 59, ..., ('K', 'P'): 94}
Note the dictionary order is expected to change. Also I am not
using a with statement in order to make a single command line
friendly test you can copy & paste into the Windows terminal.
It would be more work, but if you could try Python 3.3 that would be
useful (and helpful if we get to run your desktop as a buildslave).
Thanks,
Peter
More information about the Biopython-dev
mailing list