Skip to content

SystemError in io.BufferedWriter #140650

@YuanchengJiang

Description

@YuanchengJiang

Bug report

Bug description:

import io

class MockRawIO:
    def __init__(self):
        self.closed = NotImplemented
    def write(self, b):
        return len(data)
    def writable(self):
        return True

tp = io.BufferedWriter
writer = MockRawIO()
bufio = tp(writer, 8)
bufio.close()
SystemError: <method 'close' of '_io.BufferedWriter' objects> returned a result with an exception set

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-IOtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions