[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Undefined "typeinfo" for KDEDModule while trying to create PtKF5
From:       Shaheed Haque <srhaque () theiet ! org>
Date:       2016-04-21 19:18:45
Message-ID: CAHAc2jcp6K95gH=0Dy_Y_mXnGM0PvtcyZDo3ceA-+wuCE2h3Jw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Ah. I see now that when I reported the above, I had also changed/fixed my
paths to make sure I had a PyKF5 directory with a __init__.py, and you are
right, with that plumbing in place, it works without any trouble. For
example:

$ python -c 'from PyKF5 import KDBusAddons'
$ cd PyKF5
$ python -c 'import KDBusAddons'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
SystemError: dynamic module not initialized properly

So...I guess this is working as expected!

Thanks, Shaheed

On 21 April 2016 at 18:55, Phil Thompson <phil@riverbankcomputing.com>
wrote:

> On 21 Apr 2016, at 6:48 pm, Shaheed Haque <srhaque@theiet.org> wrote:
> >
> > Phil,
> >
> > That was the problem:
> >
> > $ python
> > ...
> > >>> from PyQt5 import QtCore
> > >>> from PyQt5 import QtDBus
> > >>> from PyKF5 import KDBusAddons
> > >>> help(KDBusAddons)
> > ...etc...
> > >>>
>
> Sorry, I'm confused. Are you saying that the above works?
>
> But doing the KDBusAddons import without the PyQt5 imports doesn't?
>
> > As you suggested, I did some debugging, and the code seems to get right
> to the bottom of sipKDBusAddonscmodule.cpp, such that some printf-debug
> like this :
> >
> >     outfile << "at line " << __LINE__ << "\n" <<
> >     " QtCore: " << sipModuleAPI_KDBusAddons_QtCore <<
> >     " QtDbus: " << sipModuleAPI_KDBusAddons_QtDBus <<
> >         " sipModule: " << sipModule << "\n";
> >     SIP_MODULE_RETURN(sipModule);
> > }
> >
> > emits *some* values:
> >
> >  QtCore: 0x7f0027642c20 QtDbus: 0x7f0027197540 sipModule: 0x7f00307c6e88
> >
> > even in the error case. Is there some way to make the user experience
> more robust in this regard? (I'm going to poke around the PyImport_xxx
> APIs, but I assume there is a reason behind what is done at present?).
>
> Python2 is much worse at reporting import failures than Python3.
>
> Phil

[Attachment #5 (text/html)]

<div dir="ltr"><div><div>Ah. I see now that when I reported the above, I had also \
changed/fixed my paths to make sure I had a PyKF5 directory with a __init__.py, and \
you are right, with that plumbing in place, it works without any trouble. For \
example:<br><br>$ python -c &#39;from PyKF5 import KDBusAddons&#39;<br>$ cd \
PyKF5<br>$ python -c &#39;import KDBusAddons&#39;<br>Traceback (most recent call \
last):<br>   File &quot;&lt;string&gt;&quot;, line 1, in \
&lt;module&gt;<br>SystemError: dynamic module not initialized \
properly<br><br></div>So...I guess this is working as expected!<br>  \
<br></div>Thanks, Shaheed<br></div><div class="gmail_extra"><br><div \
class="gmail_quote">On 21 April 2016 at 18:55, Phil Thompson <span dir="ltr">&lt;<a \
href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><span class="">On 21 Apr 2016, at 6:48 pm, Shaheed Haque \
&lt;<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>&gt; wrote:<br> \
&gt;<br> &gt; Phil,<br>
&gt;<br>
&gt; That was the problem:<br>
&gt;<br>
&gt; $ python<br>
&gt; ...<br>
&gt; &gt;&gt;&gt; from PyQt5 import QtCore<br>
&gt; &gt;&gt;&gt; from PyQt5 import QtDBus<br>
&gt; &gt;&gt;&gt; from PyKF5 import KDBusAddons<br>
&gt; &gt;&gt;&gt; help(KDBusAddons)<br>
&gt; ...etc...<br>
&gt; &gt;&gt;&gt;<br>
<br>
</span>Sorry, I&#39;m confused. Are you saying that the above works?<br>
<br>
But doing the KDBusAddons import without the PyQt5 imports doesn&#39;t?<br>
<span class=""><br>
&gt; As you suggested, I did some debugging, and the code seems to get right to the \
bottom of sipKDBusAddonscmodule.cpp, such that some printf-debug like this :<br> \
&gt;<br> &gt;        outfile &lt;&lt; &quot;at line &quot; &lt;&lt; __LINE__ &lt;&lt; \
&quot;\n&quot; &lt;&lt;<br> &gt;        &quot; QtCore: &quot; &lt;&lt; \
sipModuleAPI_KDBusAddons_QtCore &lt;&lt;<br> &gt;        &quot; QtDbus: &quot; \
&lt;&lt; sipModuleAPI_KDBusAddons_QtDBus &lt;&lt;<br> &gt;              &quot; \
sipModule: &quot; &lt;&lt; sipModule &lt;&lt; &quot;\n&quot;;<br> &gt;        \
SIP_MODULE_RETURN(sipModule);<br> &gt; }<br>
&gt;<br>
&gt; emits *some* values:<br>
&gt;<br>
&gt;   QtCore: 0x7f0027642c20 QtDbus: 0x7f0027197540 sipModule: 0x7f00307c6e88<br>
&gt;<br>
&gt; even in the error case. Is there some way to make the user experience more \
robust in this regard? (I&#39;m going to poke around the PyImport_xxx APIs, but I \
assume there is a reason behind what is done at present?).<br> <br>
</span>Python2 is much worse at reporting import failures than Python3.<br>
<span class="HOEnZb"><font color="#888888"><br>
Phil</font></span></blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic