diff options
| author | Benjamin Peterson <benjamin@python.org> | 2019-08-29 05:05:57 -0700 |
|---|---|---|
| committer | Chris Dent <cdent@anticdent.org> | 2019-08-29 13:05:57 +0100 |
| commit | cdd2a9a58c59b8e599aa42b66b3c55ea47c7a4b7 (patch) | |
| tree | 447ac76f8db6b158e7217377e245443a4f911440 /paste/httpserver.py | |
| parent | 9eff34df99e9488cec65b21c95e777414c61a379 (diff) | |
| download | paste-git-cdd2a9a58c59b8e599aa42b66b3c55ea47c7a4b7.tar.gz | |
Avoid copying FieldStorage if possible. (#30)
On Python 3, cgi.FieldStorage has a __del__ method that closes the underlying file [1]. This means that if the copy made from UnicodeMultiDict._decode_value is garbage collected, the file underlying the original FieldStorage will be closed! Fix this by not copying FieldStorage if it is not required by decode_keys=False. I cannot think of a nice way to fix this problem if decode_keys=True.
[1] https://github.com/python/cpython/commit/f79126f373a9d5c9b584a8db736fe490fcbfa77a
Diffstat (limited to 'paste/httpserver.py')
0 files changed, 0 insertions, 0 deletions
