Index: translate/storage/cpo.py =================================================================== --- translate/storage/cpo.py (revision 8228) +++ translate/storage/cpo.py (working copy) @@ -120,7 +120,7 @@ gpo.po_filepos_file.restype = STRING gpo.po_message_filepos.restype = c_int gpo.po_message_filepos.argtypes = [c_int, c_int] -gpo.po_message_add_filepos.argtypes = [c_int, STRING, c_int] +gpo.po_message_add_filepos.argtypes = [c_int, STRING, c_size_t] # Message (get methods) gpo.po_message_comments.restype = STRING @@ -502,7 +502,9 @@ if len(parts) == 2: line = int(parts[1]) else: - line = -1 + # libgettextpo requires a (size_t)(-1) if no file + # location is available + line = c_size_t(-1) gpo.po_message_add_filepos(self._gpo_message, file, line) def getcontext(self):