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

_overlapped: read_buffer and write_buffer are misused #64648

Closed
vstinner opened this issue Jan 30, 2014 · 2 comments
Closed

_overlapped: read_buffer and write_buffer are misused #64648

vstinner opened this issue Jan 30, 2014 · 2 comments

Comments

@vstinner
Copy link
Member

BPO 20449
Nosy @gvanrossum, @pitrou, @vstinner, @larryhastings
Files
  • overlapped.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 2014-01-30.20:45:43.593>
    created_at = <Date 2014-01-30.15:22:29.593>
    labels = ['release-blocker']
    title = '_overlapped: read_buffer and write_buffer are misused'
    updated_at = <Date 2014-01-30.20:45:43.592>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2014-01-30.20:45:43.592>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-01-30.20:45:43.593>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-01-30.15:22:29.593>
    creator = 'vstinner'
    dependencies = []
    files = ['33812']
    hgrepos = []
    issue_num = 20449
    keywords = ['patch']
    message_count = 2.0
    messages = ['209721', '209737']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'pitrou', 'vstinner', 'larry', 'sbt']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20449'
    versions = ['Python 3.4']

    @vstinner
    Copy link
    Member Author

    I found an issue in overlapped.c: read_buffer and write_buffer attributes are defined in an union, but they are sometimes use even if the type is not good. I found this issue while trying to get a BrokenPipeError on Windows when the stdin stream of a subprocess is full but the process exited.

    Could you please review attached patch, especially the change in Overlapped_getresult?

    Another option would be to use two real attributes (remove the union), but I like the usage of union :-)

    All Tulip unit tests of my subprocess_stream pass on Linux and Windows with the patch.

    @vstinner
    Copy link
    Member Author

    Patch commited as 73dbb884eb09 in Python 3.4. (No need to backport, it's a new module in Python 3.4).

    Thanks for the review Richard.

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant