From kwrite-devel Sun Jul 01 16:06:03 2012 From: Shaheed Haque Date: Sun, 01 Jul 2012 16:06:03 +0000 To: kwrite-devel Subject: Re: Pate Message-Id: X-MARC-Message: https://marc.info/?l=kwrite-devel&m=134115899827857 BTW, since this seems to be a problem to do withthe way we are effectively trying to add into PyKDE4, perhaps the kde-binding people might have some useful pointers? Are any of them at Akademy I wonder... On 1 July 2012 10:58, Shaheed Haque wrote: > I committed a change last night (324e7e07) that should protect against > the immediate cause of the crash. But I don't think the fix you > suggested is going to help. Firstly, the path that you suggest *is* > added to sys.path very early on (see engine.cpp around line 205), and > I don't see any way to get to plugin.cpp:293 without going through > that first. Second, note that there are two Python modules called > "kate": > > - the first one is implemented by > /usr/local/share/apps/kate/plugins/pate/kate/__init__.py > > - the second one implemented by kate.so under PyKDE4, which the first > one depends on > > I believe you are having trouble picking up the second one for reasons > I don't understand. > > Confused, Shaheed > > > On 1 July 2012 08:49, Dominik Haumann wrote: >> On Saturday, June 30, 2012 10:57:23 PM Shaheed Haque wrote: >>> I did a bit more testing. If I remove the link, Kate definitely fails >>> to start for me like this: >>> >>> srhaque> kate >>> QDBusConnection: session D-Bus connection created before >>> QCoreApplication. Application may misbehave. >>> kate(3224)/Kate (Plugins): "Traceback (most recent call last): >>> File "/usr/local/share/apps/kate/plugins/pate/kate/__init__.py", >>> line 38, in >>> from PyKDE4.kate import Kate >>> No module named kate >>> Could not import kate" >>> kate(3224)/Kate (Plugins): Could not initialise Pate. Ouch! >>> kate(3224)/Kate (Plugins): "Traceback (most recent call last): >>> File "/usr/local/share/apps/kate/plugins/pate/kate/__init__.py", >>> line 38, in >>> from PyKDE4.kate import Kate >>> No module named kate >>> Could not import kate" >>> Segmentation fault (core dumped) >> >> Of course, that's the crash we initially posted some mails before. >> Question is: Can you change it in a way that it does not immediately crash? >> >> Is it possible to add to sys.path a python bindings file that is in the >> kate/pate/plugin folder? I think that would be the best way to fix it. >> Something like: >> >> // in C++, todo: do not hardcode the path >> char* katePythonPath = "$KDEDIR/share/apps/kate/plugins/pate/kate"; >> sys.path.append(katePythonPath) >> >> So sys.path is adapted before importing the Kate bindings? >> >>> Now, I add back the link like this, and it all works: >>> >>> $ sudo ln -s /usr/local/lib/python2.7/dist-packages/PyKDE4/kate.so >>> /usr/lib/python2.7/dist-packages/PyKDE4/kate.so >> >> That works for me, but then I got the crash as mentioned in my previous mail. >> >>> Question: do you have PyKDE4 installed? >> >> Of course, otherwise pate would not have been installed at all... >> >> Greetings, >> Dominik >> _______________________________________________ >> KWrite-Devel mailing list >> KWrite-Devel@kde.org >> https://mail.kde.org/mailman/listinfo/kwrite-devel _______________________________________________ KWrite-Devel mailing list KWrite-Devel@kde.org https://mail.kde.org/mailman/listinfo/kwrite-devel