Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5015
| References | <BANLkTi=g2h_BxZDdTdLqyB3nZCukD+Dupw@mail.gmail.com> <4DC838CD.7030404@stoneleaf.us> <BANLkTimuEQMsjyPyW2XUzpQeU8chNPeyGg@mail.gmail.com> <4DC84223.3000502@stoneleaf.us> |
|---|---|
| Date | 2011-05-09 15:29 -0400 |
| Subject | Re: Inconsistency with split() - Script, OS, or Package Problem? |
| From | James Wright <jamfwright@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1347.1304969377.9059.python-list@python.org> (permalink) |
On Mon, May 9, 2011 at 3:36 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> James Wright wrote:
>>
>> Thank you Ethan,
>>
>> This is what I see now:
>>
>> # python render4.py
>> current each_value is: 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
>>
>> # grep -i vsr *
>> #
>>
>> Using the informational line you suggested I see that 'vsr' showing as
>> the current each_value. The string 'vsr' does not exist in my data
>> though. Where could this be coming from?
>
> So 'vsr' in the value -- what is the key? (Sorry, should have had you print
> that at the same time...)
>
> 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.
>
> ~Ethan~
>
Hi Ethan,
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
Thanks,
James
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 15:29 -0400
csiph-web