Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28163

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
Type:behaviorStage:resolved
Components:IO, Library (Lib), WindowsVersions:Python 3.7, Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: steve.dowerNosy List: eryksun, paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Priority:normalKeywords:

Created on2016-09-15 03:26 byeryksun, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (3)
msg276509 -(view)Author: Eryk Sun (eryksun)*(Python triager)Date: 2016-09-15 03:26
WindowsConsoleIO fileno() gets a file descriptor on demand by calling _open_osfhandle. As a low I/O function this expects _open flags, but currently the code is passing 'rb' (int 0x7262) and 'wb' (int 0x7762). It should use _O_RDONLY | _O_BINARY and _O_WRONLY | _O_BINARY. Actually, _open_osfhandle isn't actually opening the file, so it only cares about a few flags. Specifically, in lowio\osfinfo.cpp I see that it looks for _O_APPEND, _O_TEXT, and _O_NOINHERIT. So in this case passing 0 for the flags would also be ok.
msg276840 -(view)Author: Steve Dower (steve.dower)*(Python committer)Date: 2016-09-17 20:32
I'll pass the "correct" flags, since the docs don't specify that they aren't used, which means one day they might become relevant.
msg276846 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-09-17 20:51
New changesetd0bab9fda568 by Steve Dower in branch '3.6':Issue#28161: Opening CON for write access failshttps://hg.python.org/cpython/rev/d0bab9fda568New changeset187a114b9ef4 by Steve Dower in branch 'default':Issue#28161: Opening CON for write access failshttps://hg.python.org/cpython/rev/187a114b9ef4
History
DateUserActionArgs
2022-04-11 14:58:36adminsetgithub: 72350
2017-03-31 16:36:12dstufftsetpull_requests: +pull_request877
2016-09-17 20:53:13steve.dowersetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2016-09-17 20:51:45python-devsetnosy: +python-dev
messages: +msg276846
2016-09-17 20:32:05steve.dowersetassignee:steve.dower
messages: +msg276840
2016-09-15 03:26:21eryksuncreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp