Eryk Sun added the comment:

po_message_create() returns a po_message_t pointer:

    /* A po_message_t represents a message in a PO file.  */
    typedef struct po_message *po_message_t;

    /* Return a freshly constructed message.
       To finish initializing the message, you must set the msgid 
       and msgstr.  */
    extern po_message_t po_message_create (void);

You're casting a pointer as a 32-bit C int, which isn't reliable in 64-bit 
Python. The value 0x55c7cf00 (1439158016) may be truncated. Try it using a 
po_message_t pointer type. For example:

    gpo = ctypes.CDLL(lib_location)

    class po_message_t(ctypes._Pointer):
        """A po_message_t represents a message in a PO file."""
        class po_message(ctypes.Structure):
            pass
        _type_ = po_message

    gpo.po_message_create.restype = po_message_t

----------
nosy: +eryksun

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

Reply via email to