Le Tuesday 23 October 2007 19:31:30 Ian Bicking, vous avez écrit :
> Alain Poirier wrote:
> > Hi,
> >
> > I've got a problem with `MultiDict.from_fieldstorage()` : it always
> > returns a list of FieldStorage objects to me, as if all the fields were
> > an uploaded file.
> >
> > Indeed, I see that all the FieldStorage objets always have a `file`
> > attribute !?! And so, if I replace the line #65 `if field.file` by `if
> > field.filename` the problem is solved.
> >
> > What I'am doing wrong ?
>
> Is this in WebOb or Paste?  Sounds like a bit of a nasty bug then...

WebOb (for Paste, I see that `paste.request.parse_formvars()` is testing on 
the `filename` attribut). Tested with Python 2.1, 2.4 and 2.5. Form submitted 
in 'multipart/form-data'.

Hmm, reading `cgi.py`, in see that all the parts of the form are read with 
`read_single()` which always sets a `file` attribut via `read_binary()` 
or `read_lines()`.

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to