[pypy-issue] [issue802] Incorrect error message when string split assignment cannot unpack values
Yesudeep Mangalapilly
tracker at bugs.pypy.org
Thu Jul 21 14:31:48 CEST 2011
New submission from Yesudeep Mangalapilly <yesudeep at gmail.com>:
Incorrect error message generated when trying to
unpack values in an assignment:
Current Behavior:
-----------------
$ pypy
Python 2.7.1 (b590cf6de419, Apr 30 2011, 03:30:00)
[PyPy 1.5.0-alpha0 with GCC 4.0.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``<cami> I like workin with pypy,
it's like speaking chinese''
>>>> n, v = "something".split("=", 1)
Traceback (most recent call last):
File "<console>", line 1, in <module>
ValueError: expected length 2, got 1
Expected Behavior:
------------------
$ python
Python 2.7.1 (r271:86832, Dec 4 2010, 05:03:53)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> n, v = "something".split("=", 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: need more than 1 value to unpack
Essentially, the error message needs to be changed.
Some of our in-code asserts started failing because
of this.
----------
messages: 2833
nosy: pypy-issue, yesudeep
priority: bug
status: unread
title: Incorrect error message when string split assignment cannot unpack values
________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue802>
________________________________________
More information about the pypy-issue
mailing list