This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients flox, georg.brandl, loewis, mark.dickinson, pepalogik, vstinner
Date 2013-02-05.22:01:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360101700.28.0.742398914749.issue17137@psf.upfronthosting.co.za>
In-reply-to
Content
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")))
History
Date User Action Args
2013-02-05 22:01:40vstinnersetrecipients: + vstinner, loewis, georg.brandl, mark.dickinson, flox, pepalogik
2013-02-05 22:01:40vstinnersetmessageid: <1360101700.28.0.742398914749.issue17137@psf.upfronthosting.co.za>
2013-02-05 22:01:40vstinnerlinkissue17137 messages
2013-02-05 22:01:40vstinnercreate