Message127735
| Author |
jdharper |
| Recipients |
jdharper |
| Date |
2011年02月02日.15:31:28 |
| SpamBayes Score |
5.848988e-12 |
| Marked as misclassified |
No |
| Message-id |
<1296660689.12.0.256726786227.issue11099@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
When a bytes object is pickled with 3.1 and then unpickled with 2.7, the results are incorrect. The example below shows that pickling
b'abcdefg' in 3.1 and then unpickling in 2.7 produces the string
'[97L, 98L, 99L, 100L, 101L, 102L, 103L]'
The unpickling operation should return 'abcdefg'.
C:\decompyle\jtest>c:\Python31\python
Python 3.1.3 (r313:86834, Nov 27 2010, 18:30:53) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> file = open('test.pkl', 'wb')
>>> import pickle
>>> pickle.dump(b'abcdefg', file, 0)
>>> exit()
C:\decompyle\jtest>c:\python27\python
Python 2.7 Stackless 3.1b3 060516 (release27-maint, Jul 22 2010, 18:58:18) [MSC
v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> file = open('test.pkl', 'rb')
>>> import pickle
>>> pickle.load(file)
'[97L, 98L, 99L, 100L, 101L, 102L, 103L]'
>>> |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年02月02日 15:31:29 | jdharper | set | recipients:
+ jdharper |
| 2011年02月02日 15:31:29 | jdharper | set | messageid: <1296660689.12.0.256726786227.issue11099@psf.upfronthosting.co.za> |
| 2011年02月02日 15:31:28 | jdharper | link | issue11099 messages |
| 2011年02月02日 15:31:28 | jdharper | create |
|