Using TurboGears with the upload bar example from: http://docs.turbogears.org/1.0/FileUploadProgressBar. I realize that when I post some information that raises an error (for example an invalid form value entered), the application crashes. I lost the trace exception but it was something like:
(... )
File "/usr/lib/python2.5/site-packages/turbogears/controllers.py,
line 509, in url
args.append("%s=%s" % (key, urllib.quote(str(value))))
File "/usr/lib/python2.5/cgi.py", line 541, in __repr__
self.name, self.filename, self.value)
File "/usr/lib/python2.5/cgi.py", line 551, in __getattr__
value = self.file.read()
TypeError: read() takes exactly 2 arguments (1 given)
Looking at controllers.py, lines 539ff looks like:
for key, value in tgparams.iteritems():
- if value is None:
continue
if isinstance(value, unicode):
value = value.encode("utf8")
I think we don't want to include file info, so i changed to:
for key, value in tgparams.iteritems():
+ if value is None or isinstance(value, cgi.FieldStorage):
continue
if isinstance(value, unicode):
value = value.encode("ut
And it's working now. I can attach the patch if it is approved.