Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5009 > unrolled thread
| Started by | James Wright <jamfwright@gmail.com> |
|---|---|
| First post | 2011-05-09 15:10 -0400 |
| Last post | 2011-05-09 16:08 -0400 |
| Articles | 3 — 2 participants |
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.
Re: Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 15:10 -0400
Re: Inconsistency with split() - Script, OS, or Package Problem? Alex Willmer <alex@moreati.org.uk> - 2011-05-09 13:02 -0700
Re: Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 16:08 -0400
| From | James Wright <jamfwright@gmail.com> |
|---|---|
| Date | 2011-05-09 15:10 -0400 |
| Subject | Re: Inconsistency with split() - Script, OS, or Package Problem? |
| Message-ID | <mailman.1343.1304968241.9059.python-list@python.org> |
Hello Ian,
It does indeed to seem that way. However the script works just fine
on other machines, with the same input file.
Thanks,
James
On Mon, May 9, 2011 at 2:41 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Mon, May 9, 2011 at 12:10 PM, James Wright <jamfwright@gmail.com> wrote:
>> Hello,
>>
>> I have been using a script on several boxes that have been around for
>> a while, and everything works just fine. I am finding though, that on
>> some new OS installs the script fails with:
>>
>> Traceback (most recent call last):
>> File "render4.py", line 114, in <module>
>> create_report_index(each_item)
>> File "render4.py", line 25, in create_report_index
>> [clean_name, _] = each_value.split('_', 1)
>> ValueError: need more than 1 value to unpack
>
> You should check the value of each_value at the point when the script
> fails. It sounds like split() is getting passed a string that doesn't
> contain any '_' characters at all, resulting in a sequence with only
> one value. Passing 1 as the second argument ensures that there will
> be at most 1 split, but there may still be fewer.
>
> Cheers,
> Ian
>
[toc] | [next] | [standalone]
| From | Alex Willmer <alex@moreati.org.uk> |
|---|---|
| Date | 2011-05-09 13:02 -0700 |
| Message-ID | <3722b403-ac45-4360-a13b-4814f14de389@gu8g2000vbb.googlegroups.com> |
| In reply to | #5009 |
(Direct reply to me, reposted on Jame's behalf) Hi Alex, On Mon, May 9, 2011 at 3:21 PM, Alex Willmer <alex@moreati.org.uk> wrote: > On May 9, 8:10 pm, James Wright <jamfwri...@gmail.com> wrote: >> Hello Ian, >> >> It does indeed to seem that way. However the script works just fine >> on other machines, with the same input file. > > How sure of that are you? Post md5sums of the script and the input > file on a working machine and a non-working (4 md5sums total). > > Does the script use an non-stdlib modules? Check the md5sum of those > too. > > Are the platforms/python versions the same? Post the uname and python - > v from each. > > Can you post the script and the file online for us? Do so. > > Regards, Alex > The md5sums match (great idea by the way, I hadn't thought of that). What do you mean by using a non-stdlib module? I am not using any import statements, if that is what you are referring to. As for kernel and Python versions, I have updated both in case this was a bug - they no longer match across the machines I am testing on. The script consistently works with the machines that it always has been working with. The script continues to not work on the new VMWare installs (but does in new VirtualBox installs - odd). I can post the script (attached), but am not so certain that is at fault - given that the script is running on other hosts just fine. Please read the script with a grain of salt, this is my first run at this, and I am well aware that I am not yet following the conventions of Python. I have much to learn. Thanks, James
[toc] | [prev] | [next] | [standalone]
| From | James Wright <jamfwright@gmail.com> |
|---|---|
| Date | 2011-05-09 16:08 -0400 |
| Message-ID | <mailman.1352.1304971729.9059.python-list@python.org> |
| In reply to | #5018 |
Sorry Alex, and thank you. On Mon, May 9, 2011 at 4:02 PM, Alex Willmer <alex@moreati.org.uk> wrote: > (Direct reply to me, reposted on Jame's behalf) > > > > Hi Alex, > > On Mon, May 9, 2011 at 3:21 PM, Alex Willmer <alex@moreati.org.uk> > wrote: >> On May 9, 8:10 pm, James Wright <jamfwri...@gmail.com> wrote: >>> Hello Ian, >>> >>> It does indeed to seem that way. However the script works just fine >>> on other machines, with the same input file. >> >> How sure of that are you? Post md5sums of the script and the input >> file on a working machine and a non-working (4 md5sums total). >> >> Does the script use an non-stdlib modules? Check the md5sum of those >> too. >> >> Are the platforms/python versions the same? Post the uname and python - >> v from each. >> >> Can you post the script and the file online for us? Do so. >> >> Regards, Alex >> > > The md5sums match (great idea by the way, I hadn't thought of that). > > What do you mean by using a non-stdlib module? I am not using any > import statements, if that is what you are referring to. > > As for kernel and Python versions, I have updated both in case this > was a bug - they no longer match across the machines I am testing on. > The script consistently works with the machines that it always has > been working with. The script continues to not work on the new VMWare > installs (but does in new VirtualBox installs - odd). > > I can post the script (attached), but am not so certain that is at > fault - given that the script is running on other hosts just fine. > > Please read the script with a grain of salt, this is my first run at > this, and I am well aware that I am not yet following the conventions > of Python. I have much to learn. > > > > Thanks, > James > -- > http://mail.python.org/mailman/listinfo/python-list >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web