[issue31382] CGI upload error when file ~< 10kb

Marc report at bugs.python.org
Thu Sep 7 08:31:49 EDT 2017


New submission from Marc:

An error occurs when uploading a file ~<10kb:
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 /var/www/html/file-uploader/uploader.py in ()
     39 
     40 # A nested FieldStorage instance holds the file
=>   41 fileitem = form['file']
     42 
     43 # Test if the file was uploaded
fileitem undefined, form = FieldStorage(None, None, '')
 /usr/lib/python3.4/cgi.py in __getitem__(self=FieldStorage(None, None, ''), key='file')
    591         """Dictionary style indexing."""
    592         if self.list is None:
=>  593             raise TypeError("not indexable")
    594         found = []
    595         for item in self.list:
builtin TypeError = <class 'TypeError'>

TypeError: not indexable
      args = ('not indexable',)
      with_traceback = <built-in method with_traceback of TypeError object> 

but not when file is ~> 10kb

----------
components: Extension Modules
messages: 301582
nosy: mschaming
priority: normal
severity: normal
status: open
title: CGI upload error when file ~< 10kb
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31382>
_______________________________________


More information about the Python-bugs-list mailing list