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

-j 0 causes infinite recursion on Windows #6609

Closed
jolaf opened this issue May 13, 2022 · 13 comments
Closed

-j 0 causes infinite recursion on Windows #6609

jolaf opened this issue May 13, 2022 · 13 comments
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@jolaf
Copy link

jolaf commented May 13, 2022

Bug description

Any number of jobs other than 1 (i. e. 0, 2, 3, 4 etc.) causes pylint to go into infinite recursion on any input file.
Both jobs=0 in config and -j 0 in command line work the same.

Command used

pylint -j 0 empty_file.py

Pylint output

Process SpawnPoolWorker-1:
Traceback (most recent call last):
  File "C:\Python310\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\Python310\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python310\lib\multiprocessing\pool.py", line 109, in worker
    initializer(*initargs)
  File "C:\Python310\lib\site-packages\pylint\lint\parallel.py", line 61, in _worker_initialize
    _worker_linter = dill.loads(linter)
  File "C:\Python310\lib\site-packages\dill\_dill.py", line 327, in loads
    return load(file, ignore, **kwds)
  File "C:\Python310\lib\site-packages\dill\_dill.py", line 313, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "C:\Python310\lib\site-packages\dill\_dill.py", line 525, in load
    obj = StockUnpickler.load(self)
  File "C:\Python310\lib\site-packages\colorama\ansitowin32.py", line 29, in __getattr__
    return getattr(self.__wrapped, name)
  File "C:\Python310\lib\site-packages\colorama\ansitowin32.py", line 29, in __getattr__
    return getattr(self.__wrapped, name)
  File "C:\Python310\lib\site-packages\colorama\ansitowin32.py", line 29, in __getattr__
    return getattr(self.__wrapped, name)
  [Previous line repeated 985 more times]
RecursionError: maximum recursion depth exceeded

Expected behavior

No output

Pylint version

pylint 2.13.9
astroid 2.11.5
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]

OS / Environment

Edition		Windows 10 Home
Version		21H2
Installed on	‎23.‎02.‎2021
OS build	19044.1645
Experience	Windows Feature Experience Pack 120.2212.4170.0

Additional dependencies

aiohttp==3.8.1
aiosignal==1.2.0
asn1crypto==1.5.1
astroid==2.11.5
asttokens==2.0.5
async-generator==1.10
async-timeout==4.0.1
attrs==21.2.0
backcall==0.2.0
beautifulsoup4==4.10.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.7
click==8.0.3
colorama==0.4.4
cryptography==37.0.2
decorator==5.1.0
dill==0.3.4
dnspython==2.2.1
executing==0.8.2
frozenlist==1.2.0
gazpacho==1.1
geoip2==4.5.0
gevent==21.8.0
greenlet==1.1.2
h11==0.13.0
html5lib==1.1
humanize==4.1.0
idna==3.3
ipython==8.3.0
isort==5.10.1
jedi==0.18.1
lazy-object-proxy==1.7.1
lxml==4.8.0
matplotlib-inline==0.1.3
maxminddb==2.2.0
mccabe==0.6.1
multidict==5.2.0
mypy==0.950
mypy-extensions==0.4.3
netifaces==0.11.0
outcome==1.1.0
parso==0.8.2
pathspec==0.9.0
pickleshare==0.7.5
Pillow==9.1.0
platformdirs==2.5.2
prompt-toolkit==3.0.22
pure-eval==0.2.1
pycparser==2.21
pycryptodome==3.14.1
pycryptodomex==3.14.1
pycurl @ file:///Q:/Downloads/Python/pycurl-7.45.1-cp310-cp310-win_amd64.whl
Pygments==2.10.0
pylint==2.13.9
pyOpenSSL==22.0.0
PySocks==1.7.1
pytypes==1.0b10
requests==2.27.1
selenium==4.1.5
six==1.16.0
sniffio==1.2.0
sortedcontainers==2.4.0
soupsieve==2.3.1
stack-data==0.1.3
toml==0.10.2
tomli==2.0.1
traitlets==5.1.1
trio==0.20.0
trio-websocket==0.9.2
typed-ast==1.5.3
typeguard==2.13.3
types-certifi==2021.10.8.2
types-cryptography==3.3.9
types-enum34==1.1.1
types-ipaddress==1.0.1
types-pycurl==7.44.8
types-pyOpenSSL==21.0.1
types-requests==2.27.25
types-urllib3==1.26.14
typing_extensions==4.0.0
urllib3==1.26.7
waybackpy==3.0.3
wcwidth==0.2.5
webencodings==0.5.1
websocket==0.2.1
wrapt==1.13.3
wsproto==1.1.0
yarl==1.7.2
zope.event==4.5.0
zope.interface==5.4.0
@jolaf jolaf added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label May 13, 2022
@DanielNoord
Copy link
Collaborator

I assume empty_file.py is actually empty?

@jolaf
Copy link
Author

jolaf commented May 14, 2022

@DanielNoord Yep, but any valid Python source gives the same result for me.

I tried different sources trying to find the cause before I found out that even empty file produces crash, so I started looking into my config file settings, and nailed it down to jobs option.

@DanielNoord
Copy link
Collaborator

Could you give me your config file as well? I can't reproduce this on main with the PYLINTRC used by pylint itself so there might be a combination of factors at play here.

@jolaf
Copy link
Author

jolaf commented May 14, 2022

I've just reproduced successfully with config file containing only a single [MASTER] statement.

@jolaf
Copy link
Author

jolaf commented May 14, 2022

I've added pip freeze output, just in case.

@DanielNoord
Copy link
Collaborator

pylint --version
pylint 2.14.0-b1
astroid 2.11.5
Python 3.10.0 (default, Oct 27 2021, 16:20:25) [Clang 13.0.0 (clang-1300.0.29.3)]cat pylintrc
[MASTER]pylint -j 0 setup.py
************* Module setup
setup.py:1:0: C0114: Missing module docstring (missing-module-docstring)

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

We'll need to investigate this a little further. I don't really have the time to dig into this now, but it might indeed be some dependency.

@jolaf
Copy link
Author

jolaf commented May 14, 2022

Also, Python version is different in your setup, it might be important.

@jolaf
Copy link
Author

jolaf commented May 14, 2022

Also, please try -j 2, just in case.

@DanielNoord
Copy link
Collaborator

Quickly tried:

pylint --version
pylint 2.14.0-b1
astroid 2.11.5
Python 3.10.4 (main, Apr  7 2022, 19:54:21) [Clang 13.0.0 (clang-1300.0.29.30)]cat pylintrc
[MASTER]pylint -j 2 setup.py
************* Module setup
setup.py:1:0: C0114: Missing module docstring (missing-module-docstring)

------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)

😓

But I haven't installed all dependencies. So that might be it?

@jolaf
Copy link
Author

jolaf commented May 14, 2022

Your Python:
Python 3.10.4 (main, Apr 7 2022, 19:54:21) [Clang 13.0.0 (clang-1300.0.29.30)]
My Python:
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]

Are you trying to reproduce on Windows? On Ubuntu everything works fine for me.

@DanielNoord
Copy link
Collaborator

Ah silly me. This is a duplicate of #6012.

Should have read the stacktrace a little bit better. Basically, we know about the issue but this needs to be fixed by a new release of colorama. I have pushed a fix for the issue (tartley/colorama#339) to their main branch but they haven't had a release in a long time, see tartley/colorama#341.

@DanielNoord DanielNoord added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels May 14, 2022
@jolaf
Copy link
Author

jolaf commented May 14, 2022

Oh, I see. Thank you!

Uninstalling colorama fixed the problem for me.

@DanielNoord
Copy link
Collaborator

Sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants