Message286507
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):
\\.\conin$
\\.\conout$
\\.\con
//?/con
C:/Temp/con
C:/Temp/conout$
C:/Temp/conin$
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:06 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, python-dev, zach.ware, steve.dower |
2017-01-31 03:20:06 | eryksun | set | messageid: <1485832806.7.0.480980268396.issue28164@psf.upfronthosting.co.za> |
2017-01-31 03:20:06 | eryksun | link | issue28164 messages |
2017-01-31 03:20:05 | eryksun | create | |
|