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

Python version of TextIOWrapper ignores "write_through" arg #59776

Closed
ncoghlan opened this issue Aug 7, 2012 · 6 comments
Closed

Python version of TextIOWrapper ignores "write_through" arg #59776

ncoghlan opened this issue Aug 7, 2012 · 6 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ncoghlan
Copy link
Contributor

ncoghlan commented Aug 7, 2012

BPO 15571
Nosy @ncoghlan, @asvetlov, @cjerdonek
Files
  • issue-15571-1.patch
  • 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 2012-08-13.13:12:25.291>
    created_at = <Date 2012-08-07.05:27:36.923>
    labels = ['type-feature', 'library']
    title = 'Python version of TextIOWrapper ignores "write_through" arg'
    updated_at = <Date 2012-08-13.13:12:25.289>
    user = 'https://github.com/ncoghlan'

    bugs.python.org fields:

    activity = <Date 2012-08-13.13:12:25.289>
    actor = 'asvetlov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-08-13.13:12:25.291>
    closer = 'asvetlov'
    components = ['Library (Lib)']
    creation = <Date 2012-08-07.05:27:36.923>
    creator = 'ncoghlan'
    dependencies = []
    files = ['26716']
    hgrepos = []
    issue_num = 15571
    keywords = ['patch']
    message_count = 6.0
    messages = ['167603', '167606', '167607', '167608', '168102', '168104']
    nosy_count = 4.0
    nosy_names = ['ncoghlan', 'asvetlov', 'chris.jerdonek', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue15571'
    versions = ['Python 3.3']

    @ncoghlan
    Copy link
    Contributor Author

    ncoghlan commented Aug 7, 2012

    In discussing bpo-15216, I noticed that the write_through parameter is completely unused in the Python implementation of TextIOWrapper.

    That also means we have a hole in the test coverage: there is no test that is run on both the C and Python versions to ensure that the data is being written directly through to the underlying buffer (e.g. by passing in a mock buffer object).

    @ncoghlan ncoghlan added release-blocker type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Aug 7, 2012
    @cjerdonek
    Copy link
    Member

    The fact that the Python implementation doesn't look at write_through doesn't necessarily mean that it's not respected. It could always write through. Indeed, it looks like this is the case and was discussed at one point:

    http://bugs.python.org/issue12591#msg141006

    Also, it appears that there is a test in both cases (the test class is subclassed twice), though I could be wrong:

    http://hg.python.org/cpython/file/0eeffeadaa1e/Lib/test/test_io.py#l2453

    In any case, this could probably at least use a code comment.

    @ncoghlan
    Copy link
    Contributor Author

    ncoghlan commented Aug 7, 2012

    Ah, thanks. Yes, that could definitely use a comment :)

    @ncoghlan ncoghlan added type-feature A feature request or enhancement and removed release-blocker type-bug An unexpected behavior, bug, or error labels Aug 7, 2012
    @cjerdonek
    Copy link
    Member

    Attaching patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 13, 2012

    New changeset ba055ccd99ef by Andrew Svetlov in branch 'default':
    Issue bpo-15571: comment the fact what python impl of TextIOWrapper always works in write_throuth mode
    http://hg.python.org/cpython/rev/ba055ccd99ef

    @asvetlov
    Copy link
    Contributor

    Patch applied

    @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