[ python-Bugs-1672332 ] cPickle can pickle, but cannot unpickle on 64bit machines

SourceForge.net noreply at sourceforge.net
Sat Mar 10 18:09:14 CET 2007


Bugs item #1672332, was opened at 2007-03-02 12:10
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1672332&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bartlomiej Ogryczak (oneg)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle can pickle, but cannot unpickle on 64bit machines

Initial Comment:
Seems that on 64-bit machines cPickle is able to pickle floats smaller then DBL_MIN, but it's unable to unpickle them. 

64-bit machine (Solaris 10 on Sparc)
Python 2.4.4 (#1, Oct 26 2006, 10:01:37)
[GCC 3.3.4] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
>>> cPickle.dumps(1e-310)
'F9.9999999999999694e-311\n.'
>>> cPickle.loads(_)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: could not convert string to float

Same thing works fine on 32-bit machine (P4 with MS Windows)
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
>>> cPickle.dumps(1e-310)
'F0\n.'
>>>


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2007-03-10 18:09

Message:
Logged In: YES 
user_id=21627
Originator: NO

If python is a 32-bit binary, it should be completely irrelevant that the
processor is a 64-bit processor. Python can't tell the difference.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2007-03-05 22:46

Message:
Logged In: YES 
user_id=849994
Originator: NO

I seem to remember that float pickling has been overhauled for 2.5, could
you try with a 2.5 Python and report the results?

----------------------------------------------------------------------

Comment By: Bartlomiej Ogryczak (oneg)
Date: 2007-03-05 17:49

Message:
Logged In: YES 
user_id=1733256
Originator: YES

I forgot to specify, it's 32-bit Python binary. I'm guessing yours is
64-bit binary on 64-bit system?
Some additional info:
gcc --version
gcc (GCC) 3.3.4
$ file `which python`
ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not
stripped
$ ldd `which python`
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libstdc++.so.5 =>        /usr/local/lib/libstdc++.so.5
        libm.so.2 =>     /usr/lib/libm.so.2
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        libmd5.so.1 =>   /usr/lib/libmd5.so.1
        libscf.so.1 =>   /usr/lib/libscf.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libdoor.so.1 =>  /usr/lib/libdoor.so.1
        libuutil.so.1 =>         /usr/lib/libuutil.so.1
        /platform/SUNW,Sun-Fire-15000/lib/libc_psr.so.1
        /platform/SUNW,Sun-Fire-15000/lib/libmd5_psr.so.1


----------------------------------------------------------------------

Comment By: Santiago Gala (sgala)
Date: 2007-03-05 17:38

Message:
Logged In: YES 
user_id=178886
Originator: NO

FYI: it doesn't happen for me in python 2.4.3, 2.5svn and 2.6svn built on
linux (x86_64) with gcc-4.1.2, so it looks compiler version or hw platform
specific.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1672332&group_id=5470


More information about the Python-bugs-list mailing list