Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid copying FieldStorage if possible. #30

Merged
merged 1 commit into from
Aug 29, 2019

Commits on Aug 28, 2019

  1. Avoid copying FieldStorage if possible.

    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] python/cpython@f79126f
    benjaminp committed Aug 28, 2019
    Configuration menu
    Copy the full SHA
    b1f9227 View commit details
    Browse the repository at this point in the history