Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5000
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <jamfwright@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'dictionary': 0.07; 'snippet': 0.07; 'python': 0.07; ':-)': 0.07; 'case).': 0.09; 'issue?': 0.09; 'subject:Problem': 0.09; 'valueerror:': 0.09; '25,': 0.12; 'def': 0.13; "'w')": 0.16; '11.3': 0.16; 'coded': 0.16; 'install.': 0.16; 'installs': 0.16; 'subject:split': 0.16; 'unpack': 0.16; 'virtualbox': 0.16; 'vmware': 0.16; 'traceback': 0.16; '(most': 0.16; 'thanks,': 0.17; 'compiled': 0.18; 'work,': 0.20; 'programming': 0.20; 'code': 0.22; 'last):': 0.23; 'received:209.85.212': 0.25; 'version': 0.25; 'index': 0.25; 'creating': 0.26; 'script': 0.26; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.28; 'packages': 0.29; 'subject:?': 0.29; 'fine.': 0.29; 'iso': 0.31; 'os,': 0.31; 'match': 0.31; 'to:addr:python-list': 0.32; "i've": 0.33; 'skip:e 20': 0.33; 'hosted': 0.33; 'several': 0.33; 'using': 0.34; 'skip:" 10': 0.34; 'difference': 0.35; 'file': 0.35; 'finding': 0.35; 'fails': 0.35; 'quite': 0.36; 'hello,': 0.36; 'report': 0.37; 'data': 0.37; 'some': 0.37; 'should': 0.37; 'received:209.85': 0.37; 'subject:with': 0.37; 'received:google.com': 0.38; 'install': 0.38; 'though': 0.38; 'though,': 0.39; 'to:addr:python.org': 0.39; 'could': 0.39; 'received:209': 0.39; 'works': 0.40; 'header:Received:5': 0.40; 'simple': 0.60; 'exact': 0.60; 'manner': 0.63; 'remember': 0.65; 'here': 0.65; 'believe': 0.66; 'failure': 0.71; 'lucky': 0.74; 'subject:Package': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=kGxuYvr1bvy5sJuE8ALe9JYdqiQFyHhSht0eBf0FxWE=; b=CiQAXFpEYU7gwpJP6bkFNy+hhUZn0ItHk+UrLxT1Yw47s5jTI5eibCvOUjP9+E4YZP DETQTFL0wH9RlYBOZkL108bpPzjnEY9bPBKUE8EMKolWrBcj8rk35SQrVHWb8ETG9GcG yUG+Yi1+P4JkbrBwMYONpptBJnFt35Mlx2/6E= |
| DomainKey-Signature | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OjvCDG1Q6U1KtbdulHAu0GxRXUtpdPp5Sb/jbudE/P9Wk08t0o05uDzefsh/uzuCGh qJ7SeyhuTXyAPtMTyrYxqm6gSd9Jo17LMQV1ZzKTkcZsSUsbHIKz5uxr3SJbRngOhEnD yWsBZQ3rzmGOb7YBMRixcZtxqjwbyWhrHgXeo= |
| MIME-Version | 1.0 |
| Date | Mon, 9 May 2011 14:10:21 -0400 |
| Subject | Inconsistency with split() - Script, OS, or Package Problem? |
| From | James Wright <jamfwright@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1338.1304964624.9059.python-list@python.org> (permalink) |
| Lines | 50 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1304964625 news.xs4all.nl 41114 [::ffff:82.94.164.166]:47277 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:5000 |
Show key headers only | View raw
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
The OS's are various OpenSuse installs from 10.3 to 11.4. It works on
all the existing ones, which leads me to believe that I have a package
or configuration inconsistency. It should be noted though that I am
quite new to python programming and very well could have coded in a
non-portable manner and was just lucky to get it working in the first
place :)
Here is the code snippet that generates the failure ( when you look
at this remember that I am a novice :-) ):
for each_item in D4: #D4 is a dictionary
create_report_index(each_item)
def create_report_index(report): #Here we are creating a simple
index.html file from data in a text file
newfile = open(report + '.html', 'w') #Create the index file using
report name
for each_value in D4[report]:
[clean_name, _] = each_value.split('_', 1)
newfile.write('<a href="' + report +'//' + each_value +
'/index.htm">' + clean_name + '</a><BR>\n')
I've tried to match packages from a known working install and even
compiled a newer python (one known to work, version 3.1.3 in this
particular case). The only discernible difference is that the new OS
installs are VM's hosted on VMWare ESX. Using the same ISO I can spin
up a VirtualBox VM and the script works just fine. I've tried this
with OpenSuse 11.3 and 11.4, once again, using the exact same ISO's to
install.
Do I have a Python, OS, or package issue?
Many thanks,
James
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 14:10 -0400
Re: Inconsistency with split() - Script, OS, or Package Problem? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-09 18:43 +0000
Re: Inconsistency with split() - Script, OS, or Package Problem? James Wright <jamfwright@gmail.com> - 2011-05-09 15:09 -0400
Re: Inconsistency with split() - Script, OS, or Package Problem? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-10 00:00 +0000
csiph-web