Message198457
| Author |
gvanrossum |
| Recipients |
gvanrossum |
| Date |
2013年09月26日.23:54:42 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1380239682.41.0.674159694258.issue19097@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 decided to use read_single() instead of one of the other ways of reading the field value (read_urlencoded() or read_multi()). Then self.list remains None, and __nonzero__ returns False no matter what the contents of self.file is.
To make things worse -- or better? -- the Python 3 version still defines __nonzero__() instead of __bool__(). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年09月26日 23:54:42 | gvanrossum | set | recipients:
+ gvanrossum |
| 2013年09月26日 23:54:42 | gvanrossum | set | messageid: <1380239682.41.0.674159694258.issue19097@psf.upfronthosting.co.za> |
| 2013年09月26日 23:54:42 | gvanrossum | link | issue19097 messages |
| 2013年09月26日 23:54:42 | gvanrossum | create |
|