Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5016

Re: Inconsistency with split() - Script, OS, or Package Problem?

References <BANLkTi=g2h_BxZDdTdLqyB3nZCukD+Dupw@mail.gmail.com> <4DC838CD.7030404@stoneleaf.us> <BANLkTimuEQMsjyPyW2XUzpQeU8chNPeyGg@mail.gmail.com> <4DC84223.3000502@stoneleaf.us> <BANLkTinCBHbQoJ89OGawt9r02VQvCTeSqw@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-05-09 13:51 -0600
Subject Re: Inconsistency with split() - Script, OS, or Package Problem?
Newsgroups comp.lang.python
Message-ID <mailman.1348.1304970693.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, May 9, 2011 at 1:29 PM, James Wright <jamfwright@gmail.com> wrote:
> It does not appear to show a key:
>
> D4[] = vsr
> Traceback (most recent call last):
>  File "render4.py", line 115, in <module>
>    create_report_index(each_item)
>  File "render4.py", line 26, in create_report_index
>    [clean_name, _] = each_value.split('_', 1)
> ValueError: need more than 1 value to unpack

The key appears to be the empty string.  You can confirm that by
changing the %s to %r in Ethan's diagnostic.  That will print out the
repr() of the value, which should make it more clear what the value
actually is.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Inconsistency with split() - Script, OS, or Package Problem? Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-09 13:51 -0600

csiph-web