TypeError: cannot concatenate 'str' and 'NoneType' objects

Fredrik Lundh fredrik at pythonware.com
Wed Dec 20 14:22:21 EST 2006


thompson.marisa at gmail.com wrote:

> I'm extremely new to Python and programming as a whole.  I have written
> a python script with the assistance of ESRI ArcGIS 9.2, which uses
> Python 2.4.1, however, it gives me this error when I try to run it.
> I've already posted at ESRI support, and I was hoping that Python
> people could help me more.
> 
> I hope there is something simple I could do to be able to define the
> object that it thinks is NoneType.

that would be the None object.

   http://effbot.org/pyref/None

which is often used as a placeholder in Python.

my guess is that it's the next() call that returns None when you've 
reached the end of the shapefile list; try changing

     while Townshps !="":

to

     while Townshps is not None:

and see if the problem goes away.

if you still get an exception, please post the full traceback; see

http://effbot.org/pyfaq/tutor-i-need-help-im-getting-an-error-in-my-program-what-should-i-do

for details.

</F>




More information about the Python-list mailing list