Message168773
| Author |
amaury.forgeotdarc |
| Recipients |
albertomilone, amaury.forgeotdarc, belopolsky, meador.inge, pitrou |
| Date |
2012年08月21日.14:16:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1345558599.59.0.822374489851.issue15637@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|