Newbie: A very basic problem related to

Steve Holden steve at
Mon Dec 20 16:18:24 CET 2004

Peter Hansen wrote:

> 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...)
It *is* a little puzzling.

I suspect that the problem might have been due to repeated imports or 
some such. But I don't know. Only Ali can tell us how he got that 
traceback. I wondered whether it could have been an IDE, but neither 
IDLE nor PythonWin exhibit such strangeness. Very odd. Ali?

Steve Holden     
Python Web Programming
Holden Web LLC      +1 703 861 4237  +1 800 494 3119

More information about the Python-list mailing list