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

syntax error on import #2976

Closed
thorstenkampe opened this issue Jun 23, 2019 · 7 comments
Closed

syntax error on import #2976

thorstenkampe opened this issue Jun 23, 2019 · 7 comments

Comments

@thorstenkampe
Copy link

Steps to reproduce

  1. Create Python module containing import inspect
  2. run pylint on this file

Current behavior

************* Module test
test.py:1:0: C0111: Missing module docstring (missing-docstring)
test.py:1:0: E0001: Cannot import 'inspect' due to syntax error 'invalid syntax (<unknown>, line 1328)' (syntax-error)
test.py:1:0: W0611: Unused import inspect (unused-import)

-----------------------------------------------------------------------
Your code has been rated at -60.00/10 (previous run: -50.00/10, -10.00)

Expected behavior

No syntax error on importing inspect

> python.exe -V
Python 3.8.0b1
> python.exe -c 'import inspect'
> [no error]

pylint --version output

pylint 2.3.1
astroid 2.2.5
Python 3.8.0b1 (tags/v3.8.0b1:3b5deb0116, Jun  4 2019, 19:52:55) [MSC v.1916 64 bit (AMD64)]
@thorstenkampe
Copy link
Author

Maybe a Python 3.8 issue - I can't reproduce the issue with Python 3.7.4rc1

@tacaswell
Copy link

It is indeed a py38 thing, he offending line is:

def getcallargs(func, /, *positional, **named):

@tacaswell
Copy link

This chases back to astroid not supporting all of the 3.8 syntax (pylint-dev/astroid#675) which in turn falls back to typed_ast (python/typed_ast#118)

@PCManticore
Copy link
Contributor

Yeah, we don't currently support Python 3.8. astroid partially does, but there still some work to be done against Python 3.8 beta.

@linusjf
Copy link

linusjf commented Nov 23, 2019

I have the same error with respect to importing. I could suppress it via .pylintrc or .prospector.yaml for E0001 or syntax-error. But wouldn't that suppress errors in my code too?

@PCManticore
Copy link
Contributor

@Fernal73 Please open a separate issue if you have more details. This one was caused by not supporting Python 3.8 but the latest versions support Python 3.8.

@linusjf
Copy link

linusjf commented Nov 23, 2019

Arch Linux on Termux:
pylint --version
pylint 2.3.1
astroid 2.2.5
Python 3.8.0 (default, Nov 14 2019, 15:41:40)
[GCC 8.3.0]

Termux:
$ pylint --version
pylint 2.3.1
astroid 2.2.5
Python 3.8.0 (default, Nov 20 2019, 20:44:46)
[Clang 8.0.7 (https://android.googlesource.com/toolchain/clang b55f2d4ebfd35bf6

import random
throws an error.

Should this be a pylint issue or should I post it on the Github projects for Termux and/or ArchLinux for Termux?

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

No branches or pull requests

4 participants