Newbie: A very basic problem related to

Peter Hansen peter at
Mon Dec 20 16:02:27 CET 2004

Steve Holden wrote:
> Traceback (most recent call last):
>   File "", line 2, in ?
>     import cgi
>   File "/c/steve/", line 12, in ?
>     main()
>   File "/c/steve/", line 6, in main
>     form = cgi.FieldStorage()
> AttributeError: 'module' object has no attribute 'FieldStorage'
> Ha! There's a naming confusion between the imported cgi module and your 
> main program. Rename it to something else and all should be well (or at 
> least better ;-)

I suspected that too, Steve, but why would it be showing
the library in the traceback if he had a local
one with the same name?  Weird.  (Unless, as I wondered
in my redundant reply, the traceback he posted wasn't
the real traceback...)


More information about the Python-list mailing list