Repository navigation
Open
Description
In IDLE:
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Vec2:
... def __init__(self, x=0.0, y=0.0):
... self.x = x
... self.y = y
... def __mul__(self, other):
... if type(other) is not Vec2:
... result = Vec2()
... result.x = self.x * other
... result.y = self.y * other
... return result
... else:
... return self.x*other.x + self.y*other.y
... def __rmul__(self, other):
... # introduce bug where self and other should be swapped
... return other * self
...
>>> x = Vec2(1.0, 1.0)
>>> x * 2
<__main__.Vec2 object at 0x0000016278FA7100>
>>> 2 * x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 15, in __rmul__
File "<stdin>", line 15, in __rmul__
File "<stdin>", line 15, in __rmul__
[Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceededRunning in iPython, instead of a RecursionError, the program directly crashes.
After the crash, the ERRORLEVEL flag is set to -1073741571.
On pip 19.2.3, these are the following dependencies,
Package Version
---------------- -------
backcall 0.1.0
colorama 0.4.3
cycler 0.10.0
decorator 4.4.2
ipython 7.13.0
ipython-genutils 0.2.0
jedi 0.16.0
kiwisolver 1.1.0
matplotlib 3.2.1
numpy 1.18.2
parso 0.6.2
pickleshare 0.7.5
pip 19.2.3
prompt-toolkit 3.0.4
Pygments 2.6.1
pyparsing 2.4.6
python-dateutil 2.8.1
setuptools 41.2.0
six 1.14.0
traitlets 4.3.3
wcwidth 0.1.8
Reacted by Jan Philipp Harries, Andrew Tapia and Susumu Asaga
Metadata
Metadata
Assignees
Labels
No labels
Activity
Carreau commentedon Mar 24, 2020
That is strange, it might be a windows specific error, I can't reproduce on the machines I have.
jphme commentedon Sep 9, 2020
I can confirm this bug (RecursionError is not thrown and can't be catched but kernel restarts directly in ipython/jupyter)
ipython 7.18.1 on current Windows 10
acbart commentedon Feb 26, 2021
Confirmed on my machine:
IPython 7.19.0 on current Windows 10.
Frustrating, since I really need to be able to catch this error!
acbart commentedon Feb 26, 2021
To make this more reproducible:
Changing the recursionlimit to be something like 1000 avoids the issue, though. I can recover from the maximum recursion error.
crusaderky commentedon Mar 2, 2021
I can only reproduce this bug on Python 3.9 + pytest; pytest on python 3.8 is fine; pure python 3.9 is also fine for me.
Windows 10 only; Ubuntu and MacOSX are fine.
No need to start ipython; importing the module is enough.
My reproducer:
crusaderky commentedon Mar 18, 2021
Now I can reproduce it on Python 3.8 and 3.9, without pytest
DiegoBaldassarMilleuno commentedon Jun 24, 2022
I can confirm this is affecting me as well, with Python 3.10.4 on Windows 11; it is also affecting JupyterLab, as one might expect.
Packages