Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] print(this,end=' ') is highlighted as syntax error #2064

Closed
geo7 opened this issue Jun 20, 2015 · 14 comments
Closed

[python] print(this,end=' ') is highlighted as syntax error #2064

geo7 opened this issue Jun 20, 2015 · 14 comments

Comments

@geo7
Copy link
Contributor

geo7 commented Jun 20, 2015

The first instance of

print(something,end='')

Is highlighted as a syntax error, all others in the file are fine

@geo7 geo7 changed the title print(this,end=' ') is highlighted as syntax error [python] print(this,end=' ') is highlighted as syntax error Jun 20, 2015
@cpaulik
Copy link
Contributor

cpaulik commented Jun 20, 2015

For me if I switch to a python 3 environment then this is not highlighted as an error.

In python 2 this is highlighted as a syntax error as you explained. It seems that the flycheck checker stops after the first invalid syntax error. If you enter any invalid syntax before your print statement it will no longer be highlighted.

I think your syntax checker is not the python 3 version.

@geo7
Copy link
Contributor Author

geo7 commented Jun 20, 2015

right, so I'm running python 3 REPL and stuff but flychecker is using the system default for python version?

Maybe the other issue will iron this one out at the same time!

@cpaulik
Copy link
Contributor

cpaulik commented Jun 20, 2015

Yes if pyflakes is not installed in your python 3 environment it will only find the one of the system installation.

@geo7
Copy link
Contributor Author

geo7 commented Jun 20, 2015

oh right cool - I've just installed that in the venv

@syl20bnr
Copy link
Owner

Is it ok ?

@geo7
Copy link
Contributor Author

geo7 commented Jun 23, 2015

nope - still have the issue

@StreakyCobra
Copy link
Contributor

@geo7 What's the current status of this issue?

@geo7
Copy link
Contributor Author

geo7 commented Nov 13, 2015

@StreakyCobra still present for me.

Simply writing

print("hellooo", end=' ')

should reproduce

@StreakyCobra
Copy link
Contributor

I can't. What does the error say?

@nixmaniack
Copy link
Contributor

It says following.
SyntaxError: invalid syntax [E901]

I assume it's related to python 2/3 being not detected properly as cpaulik has mentioned.

@StreakyCobra
Copy link
Contributor

This is an issue with flake8 as I saw. What does flake8 --version gives you?

@nixmaniack
Copy link
Contributor

On my system

2.2.4 (pep8: 1.5.7, pyflakes: 0.8.1, hacking.core: 0.0.1, ProxyChecker: 0.0.1, mccabe: 0.2.1) CPython 2.7.5 on Darwin

@StreakyCobra
Copy link
Contributor

CPython 2.7.5 Here is your problem :-) Either:

  1. Install a more recent version of flake8; or
  2. Disable the flake8 checker in flycheck

@nixmaniack
Copy link
Contributor

2.7.5 is for legacy reasons!

Anyhow, it's a non-issue for me! The OP should take a note of above instructions and report if it fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants