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

Make cgi.FieldStorage a context manager #64488

Closed
brettcannon opened this issue Jan 17, 2014 · 10 comments
Closed

Make cgi.FieldStorage a context manager #64488

brettcannon opened this issue Jan 17, 2014 · 10 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 20289
Nosy @brettcannon, @berkerpeksag, @serhiy-storchaka
Files
  • issue20289.diff
  • issue20289_v2.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-02-06.08:22:03.451>
    created_at = <Date 2014-01-17.14:47:25.329>
    labels = ['type-feature', 'library']
    title = 'Make cgi.FieldStorage a context manager'
    updated_at = <Date 2015-10-11.14:55:15.776>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2015-10-11.14:55:15.776>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-02-06.08:22:03.451>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2014-01-17.14:47:25.329>
    creator = 'brett.cannon'
    dependencies = []
    files = ['33572', '38017']
    hgrepos = []
    issue_num = 20289
    keywords = ['patch']
    message_count = 10.0
    messages = ['208338', '208579', '230737', '235405', '235418', '235437', '235470', '235471', '239147', '252808']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'python-dev', 'berker.peksag', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue20289'
    versions = ['Python 3.5']

    @brettcannon
    Copy link
    Member Author

    It has a file attribute which contains a file, so making it so it can be closed faster than cgi.FieldStorage.__del__ would be good.

    @brettcannon brettcannon added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Jan 17, 2014
    @berkerpeksag
    Copy link
    Member

    Here's a patch with a test and documentation update.

    @serhiy-storchaka
    Copy link
    Member

    Added comments on Rietveld.

    @serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Nov 6, 2014
    @serhiy-storchaka
    Copy link
    Member

    Ping.

    @berkerpeksag
    Copy link
    Member

    Here's an updated patch. Thank you Serhiy.

    @serhiy-storchaka
    Copy link
    Member

    LGTM.

    @berkerpeksag
    Copy link
    Member

    Thanks for the review, Serhiy!

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 6, 2015

    New changeset 367f5e98ffbb by Berker Peksag in branch 'default':
    Issue bpo-20289: cgi.FieldStorage() now supports the context management protocol.
    https://hg.python.org/cpython/rev/367f5e98ffbb

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 24, 2015

    New changeset 34930a6faf0d by Serhiy Storchaka in branch 'default':
    Issue bpo-20289: The copy module now uses pickle protocol 4 (PEP-3154) and
    https://hg.python.org/cpython/rev/34930a6faf0d

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 11, 2015

    New changeset 80501740ab84 by Serhiy Storchaka in branch '3.5':
    No longer skip tests for classes with __getnewargs_ex__. The copy module
    https://hg.python.org/cpython/rev/80501740ab84

    New changeset 6f4dd9bc1f20 by Serhiy Storchaka in branch 'default':
    No longer skip tests for classes with __getnewargs_ex__. The copy module
    https://hg.python.org/cpython/rev/6f4dd9bc1f20

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants