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

List:       kwrite-devel
Subject:    Re: Pate
From:       Shaheed Haque <srhaque () theiet ! org>
Date:       2012-07-01 9:58:55
Message-ID: CAHAc2jfzkV9KSAPboq7=sfmahpbEFafgcfj0eS34WJa7Fh2Ltg () mail ! gmail ! com
[Download RAW message or body]

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 <dhaumann@kde.org> 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 <module>
>>     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 <module>
>>     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
[prev in list] [next in list] [prev in thread] [next in thread] 

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