This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年04月14日 16:48 by deadpixi, last changed 2022年04月11日 14:58 by admin.
| Messages (1) | |||
|---|---|---|---|
| msg240942 - (view) | Author: Rob King (deadpixi) | Date: 2015年04月14日 16:48 | |
Hello, everyone. I've noticed an issue that could be just a documentation inaccuracy or a genuine, minor bug in cgi.FieldStorage. The documentation for the module states: "You can test for an uploaded file by testing either the filename attribute or the file attribute." However, I've noticed that on a form submission that includes both a file field and a normal form field, *all* of the members of the form have a non-None "file" attribute, while only the actual uploaded file has a non-None "filename" attribute. This would appear to be caused by the cgi module's use of MiniFieldStorage for in some situations, and FieldStorage in others. The FieldStorage class (if I'm reading the code correctly) would appear to always have a non-None "file" attribute but may have a None "filename" attribute. This makes the documentation for the module unclear, as testing for a non-None "file" attribute will always return True in cases of FieldStorage, even if the particular field is not actually a file. I would suggest modifying the documentation to say something like: "You can test for an uploaded file by testing the filename attribute." Please let me know if I'm missing something, that's always also a possibility. :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:15 | admin | set | github: 68138 |
| 2021年11月27日 14:41:00 | iritkatriel | set | nosy:
+ ethan.furman |
| 2015年04月14日 16:48:15 | deadpixi | create | |