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 brett.cannon, vstinner
Date 2012-08-22.15:41:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1345650083.26.0.403963695134.issue15766@psf.upfronthosting.co.za>
In-reply-to
Content
_imp.load_dynamic() use UTF-8 (PyUnicode_FromString) to decode the error message from dlerror(), whereas the locale encoding should be used. The path is decoded from UTF-8, whereas the filesystem encoding should be used.

As a result, error_ob and path can be NULL, whereas Py_DECREF() is used and so Python does crash (SIGSEGV).

Attached patch should avoid a crash, but I'm not sure that it is enough to support non-ASCII path: pathname is "./" is the path is not an absolute path.

PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname);
  should maybe be replaced with
pathbytes = PyBytes_FromFormat("./%s", pathname);
History
Date User Action Args
2012-08-22 15:41:23vstinnersetrecipients: + vstinner, brett.cannon
2012-08-22 15:41:23vstinnersetmessageid: <1345650083.26.0.403963695134.issue15766@psf.upfronthosting.co.za>
2012-08-22 15:41:22vstinnerlinkissue15766 messages
2012-08-22 15:41:22vstinnercreate