-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a combination of three fixes. The tests had to be adjusted, as the cgi module in Python 3 won't work without a content-length header anymore. This is a side-effect of python/cpython@5c23b8e. Without the content length, the limit / read_bytes calculation is off, and we end up with three fieldstorage instances each with an empty byte, rather than one instance with a content of `test\n`. The second part is a heavy handed workaround for closing the BytesIO instance underlying the FieldStorage too early. In Python 2.7, there wasn't a `__del__` defined yet. There's a good chance, a proper fix could also be related to http://bugs.python.org/issue23700 and http://bugs.python.org/issue18879, but I couldn't work out if something similar was indeed the issue here. Finally the TemporaryFileWrapper no longer needs special closing/del logic under Python 3, as the implementation changed. There is no `close_called` attribute anymore, but rather a more complex `_closer` indirection.
- Loading branch information
Showing
2 changed files
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters