[issue15079] pickle: Possibly misplaced test

2012-06-26 Thread Roundup Robot

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

New changeset 5881a58c5425 by Antoine Pitrou in branch '3.2':
Issue #15079: make a test applicable to both C and Python versions of the 
pickle module.
http://hg.python.org/cpython/rev/5881a58c5425

New changeset b66e82c9f852 by Antoine Pitrou in branch 'default':
Issue #15079: make a test applicable to both C and Python versions of the 
pickle module.
http://hg.python.org/cpython/rev/b66e82c9f852

--
nosy: +python-dev

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



[issue15079] pickle: Possibly misplaced test

2012-06-26 Thread Antoine Pitrou

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

Committed. Congratulations on your first patch!

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.2

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



[issue15079] pickle: Possibly misplaced test

2012-06-22 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +pitrou

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



[issue15079] pickle: Possibly misplaced test

2012-06-15 Thread Stefan M

New submission from Stefan M mstefa...@gmail.com:

After issue7455 was fixed, a test was created to reflect the fix 
(Lib/test/pickletester.py @ AbstractPickleModuleTests.test_bad_input). The test 
makes sure that an UnpicklingError is raised whenever pickled data attempts to 
pop on an empty stack.
Although tests on AbstractPickleModuleTests normally only run on the C 
implementation of pickle (on which UnpicklingError is thrown), they may also 
run on the Python implementation if the C implementation of pickle is not 
available (which throws IndexError). I'm not sure if it's still reasonable to 
assume that it's possible for the C implementation of pickle not to exist (the 
python module does), as I've discovered this by forcefully disabling the C 
implementation.

 pickle.Unpickler(io.BytesIO(b'0')).load()
_pickle.UnpicklingError: unpickling stack underflow

 pickle._Unpickler(io.BytesIO(b'0')).load()
IndexError: list assignment index out of range

The current fix involves adding IndexError to the list of exceptions that may 
be raised and moving the testcase to AbstractPickleTests (where the tests are 
ran against both the C and Python impl).

As I'm working on improving pickle in protocol v4, it might be worth 
considering adding more consistency to the exceptions that are being raised by 
the Python unpickler.

--
components: Tests
files: pickletester.py.patch
keywords: patch
messages: 162919
nosy: alexandre.vassalotti, collinwinter, mstefanro
priority: normal
severity: normal
status: open
title: pickle: Possibly misplaced test
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file26019/pickletester.py.patch

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



[issue15079] pickle: Possibly misplaced test

2012-06-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

It would be best to have the pickle tests always run against both the C and 
python code.  We do this for other modules that have C versions of some or all 
of the Python code.  And yes, making the two consistent is also good.  Since 
pickle is generally not used without the C code, making the Python consistent 
with the C would seem to be a low-impact change.

--
nosy: +r.david.murray
versions: +Python 3.3 -Python 3.4

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



[issue15079] pickle: Possibly misplaced test

2012-06-15 Thread Collin Winter

Changes by Collin Winter coll...@gmail.com:


--
nosy:  -collinwinter

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