Message151087
| Author |
pitrou |
| Recipients |
amaury.forgeotdarc, brian.curtin, pitrou, tim.golden |
| Date |
2012年01月11日.20:01:13 |
| SpamBayes Score |
0.00016507646 |
| Marked as misclassified |
No |
| Message-id |
<1326312074.88.0.322514160628.issue13772@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Note how _getfinalpathname works and calling listdir on the final path name also works:
>>> os.symlink(".\\test", "Lib\\bar")
>>> os.listdir("Lib\\bar")[:4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotADirectoryError: [Error 267] The directory name is invalid: 'Lib\\bar\\*.*'
>>> nt._getfinalpathname("Lib\\bar")
'\\\\?\\C:\\t\\pathlib\\Lib\\test'
>>> os.listdir(nt._getfinalpathname("Lib\\bar"))[:4]
['185test.db', 'audiotest.au', 'autotest.py', 'badcert.pem']
Calling listdir on the non-final extended path doesn't work:
>>> os.listdir('\\\\?\\C:\\t\\pathlib\\Lib\\bar')[:4]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotADirectoryError: [Error 267] The directory name is invalid: '\\\\?\\C:\\t\\pa
thlib\\Lib\\bar\\*.*'
But open() works:
>>> open('Lib\\bar\\regrtest.py')
<_io.TextIOWrapper name='Lib\\bar\\regrtest.py' mode='r' encoding='cp1252'> |
|