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


Groups > comp.lang.python > #19725

Re: TypeError

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!weretis.net!feeder1.news.weretis.net!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <nicholas.dokos@hp.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'referencing': 0.09; 'value:': 0.09; 'argument': 0.15; 'cc:addr:python-list': 0.15; 'nick': 0.16; 'string",': 0.16; 'wrote:': 0.16; 'meant': 0.17; '>>>': 0.18; 'reason,': 0.18; 'string,': 0.18; '(most': 0.21; 'to:2**1': 0.21; 'cc:no real name:2**0': 0.21; 'header:In-Reply- To:1': 0.22; 'figure': 0.23; 'string': 0.24; 'traceback': 0.24; 'code': 0.25; 'guess': 0.25; "skip:' 10": 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'none,': 0.30; 'typeerror:': 0.30; 'error': 0.30; 'correct': 0.31; 'list': 0.32; 'it.': 0.33; 'last):': 0.34; 'question': 0.35; 'file': 0.35; 'cc:2**1': 0.36; 'none': 0.36; 'sequence': 0.36; 'but': 0.37; 'received:org': 0.37; 'some': 0.38; 'should': 0.38; 'finding': 0.39; "i'd": 0.39; 'expected': 0.39; 'subject:: ': 0.39; 'reply-to:no real name:2**0': 0.72; 'header:Reply-to:1': 0.84
X-Quarantine-ID <nXuNn7VxIQbM>
X-Amavis-Alert BAD HEADER SECTION, Duplicate header field: "Cc"
To "Clark\, Kathleen" <katie.clark@yale.edu>
From Nick Dokos <nicholas.dokos@hp.com>
Subject Re: TypeError
In-Reply-To Message from "Clark\, Kathleen" <katie.clark@yale.edu> of "Wed\, 01 Feb 2012 16\:53\:41 GMT." <0610E9FC98B37742AD184612801101F834B04E@x10-mbx4.yu.yale.edu>
References <0610E9FC98B37742AD184612801101F834B04E@x10-mbx4.yu.yale.edu>
Organization HPCS
X-Mailer MH-E 8.3.1; nmh 1.3; GNU Emacs 24.0.92
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
Date Wed, 01 Feb 2012 12:27:47 -0500
Sender nicholas.dokos@hp.com
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To nicholas.dokos@hp.com
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.5309.1328117762.27778.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328117762 news.xs4all.nl 6842 [2001:888:2000:d::a6]:42286
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19725

Show key headers only | View raw


Clark, Kathleen <katie.clark@yale.edu> wrote:



> TypeError: sequence item 1: expected string, NoneType found
> 
> The error message is referencing line 86 of my code:
> 
> ws.cell(row=row, column=1).value = ','.join([str(ino), fn, ln, sdob])
> 
> If I’m understanding this correctly, the code is expecting a string, but not finding it.  I’m
> wondering, what is meant by a “string” and also how I can figure out the problem and correct it. 

I'd guess that the sequence in question is the list that's the argument
of join(), in which case item 1 is fn: it should be a string but for some
reason, it is a None value:

,----
| >>> ','.join([str(45), None, "bar", "foo"])
| Traceback (most recent call last):
|   File "<stdin>", line 1, in <module>
| TypeError: sequence item 1: expected string, NoneType found
|>>> ','.join([str(45), "a string", "bar", "foo"])
|'45,a string,bar,foo'
`----

Nick

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: TypeError Nick Dokos <nicholas.dokos@hp.com> - 2012-02-01 12:27 -0500

csiph-web