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

Opening CON for write access fails #72348

Closed
eryksun opened this issue Sep 15, 2016 · 2 comments
Closed

Opening CON for write access fails #72348

eryksun opened this issue Sep 15, 2016 · 2 comments
Labels
3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error

Comments

@eryksun
Copy link
Contributor

eryksun commented Sep 15, 2016

BPO 28161
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • 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 2016-09-17.20:52:19.218>
    created_at = <Date 2016-09-15.03:24:24.824>
    labels = ['3.7', 'type-bug', 'library', 'expert-IO', 'OS-windows']
    title = 'Opening CON for write access fails'
    updated_at = <Date 2017-03-31.16:36:19.951>
    user = 'https://github.com/eryksun'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:19.951>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-17.20:52:19.218>
    closer = 'steve.dower'
    components = ['Library (Lib)', 'Windows', 'IO']
    creation = <Date 2016-09-15.03:24:24.824>
    creator = 'eryksun'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 28161
    keywords = []
    message_count = 2.0
    messages = ['276507', '276847']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'tim.golden', 'python-dev', 'zach.ware', 'eryksun', 'steve.dower']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28161'
    versions = ['Python 3.6', 'Python 3.7']

    @eryksun
    Copy link
    Contributor Author

    eryksun commented Sep 15, 2016

    When opening the CON device the underlying CreateFile call needs to use either GENERIC_READ or GENERIC_WRITE access, but not both. Currently opening for writing fails as follows:

       >>> open('CON', 'wb', buffering=0)
       Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
       OSError: [WinError 87] The parameter is incorrect: 'CON'

    If self->writable is true, it should set access = GENERIC_WRITE, not access |= GENERIC_WRITE.

    This only applies to CON. It's normal to open CONIN$ and CONOUT$ with both read and write access, and WindowsConsoleIO handles that correctly.

    @eryksun eryksun added 3.7 (EOL) end of life stdlib Python modules in the Lib dir OS-windows topic-IO type-bug An unexpected behavior, bug, or error labels Sep 15, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 17, 2016

    New changeset d0bab9fda568 by Steve Dower in branch '3.6':
    Issue bpo-28161: Opening CON for write access fails
    https://hg.python.org/cpython/rev/d0bab9fda568

    New changeset 187a114b9ef4 by Steve Dower in branch 'default':
    Issue bpo-28161: Opening CON for write access fails
    https://hg.python.org/cpython/rev/187a114b9ef4

    @zooba zooba closed this as completed Sep 17, 2016
    @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
    3.7 (EOL) end of life OS-windows stdlib Python modules in the Lib dir topic-IO type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants