AttributeError: 'module' object has no attribute 'letters'

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Feb 11 17:45:01 EST 2008


black_13 <jjosburn at gmail.com> writes:

> what does this error mean?
> [...]
>     valid_identifier_chars = string.letters + string.digits + "_"
> AttributeError: 'module' object has no attribute 'letters'

It means that you're trying to access the attribute 'letters' on a
module that doesn't have that attribute.

You need to find what the value of 'string' is at that point in the
code. If I had to guess, I would say the person who wrote the above
line was expecting 'string' to be bound to the Python standard library
module 'string'; but that the code you have binds that name to some
other module.

-- 
 \          "War is God's way of teaching geography to Americans."  -- |
  `\                                                   Ambrose Bierce  |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list