Senthil Kumaran added the comment:
Fixed in:
New changeset a3e49868cfd0 by Senthil Kumaran in branch '3.3':
Issue #19092 - Raise a correct exception when cgi.FieldStorage is given an
http://hg.python.org/cpython/rev/a3e49868cfd0
New changeset 1638360eea41 by Senthil Kumaran in branch
Roundup Robot added the comment:
New changeset 2d6e7a5659f0 by Senthil Kumaran in branch '2.7':
Adding test coverage for cgi.FieldStorage based on the scenario mentioned in
issue #19097
http://hg.python.org/cpython/rev/2d6e7a5659f0
--
nosy: +python-dev
Senthil Kumaran added the comment:
This is fixed in all active branches (2.7,3,3 and 3.4). I have addressed all
review comments. Thanks.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Gökcen Eraslan gokcen.eras...@gmail.com:
--
nosy: +gkcn
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19097
___
___
Python-bugs-list
Changes by Senthil Kumaran sent...@uthcode.com:
--
versions: +Python 3.3, Python 3.4 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19097
___
Senthil Kumaran added the comment:
Addressing storchaka's review comments. Here is the updated patch.
--
Added file: http://bugs.python.org/file32021/19092-v2.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19097
Senthil Kumaran added the comment:
Hi Guido,
Agree with both your points.
Attaching a patch that fixes this issue.
1. Raises TypeError exception when header is not a Mapping or
email.message.Message type.
2. Asserts for fp.read and fp.readline() to assert that fp, the first argument
to
Senthil Kumaran added the comment:
FieldStorage(foo, bar) is invalid because the first argument is supposed to
be file-like object and second one headers. Here we are sending invalid
headers. By
default, if the headers is none, the content-type is urlencoded.
The right way of using
Guido van Rossum added the comment:
I believe you that the example invocation is wrong. But then shouldn't it raise
an exception? I still think that if len() raises KeyError, bool() should raise
KeyError too.
--
___
Python tracker
New submission from Guido van Rossum:
Check out
http://stackoverflow.com/questions/9327597/python-get-does-not-evaluate-to-true-even-though-there-is-an-object
It turns out a cgi.FieldStorage object may consider itself False even when it
has data. This happens when the initialization
Guido van Rossum added the comment:
PS. Simple repro:
import cgi; bool(cgi.FieldStorage('logo', u'tux.png'))
This reveals it's been fixed in Python 3 -- it raises TypeError there as it
should. (But __nonzero__ should be deleted, and if someone adds __bool__ they
should make sure it raises
Changes by Guido van Rossum gu...@python.org:
--
versions: +Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19097
___
___
12 matches
Mail list logo