Amaury Forgeot d'Arc added the comment:

The example script has two errors IMO:
- XOpenDisplay accepts a char*, but display_url is certainly a unicode string; 
it should be converted to a bytes string::
    xlib.XOpenDisplay(display_url.encode('utf-8'))
- XOpenDisplay.restype is not set, so it will be coerced to a C int (and 
truncated in the case of a 64bit pointer)

I strongly suggest to set .argtypes and .restype, to ensure proper type check 
and conversion.

----------

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

Reply via email to