[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-11 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, the patch is not correct. The core issue is that _Unpickler_Readline should 
always return a \0-terminated string, but sometimes it doesn't; this issue 
should be fixed instead of working around it in some other function.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-11 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I confess I'm not familiar enough with the pickle module internals to be sure 
of putting in the right fix quickly. I will take a look at _Unpickler_Readline 
when I get a chance, if someone doesn't beat me to it :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-11 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset c47bc1349e61 by Antoine Pitrou in branch '3.2':
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 
0, mostly) pickles.
http://hg.python.org/cpython/rev/c47bc1349e61

New changeset 6aa822071f4e by Antoine Pitrou in branch 'default':
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 
0, mostly) pickles.
http://hg.python.org/cpython/rev/6aa822071f4e

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-11 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Fixed with a test.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-10 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
hgrepos: +58
resolution:  - accepted
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-10 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
keywords: +patch
Added file: http://bugs.python.org/file22872/6394321ef4ec.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-10 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


Added file: http://bugs.python.org/file22876/fac0421cb7b2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-10 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

First, the patch calls PyOS_strtol while a Py_ssize_t should be decodable. 
However, the dump phase (in memo_put) coerces the memo size to long as well, so 
this shouldn't be a problem in real life.

Second, the patch needs a test.

Also, please click on the resolution link for meaning of the various possible 
values. Accepted is only to be used when something has been positively 
reviewed.

--
resolution: accepted - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-10 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I can add a test, using the data attached to the ticket, but like the marshal 
case we discussed before, it might be several KB of data, which I would 
incorporate into the tests using a similar approach to the one I used for 
marshal. (This data has been shrunk from a much larger data set, but I can't 
easily make it any smaller.)

I've no idea why I changed the resolution, I don't normally do this. Probably a 
case of brain-fade :-(

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-05 Thread Andrew Wilkins

Andrew Wilkins axw...@gmail.com added the comment:

In _pickle.c, the load_put function calls _Unpickler_Readline, which may 
prefetch data and place it after the line read in with readline. load_put 
then calls PyLong_FromString, which doesn't like the trailing data after the 
'\n'.

Maybe just use PyOS_strtol instead? Alternatively, replace the newline with a 
null byte.

--
nosy: +axwalk

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-03 Thread Vinay Sajip

New submission from Vinay Sajip vinay_sa...@yahoo.co.uk:

The attached 2.x-written protocol 0 pickle file cannot be loaded by Python 3.2 
or 3.3, though it loads successfully in 2.x.

Code used to load:

data = pickle.load(open('test.bin', 'rb'))

Error:

Traceback (most recent call last):
  File load_it.py, line 4, in module
data = pickle.load(open(sys.argv[1], 'rb'))
ValueError: invalid literal for int() with base 10: 
273\n(g8\nS'uint64_t'\np274\ntp275\nsS'Module'\np276\n(g45\n(g39\nS'objc_module'\np277\nNtp278\ntp279\nsS'mach_msg_trailer_size_t'\np280\n(g4\ng190\ntp281\nsS'uint_fast16_t'\np282\n(g8\nS'uint16_t'\np283\ntp284\nsS'pthread_m

The failure occurs on Ubuntu Natty. This does not appear to be the same issue 
as #6137.

AFAIK the data contains no classes: just dictionaries, tuples, lists, strings 
and numbers.

--
components: Library (Lib)
files: test.bin
messages: 141602
nosy: alexandre.vassalotti, pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: Python 3.2 fails to load protocol 0 pickle
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22831/test.bin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12687] Python 3.2 fails to load protocol 0 pickle

2011-08-03 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I also noticed that in the file there are numerous previous integer values in a 
similar context, which were parsed without error. For example, if you look at 
the test.bin file in an editor, the failure occurs while parsing line 515. 
Notice the similar constructs at lines 510, 507, 504 etc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12687
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com