neonene <nicesal...@gmail.com> added the comment:
Basically, PR30571 aims for compatibility with 3.10 and earlier. Using Windows API is the easiest and the same way as them: import os.path paths = [ r'C:\CON', r'C:\PRN', r'C:\AUX', r'C:\NUL', r'C:\COM1', r'C:\COM2', r'C:\COM3', r'C:\COM9', r'C:\LPT1', r'C:\LPT2', r'C:\LPT3', r'C:\LPT9', r'C:\foo. . .', ] for path in paths: print(os.path.abspath(path)) """ 3.11 before C:\CON C:\PRN C:\AUX C:\NUL C:\COM1 C:\COM2 C:\COM3 C:\COM9 C:\LPT1 C:\LPT2 C:\LPT3 C:\LPT9 C:\foo. . . 3.11 after \\.\CON \\.\PRN \\.\AUX \\.\NUL \\.\COM1 \\.\COM2 \\.\COM3 \\.\COM9 \\.\LPT1 \\.\LPT2 \\.\LPT3 \\.\LPT9 C:\foo 3.10.1 \\.\CON \\.\PRN \\.\AUX \\.\NUL \\.\COM1 \\.\COM2 \\.\COM3 \\.\COM9 \\.\LPT1 \\.\LPT2 \\.\LPT3 \\.\LPT9 C:\foo """ ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46362> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com