Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'module' object has no attribute 'FieldStorage'

Tags:

python

cgi

It doesn't make sense to me, because the code is very simple and "FieldStorage" exist in documentation.

#!/usr/bin/env python
print 'Content-type: text/html'
print
import cgi

def Main():
    form = cgi.FieldStorage()
    print '<html>'
    print '<body>'
    print 'ola'
    print '</body>'
    print '</html>'

if __name__ == '__main__':
    Main()
like image 211
Frias Avatar asked Nov 10 '10 11:11

Frias


1 Answers

Do you have a local file called cgi.py by any chance? That's being imported, instead of the standard library module.

like image 95
Daniel Roseman Avatar answered Sep 23 '22 13:09

Daniel Roseman