python 3.x - PyGObject GTK+ GLib.Date strftime() -
a method call in poppler returns gdate
object in python code. cannot find way how nicely print object.
following python gi api reference, came following:
gdate_object = annot_mapping.annot.get_date() destination_buffer = '.' * 50 print('output:', glib.date.strftime(destination_buffer, 50, '%c', gdate_object)) print('buffer:', annot_time)
however, places nothing in buffer, while does output written buffer size.
how access destination buffer?
looks nobody documented api broken introspection bindings.
i made simple patch seems pygobject doesn't allocating string buffers, talk upstream it.
diff --git a/glib/gdate.c b/glib/gdate.c index bea2448..bacdb93 100644 --- a/glib/gdate.c +++ b/glib/gdate.c @@ -2418,8 +2418,8 @@ win32_strftime_helper (const gdate *d, /** * g_date_strftime: - * @s: destination buffer - * @slen: buffer size + * @s: (out caller-allocates) (array length=slen): destination buffer + * @slen: (in): buffer size * @format: format string * @date: valid #gdate *
Comments
Post a Comment