Since Python 3.4.3 reverted [1] a patch which was critical to how kdev-python works, it is severely broken with this version of Python; it causes crashes and wrong highlighting. A fix in kdev-python is being worked on, until that is released, downgrading to Python 3.4.2 or earlier is the only option. _______________ [1] https://bugs.python.org/issue21295
*** Bug 350751 has been marked as a duplicate of this bug. ***
*** Bug 351147 has been marked as a duplicate of this bug. ***
Can you please change required version in parser/CMakeLists.txt? It confused me - I compiled 3.4.3 from source because my distro provides 3.4.2 only. Now I see it would work better with 3.4.2. Thank you.
It seems that python 3.5.0 has some improvements in this area. At least the test cases in the python bug report (https://bugs.python.org/issue21295) seems to work correctly. I'm unable to test kdev-python with python 3.5.0 because the compilation fails: In file included from ../../parser/astbuilder.cpp:424:0: ../../parser/generated.h: In member function 'Python::Ast* Python::PythonAstTransformer::visitNode(_expr*)': ../../parser/generated.h:156:109: error: 'struct _expr::<anonymous union>::<anonymous>' has no member named 'kwargs' nodeStack.push(v); v->keywordArguments = static_cast<ExpressionAst*>(visitNode(node->v.Call.kwargs)); nodeStack.pop();
Hmm, is that related to the issue we have here? The relevant thing is that in "foo.bar" the offset of "bar" must be 4, not 0. Greetings!
Ah, sorry, I'm not familiar with python ast module. Is this more helpful? >>> for x in ast.walk(ast.parse('foo.bar')): ... if hasattr(x, 'col_offset'): ... print("%s: %d" % (x, x.col_offset)) ... <_ast.Expr object at 0x7fcdc84722b0>: 0 <_ast.Attribute object at 0x7fcdc84723c8>: 0 <_ast.Name object at 0x7fcdc8472438>: 0
Yes, that is the point. And for our purpose the second one would need to be 4, not 0.
Should be fixed in master and the tip of the 1.7-py3 branch. I'll do a release of the latter shortly.
Created attachment 94936 [details] attachment-18816-0.html Many thanks for fixing this. I'm trying to test it and run into two issues: 1. It requires kdevplatform-1.7.2, but Google knows nothing about this new version (the latest is 1.7.1). 2. I have Python 3.4.3 compiled from sources in a custom dir (using pyenv), how do I tell cmake to use it instead of system python3? On Wed, Oct 7, 2015 at 5:37 PM, Sven Brauch <mail@svenbrauch.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=349990 > > Sven Brauch <mail@svenbrauch.de> changed: > > What |Removed |Added > > ---------------------------------------------------------------------------- > Status|CONFIRMED |RESOLVED > Resolution|--- |FIXED > > --- Comment #8 from Sven Brauch <mail@svenbrauch.de> --- > Should be fixed in master and the tip of the 1.7-py3 branch. I'll do a > release > of the latter shortly. > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
You can change the requirement to 1.7.1 in CMakeLists.txt, it doesn't really need that. The release will happen in a few days. For a custom path to python, I am not sure, but in ccmake you can set it manually; the key is PYTHON_LIBRARY so you could try -DPYTHON_LIBRARY=path/to/libpython.so maybe?
Created attachment 94937 [details] attachment-20469-0.html What worked for me is specifying PYTHON_EXEC. Found it out after discovering modules under cmake directory in the source. Here is the cmake command line for future reference: ~/dev/kdev-python/build$ cmake -DPYTHON_EXEC=~/.pyenv/versions/3.4.3/bin/python ../ Otherwise I've tested it briefly and it looks very good! Thank you very much! Any plans for supporting Python 3.5? Particularly new "async def" and "await" keywords? On Sat, Oct 10, 2015 at 9:55 PM, Sven Brauch <mail@svenbrauch.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=349990 > > --- Comment #10 from Sven Brauch <mail@svenbrauch.de> --- > You can change the requirement to 1.7.1 in CMakeLists.txt, it doesn't > really > need that. The release will happen in a few days. > > For a custom path to python, I am not sure, but in ccmake you can set it > manually; the key is PYTHON_LIBRARY so you could try > -DPYTHON_LIBRARY=path/to/libpython.so maybe? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
That's already implemented in master, I do not plan to backport it to 1.7 though. :)
Created attachment 94938 [details] attachment-22138-0.html And master works only with upcoming kdevelop 5, right? Do you have any idea of its planned release date? On Oct 10, 2015 11:00 PM, "Sven Brauch" <mail@svenbrauch.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=349990 > > --- Comment #12 from Sven Brauch <mail@svenbrauch.de> --- > That's already implemented in master, I do not plan to backport it to 1.7 > though. :) > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Yes, exactly. A stable release should happen within "a few months", probably.
Created attachment 94964 [details] attachment-17183-0.html I think there is regression: Most of system imports do not work: Try any of these: import collections as _collections import copy as _copy import os as _os import re as _re import sys as _sys import textwrap as _textwrap None of them would be recognized. On Sat, Oct 10, 2015 at 11:04 PM, Sven Brauch <mail@svenbrauch.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=349990 > > --- Comment #14 from Sven Brauch <mail@svenbrauch.de> --- > Yes, exactly. > A stable release should happen within "a few months", probably. > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Which version are you using now exactly? Also, are you sure the background parser has finished?
Created attachment 94965 [details] kdevelop.log.gz Branch 1.7-py3 HEAD. Attached is kdevelop log with debug enabled for parsing the following file: import collections as _collections import copy as _copy import os as _os import re as _re import sys as _sys import textwrap as _textwrap I've did it on fresh project containing only this file and after cleaning ~/.cache/kdevduchain/ dir. On Mon, Oct 12, 2015 at 1:04 PM, Sven Brauch <mail@svenbrauch.de> wrote: > https://bugs.kde.org/show_bug.cgi?id=349990 > > --- Comment #16 from Sven Brauch <mail@svenbrauch.de> --- > Which version are you using now exactly? Also, are you sure the background > parser has finished? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Let's continue this in the other report ;)