Message181488
On Windows, os.path.isdir calls nt._isdir(). Core of this C function:
wchar_t *wpath = PyUnicode_AsUnicode(po);
if (wpath == NULL)
return NULL;
attributes = GetFileAttributesW(wpath);
if (attributes == INVALID_FILE_ATTRIBUTES)
Py_RETURN_FALSE;
...
Can you please try to call directly nt._isdir()? Can also also compare with stat.S_ISDIR(os.stat(fn).st_mode)?
If the problem is something with the implementation of Unicode, it would be interesting to try to get the content of the string using:
* print(ascii(path.encode("unicode_internal"))) # should be result of PyUnicode_AsUnicode() which is cached
* print(ascii(path.encode("utf-8"))) |
|
Date |
User |
Action |
Args |
2013-02-05 22:01:40 | vstinner | set | recipients:
+ vstinner, loewis, georg.brandl, mark.dickinson, flox, pepalogik |
2013-02-05 22:01:40 | vstinner | set | messageid: <1360101700.28.0.742398914749.issue17137@psf.upfronthosting.co.za> |
2013-02-05 22:01:40 | vstinner | link | issue17137 messages |
2013-02-05 22:01:40 | vstinner | create | |
|