Message276512
_PyIO_get_console_type currently hard codes the names "CON", "CONIN$", and "CONOUT$" and doesn't use a case-insensitive comparison. For example, opening "conin$" doesn't get directed to WindowsConsoleIO: >>> open('conin$', 'rb', buffering=0) <_io.FileIO name='conin$' mode='rb' closefd=True> unlike CONIN$: >>> open('CONIN$', 'rb', buffering=0) <_io._WindowsConsoleIO mode='rb' closefd=True> This also ignores the special handling of DOS devices in existing directories. The normal DOS-device check (i.e. if the parent directory exists, call GetFullPathName to normalize the path) isn't reliable, unfortunately. Prior to Windows 8, CreateFile special-cases parsing console paths by calling BaseIsThisAConsoleName, which has an annoying speed hack that makes it buggy. Ultimately the only way to know if a path opens the console is to open it and check the handle. | |
| Date | User | Action | Args | | 2016-09-15 03:51:03 | eryksun | set | recipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower | | 2016-09-15 03:51:03 | eryksun | set | messageid: <1473911463.84.0.00788793507165.issue28164@psf.upfronthosting.co.za> | | 2016-09-15 03:51:03 | eryksun | link | issue28164 messages | | 2016-09-15 03:51:03 | eryksun | create | | |