This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Georg
Recipients Georg
Date 2008-09-18.20:58:32
SpamBayes Score 1.1857959e-11
Marked as misclassified No
Message-id <1221771515.01.0.0624093584871.issue3903@psf.upfronthosting.co.za>
In-reply-to
Content
Hi all,
I compiled Python3.0rc1 with the usual ./configure make make test make
install on my Athlon XP 1800 (32 bit), using Debian Etch as OS, the
following works on Python2.4 (default in Debian Etch), but not with
Python3.0rc1:

>>> import pickle
>>> d = {'ID':345, 'AD':'Hallo'}
>>> f = open('test.hhh', 'wb')
>>> pickle.dump(d,f,2)
>>> f.close()
>>> f = open('test.hhh', 'r')
>>> pickle.load(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.0/pickle.py", line 1325, in load
    return Unpickler(file, encoding=encoding, errors=errors).load()
  File "/usr/local/lib/python3.0/io.py", line 1728, in read
    eof = not self._read_chunk()
  File "/usr/local/lib/python3.0/io.py", line 1557, in _read_chunk
    self._set_decoded_chars(self._decoder.decode(input_chunk, eof))
  File "/usr/local/lib/python3.0/io.py", line 1294, in decode
    output = self.decoder.decode(input, final=final)
  File "/usr/local/lib/python3.0/codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0:
unexpected code byte
>>>

the same if you specifiy protocol number 3, it works also in
Python3.0rc1 if you specifiy 'rb' instead of 'r' as file opening method,
but according to the Python library reference it should work also with
'r'.  How should one know with which protocol the object was pickled?

Thanks very much, 

Georg
History
Date User Action Args
2008-09-18 20:58:35Georgsetrecipients: + Georg
2008-09-18 20:58:35Georgsetmessageid: <1221771515.01.0.0624093584871.issue3903@psf.upfronthosting.co.za>
2008-09-18 20:58:34Georglinkissue3903 messages
2008-09-18 20:58:32Georgcreate