[Biopython-dev] Pickle problem on 64 bit Windows with Python 3.4

Manlio Calvi manlio.calvi at gmail.com
Mon Apr 21 13:00:34 EDT 2014


I think we hit a stumbling block here, and maybe a serious one (but
we'll be sure with more tests),  because this following error suggest
me the way we used the pickling in the code changed or something
strange happened in my config.
Apart from installing a 3.3, I'll try to go experimental with 3.4, I
want to understand if it is a problem with my build of 3.4 or if it is
a general issue of 3.4 with some piece of BioPython.

C:\Users\Public\BioPython3\biopython\Tests\SubsMat>python -c "import pickle; h =
 open('acc_rep_mat.pik', 'rb'); m = pickle.load(h);h.close();print(m);

Traceback (most recent call last):
  File "<string>", line 1, in <module>
_pickle.UnpicklingError: the STRING opcode argument must be quoted

On Mon, Apr 21, 2014 at 6:27 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> 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