print statement is highlighted by pylint
See original GitHub issueEnvironment data
VS Code version: 1.19.3 Python Extension version: 2018.1 Python Version: 2.7, 3.5 OS and version: OS independent
Actual behavior
pylint marks print statement and print() function are marked as error on both python 2.7 and python 3.5. This behavior appeared just after module upgrade to 2018.1
Expected behavior
pylint shouldn’t mark error if using print() function on any python version and print statement on python 2.7
Steps to reproduce:
- create new .py file
- enter
print("Hello, world!")
- save file
Logs
Output from Python
output panel
[pylint]E1601:print statement used (1, 1)
Output from Console window
(Help->Developer Tools menu)
console.ts:123 [Extension Host] Python Extension: Failed to get conda info from conda null
t.log @ console.ts:123
console.ts:123 [Extension Host] (node:16735) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:26 (5 by maintainers)
Top Results From Across the Web
VS Code shows an error message at print statement in python ...
3 with Python 2.7 on Windows. Recently pylint (code analyzer) shown an error message "E1601:print statement used". But I don't know why!
Read more >Pylint output - Pylint 2.16.0-dev documentation
The simplest way to output to a file is with the --output=<filename> option. ... You can change this by passing pylint the --output-format=<value>...
Read more >Print All Pylint Warning Codes - seanwasere
Used when a word in docstring is not spelled correctly. :invalid-characters-in-docstring (C0403): *Invalid characters %r in a docstring* Used when a word in ......
Read more >Your Guide to the Python print() Function
In this step-by-step tutorial, you'll learn about the print() function in Python and discover some of its lesser-known features.
Read more >Linting Python in Visual Studio Code
To enable linters, open the Command Palette (Ctrl+Shift+P) and select the Python: Select Linter command. The Select Linter command adds "python.linting.<linter> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This change is by design since many people don’t care about whitespace or styling. In many editors these kind of reports are off by default. There is a setting though:
pylintUseMinimalCheckers
You can set it to false and the arguments you mentioned won’t be passed to pylint.
But it seems, that according to pylint, this message should be printed only if print is used as the statement, while it marks as an error while using print as a function.
Moreover, I couldn’t reproduce this with system pylint (which is installed on the same machine, as the affected VS Code):
And if I replace print() with a statement, only “Missing module docstring (missing-docstring)” notification will stay. So this is possible only if the module uses it’s own pylint, which is different version from the system one.
It seems, that it’s my fault about reporting problem for python3 - pylint just hadn’t re-read the file after changing Python version. So this problem is referenced only to python2.