[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2014-01-12 Thread Senthil Kumaran
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2014-01-11 Thread Roundup Robot
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2014-01-11 Thread Senthil Kumaran
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-12-14 Thread Gökcen Eraslan
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-09 Thread Senthil Kumaran
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 ___

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-09 Thread Senthil Kumaran
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-06 Thread Senthil Kumaran
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-01 Thread Senthil Kumaran
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-10-01 Thread Guido van Rossum
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
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

[issue19097] bool(cgi.FieldStorage(...)) may be False unexpectedly

2013-09-26 Thread Guido van Rossum
Changes by Guido van Rossum gu...@python.org: -- versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19097 ___ ___