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


Groups > comp.lang.python > #5020 > unrolled thread

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

Started byJames Wright <jamfwright@gmail.com>
First post2011-05-09 16:08 -0400
Last post2011-05-09 16:08 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 16:08 -0400

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

FromJames Wright <jamfwright@gmail.com>
Date2011-05-09 16:08 -0400
SubjectRe: Inconsistency with split() - Script, OS, or Package Problem?
Message-ID<mailman.1351.1304971704.9059.python-list@python.org>
Hello Ethan,

On Mon, May 9, 2011 at 4:04 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> James Wright wrote:
>>
>> On Mon, May 9, 2011 at 3:36 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
>>>
>>> Change your print line to:
>>>
>>>   print("D4[%s] = %s" % (report, each_value))
>>>
>>> After that, you'll have to track down how D4 is being created to see
>>> where
>>> 'vsr' is coming from.
>>
>> It does not appear to show a key:
>>
>> D4[] = vsr
>
> Huh -- probably the empty string ('') -- to verify that (and know for sure
> -- always good when debugging! ;)  change the both %s to %r and run again;
>  then you'll have to track down where D4 is being created to see why it's
> getting that weird key.
>
> ~Ethan~
>

A quick note: Renaming the file allowed it to run successfully one
time.  Then it failed per usual.  Renaming it again did not help, so
that is not a repeatable test.

Changing %s to %r:

D4[''] = vsr
Traceback (most recent call last):
  File "render5.py", line 115, in <module>
    create_report_index(each_item)
  File "render5.py", line 26, in create_report_index
    [clean_name, _] = each_value.split('_', 1)
ValueError: need more than 1 value to unpack



Thanks,
James

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web