Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.04; 'value,': 0.04; 'subject:Problem': 0.09; 'valueerror:': 0.09; 'pm,': 0.11; 'wrote:': 0.14; 'repr()': 0.16; 'subject:split': 0.16; 'unpack': 0.16; 'traceback': 0.16; '(most': 0.16; 'appear': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'mon,': 0.22; 'last):': 0.23; 'appears': 0.24; 'received:209.85.161.46': 0.26; 'received:mail- fx0-f46.google.com': 0.26; 'message-id:@mail.gmail.com': 0.28; 'changing': 0.29; 'received:209.85.161': 0.29; 'subject:?': 0.29; 'cc:addr:python.org': 0.31; 'does': 0.31; 'skip:e 20': 0.33; 'skip:" 10': 0.34; 'actually': 0.34; 'print': 0.35; 'wright': 0.35; 'should': 0.37; 'received:209.85': 0.37; 'subject:with': 0.37; 'skip:\xa0 30': 0.38; 'received:google.com': 0.38; 'received:209': 0.39; '8bit%:8': 0.39; 'empty': 0.40; 'header:Received:5': 0.40; '2011': 0.62; 'show': 0.67; '26,': 0.68; 'confirm': 0.71; 'subject:Package': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=g32O24AWHMq1dV2rwXaEHGkDe75hOvdDFwLrVLmOgkw=; b=irfztjiRNLoBFLlG4hhzQwUycOENRtGlNR+0dc7PJ2S4UwsLbN9y6RT0qnM7HxhXWY HkPIvQ8BQFKRrXtlrCjaNXYFBG/fUYG7OIfIoy4M+Mg0mUGTJFizjFTnMzmW7h0bVzQt 91pc3PiRfnAPK0lx63aHRf1Cj6JVBOJAZzkFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=kq/UdQ8LpkH9IcnFZz2lBcmjUM7anJKH2Y77YIV0jNaeE+57Lu0NmTP9Evh9nKONur e6kt8+TGQDvQILiM5eFFMrjqCsgI66i+gduSwA9i7yLxEXJI9GmZ3w1lWcyVxH44Le0H bufNEFu8SIHnCSkNHx9V+i/ry9WfN9naFmpfg= MIME-Version: 1.0 In-Reply-To: References: <4DC838CD.7030404@stoneleaf.us> <4DC84223.3000502@stoneleaf.us> From: Ian Kelly Date: Mon, 9 May 2011 13:51:01 -0600 Subject: Re: Inconsistency with split() - Script, OS, or Package Problem? To: James Wright Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1304970694 news.xs4all.nl 41114 [::ffff:82.94.164.166]:33368 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5016 On Mon, May 9, 2011 at 1:29 PM, James Wright wrote: > It does not appear to show a key: > > D4[] =3D vsr > Traceback (most recent call last): > =A0File "render4.py", line 115, in > =A0 =A0create_report_index(each_item) > =A0File "render4.py", line 26, in create_report_index > =A0 =A0[clean_name, _] =3D 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.