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

file.__exit__ does not call subclass' close method #46343

Closed
abalkin opened this issue Feb 11, 2008 · 4 comments
Closed

file.__exit__ does not call subclass' close method #46343

abalkin opened this issue Feb 11, 2008 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@abalkin
Copy link
Member

abalkin commented Feb 11, 2008

BPO 2067
Nosy @birkenfeld, @abalkin
Files
  • file_exit.diff: Patch against revision 60728
  • 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 2008-02-23.15:11:24.968>
    created_at = <Date 2008-02-11.15:11:54.340>
    labels = ['interpreter-core', 'type-bug']
    title = "file.__exit__ does not call subclass' close method"
    updated_at = <Date 2008-02-23.15:16:13.800>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2008-02-23.15:16:13.800>
    actor = 'schmir'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-02-23.15:11:24.968>
    closer = 'georg.brandl'
    components = ['Interpreter Core']
    creation = <Date 2008-02-11.15:11:54.340>
    creator = 'belopolsky'
    dependencies = []
    files = ['9410']
    hgrepos = []
    issue_num = 2067
    keywords = []
    message_count = 4.0
    messages = ['62289', '62442', '62740', '62744']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'belopolsky', 'schmir']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2067'
    versions = ['Python 2.6', 'Python 2.5']

    @abalkin
    Copy link
    Member Author

    abalkin commented Feb 11, 2008

    Attached patch makes file.__exit__ call subclass' close method.

    @abalkin abalkin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Feb 11, 2008
    @schmir
    Copy link
    Mannequin

    schmir mannequin commented Feb 15, 2008

    The patch looks good, I've tested it on trunk and also release25-maint.
    It applies with fuzz and one has to add a "from __future import
    with_statement".
    I think this should also be applied to release25-maint. IMHO, this is a
    rather severe problem, as it can easily lead to data loss.

    @birkenfeld
    Copy link
    Member

    Committed r60984.

    @schmir
    Copy link
    Mannequin

    schmir mannequin commented Feb 23, 2008

    Isn't this a candidate for backporting to 2.5?

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants