New submission from STINNER Victor <victor.stin...@haypocalc.com>:

The PEP 383 introduces filename using surrogates. ctypes.dlopen() support them. 
ctypes.cdll.LoadLibrary('libc\uDCff.so.6') fails with:

   UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' 
   in position 4: surrogates not allowed

Attached patch fixes this issue.

TODO: Remove the assert(PyBytes_Check(name2)). I don't know if 
PyUnicode_FSConverter() does always return a PyBytes object or not.

----------
components: Library (Lib), Unicode
files: ctypes_dlopen_surrogates.patch
keywords: patch
messages: 103108
nosy: haypo
severity: normal
status: open
title: ctypes.dlopen() doesn't support surrogates
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16921/ctypes_dlopen_surrogates.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8394>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to