[gmime-devel] GMime GObject introspection in python



Hi GMime folks--

I'm trying to use GMime via GObject introspection in python.

here's what should be a simple example (it assumes that "example.eml"
holds an rfc822 message):

----------
#/usr/bin/env python3
import gi
gi.require_version('GMime', '2.6')
From gi.repository import GMime

f = GMime.StreamFile.new_for_path('example.eml', 'r')
parser = GMime.Parser.new_with_stream(f)
msg = parser.construct_message()
----------

however, when i run it, the last line segfaults:

0 dkg@alice:~$ python3 ./example.py
./example.py:14: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
  msg = parser.construct_message()

(process:32252): gmime-CRITICAL **: g_mime_object_append_header: assertion 'GMIME_IS_OBJECT (object)' failed
Segmentation fault
139 dkg@alice:~$

Am i doing something wrong here?  Are the GObject bindings somehow
broken?

        --dkg

Attachment: signature.asc
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]