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


Groups > comp.lang.python > #19725 > unrolled thread

Re: TypeError

Started byNick Dokos <nicholas.dokos@hp.com>
First post2012-02-01 12:27 -0500
Last post2012-02-01 12:27 -0500
Articles 1 — 1 participant

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.


Contents

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

#19725 — Re: TypeError

FromNick Dokos <nicholas.dokos@hp.com>
Date2012-02-01 12:27 -0500
SubjectRe: TypeError
Message-ID<mailman.5309.1328117762.27778.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web