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 eryksun
Recipients doko, eryksun
Date 2016-11-07.17:43:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478540594.27.0.291428991779.issue28631@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-11-07 17:43:14eryksunsetrecipients: + eryksun, doko
2016-11-07 17:43:14eryksunsetmessageid: <1478540594.27.0.291428991779.issue28631@psf.upfronthosting.co.za>
2016-11-07 17:43:14eryksunlinkissue28631 messages
2016-11-07 17:43:14eryksuncreate