<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px">Bug filed: <a href="https://bugzilla.gnome.org/show_bug.cgi?id=786948" class="enhancr2_19ce4d1b-983b-4f92-ff7f-fa00e0ce6fdd" id="yui_3_16_0_ym19_1_1503996195541_26696">Bug 786948 – GstMessageType above GST_MESSAGE_EXTENDED not usable with python3 on windows</a><div><br></div><div><br></div><div id="enhancr2_19ce4d1b-983b-4f92-ff7f-fa00e0ce6fdd" class="yahoo-link-enhancr-card yahoo-link-enhancr-not-allow-cover ymail-preserve-class ymail-preserve-style" style="max-width:400px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;" data-url="https://bugzilla.gnome.org/show_bug.cgi?id=786948" data-type="yenhancr" data-category="article" data-embed-url="" data-size="medium" dir="ltr" contenteditable="false"> <a href="https://bugzilla.gnome.org/show_bug.cgi?id=786948" style="text-decoration:none !important; color: #000 !important" class="yahoo-enhancr-cardlink" target="_blank" rel="noreferrer"> <table class="card-wrapper" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td width="400"> <table class="card-info" style="background:#fff;max-width:400px;border:1px solid #e0e4e9;border-bottom:3px solid #000000;" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td style="vertical-align:top;padding:16px 0 16px 12px;">  </td> <td style="vertical-align:middle;padding:16px 12px;width:99%;"> <h2 class="card-title" style="margin:0 0 4px 0;font-size:16px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;word-break:break-word;">Bug 786948 – GstMessageType above GST_MESSAGE_EXTENDED not usable with python3 on windows</h2>  <div class="card-description" style="font-size:11px;line-height:15px;color:#999;word-break:break-word;"></div> </td> <td class="card-share-container"></td> </tr> </tbody></table> </td> </tr> </tbody></table> </a></div><div><br></div><br><div><span></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Lundi 28 août 2017 14h45, philippe renon <philippe_renon@yahoo.fr> a écrit :<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv1342403481"><div><div style="color:#000;background-color:#fff;font-family:lucida console, sans-serif;font-size:13px;"><div id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17708"><span>Hi,</span></div><div id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17770"><span><br clear="none"></span></div><div id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17771"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">Will file a bug when it is possible. I currently get a 500 when hitting the "Submit Bug" button.</span></div><div id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17848"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825"><br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17849"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">In the meantime, I have been researching the code.</span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_19668"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825"><br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_19711"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">The OverflowError emanates from PyLong_AsLong(PyObject *obj) method (https://github.com/python/cpython/blob/3.6/Objects/longobject.c#L471)</span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21625"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825"><br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21682"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">But I am having a hard time finding the call path that leads to this method being called...<br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21882"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825"><br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21877"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">I should be able to build all components involved (gstreamer, gst-python, gobject-instrospection, pyobject) from source so I can try things out given some pointers or guidance.</span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21878"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825"><br clear="none"></span></div><div dir="ltr" id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_21879"><span id="yiv1342403481yui_3_16_0_ym19_1_1503910461861_17825">Philippe.</span></div> <div class="yiv1342403481qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv1342403481yahoo_quoted" style="display:block;"> <div style="font-family:lucida console, sans-serif;font-size:13px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Lundi 28 août 2017 11h34, Sebastian Dröge <sebastian@centricular.com> a écrit :<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv1342403481y_msg_container"><div class="yiv1342403481yqt2217156726" id="yiv1342403481yqt10021"><div dir="ltr">On Sat, 2017-08-26 at 21:18 +0000, philippe renon wrote:<div class="yiv1342403481yqt1509535702" id="yiv1342403481yqtfd11018"><br clear="none">> Hi,<br clear="none">> <br clear="none">> The following python3 code:<br clear="none">> <br clear="none">>     import gi<br clear="none">>     gi.require_version("Gst", "1.0")<br clear="none">>     from gi.repository import Gst<br clear="none">>     print(Gst.MessageType.get_name(Gst.MessageType.DEVICE_ADDED)) <br clear="none">> <br clear="none">> fails on windows 32 and 64 with this error:<br clear="none">> <br clear="none">>     OverflowError: Python int too large to convert to C long<br clear="none">> <br clear="none">>     The above exception was the direct cause of the following<br clear="none">> exception:<br clear="none">> <br clear="none">>     Traceback (most recent call last):<br clear="none">>       File "bug.py", line 4, in <module><br clear="none">>         print(Gst.MessageType.get_name(Gst.MessageType.DEVICE_ADDED))<br clear="none">>     SystemError: gi.FunctionInfo(get_name) returned a result with an<br clear="none">> error set<br clear="none">> <br clear="none">> The same is true for any GstMessageType above or equal to<br clear="none">> GST_MESSAGE_EXTENDED.<br clear="none">> <br clear="none">> My understanding of the issue is that, something, somewhere, is<br clear="none">> trying to map the Gst enum/flag to a C long.<br clear="none">> On Windows, according to [1], a long is a signed 32 bit integer<br clear="none">> (range is –2147483648 through 2147483647).<br clear="none">> But GST_MESSAGE_EXTENDED (and above enums) are too big to fit a<br clear="none">> Windows C long.<br clear="none">> GST_MESSAGE_EXTENDED = (1 << 31) = 2147483648 > 2147483647.<br clear="none">> <br clear="none">> I found a somewhat similar issue : <a rel="nofollow" shape="rect" target="_blank" href="https://bugzilla.gnome.org/show_bu">https://bugzilla.gnome.org/show_bu</a><br clear="none">> g.cgi?id=732633<br clear="none">> But this issue is related to signed vs unsigned (and is fixed in<br clear="none">> 1.12.2).<br clear="none">> <br clear="none">> Is that issue fixable ? If yes, where should I look : pyobject,<br clear="none">> gobject-introspection, ... ?</div><br clear="none"><br clear="none">Please file a bug about this. It's probably not fixable without changes<br clear="none">in the Python bindings (by using an unsigned int here instead of a<br clear="none">signed one) or ABI changes on the GStreamer side.<br clear="none"><br clear="none">-- <br clear="none">Sebastian Dröge, Centricular Ltd · <a rel="nofollow" shape="rect" target="_blank" href="https://www.centricular.com/">https://www.centricular.com</a></div></div>_______________________________________________<br clear="none">gstreamer-devel mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><div class="yiv1342403481yqt1509535702" id="yiv1342403481yqtfd61758"><br clear="none"></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>