This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Date 2017-01-31.03:20:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I had reopened this issue with a suggestion for expanding the supported paths in msg276864, but it's languished for a while now. I've attached a patch implementing the change to _PyIO_get_console_type that I had suggested. Here are some example paths that this change enables (tested in Windows 10; need to check Windows 7):


Paths such as "C:/Temp/con" are recognized by first converting to a device path such as r"\\.\con". It's fine if the directory doesn't exist because CreateFile will fail anyway in that case.

This patch also fixes an error in handling the return value of _get_osfhandle when it fails. 

It also adds a couple checks to __init__ to provide a better error message when io._WindowsConsoleIO is called directly for some reason instead of via open(). If the console type can't be determined it should error out immediately instead of printing an unrelated error about not being able to open the input/output buffer.
Date User Action Args
2017-01-31 03:20:06eryksunsetrecipients: + eryksun, paul.moore, tim.golden, python-dev, zach.ware, steve.dower
2017-01-31 03:20:06eryksunsetmessageid: <>
2017-01-31 03:20:06eryksunlinkissue28164 messages
2017-01-31 03:20:05eryksuncreate