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

Problem importing module strings.py: cannot import name 'Counter' #4412

Closed
pkolbus opened this issue Apr 26, 2021 · 2 comments · Fixed by #4446
Closed

Problem importing module strings.py: cannot import name 'Counter' #4412

pkolbus opened this issue Apr 26, 2021 · 2 comments · Fixed by #4446
Assignees
Labels
Blocker 🙅 Blocks the next release Crash 💥 A bug that makes pylint crash
Milestone

Comments

@pkolbus
Copy link
Contributor

pkolbus commented Apr 26, 2021

On python 3.6.0, usage of pylint 2.8.2 results in an import warning to stdout.

N.B. typing.Counter was added in python 3.6.1, so this import probably needs to be wrapped in a TYPE_CHECKING guard.

(Yes, I know 3.6.0 is an old patch release. Still have it on some CI servers for unfortunate reasons.)

Steps to reproduce

Given that this warning seems to be coming from register_plugins() in utils.py, it is probably reproducible with any input file.

Current behavior

Printed message: Problem importing module strings.py: cannot import name 'Counter'

Expected behavior

No warning, and strings checker works as expected.

pylint --version output

Result of pylint --version output:

pylint 2.8.2
astroid 2.5.6
Python 3.6.0 (default, Jan 23 2017, 20:01:14) [MSC v.1900 64 bit (AMD64)]
@pkolbus
Copy link
Contributor Author

pkolbus commented Apr 26, 2021

Happy to contribute a patch if you like.

@cdce8p
Copy link
Member

cdce8p commented Apr 26, 2021

Happy to contribute a patch if you like.

Go for it! Tag me and I'll make sure to review it.

Had to search a bit, but it seams as this commit is the issue: link

@cdce8p cdce8p added Blocker 🙅 Blocks the next release Crash 💥 A bug that makes pylint crash labels Apr 26, 2021
@cdce8p cdce8p added this to the 2.8.3 milestone Apr 26, 2021
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.8.3, 2.9.0 May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker 🙅 Blocks the next release Crash 💥 A bug that makes pylint crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants