Skip to content

[Bug]: Python 3.14 recursion error #29785

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

Closed
richard-hajek opened this issue Mar 20, 2025 · 3 comments
Closed

[Bug]: Python 3.14 recursion error #29785

richard-hajek opened this issue Mar 20, 2025 · 3 comments

Comments

@richard-hajek
Copy link

richard-hajek commented Mar 20, 2025

Bug summary

Recursion limit reached on seemingly innocent scatter

Code for reproduction

def main():
    import matplotlib.pyplot as plt

    plt.scatter([1,2], [3, 4])
    plt.show()


if __name__ == "__main__":
    main()

Actual outcome

I get an exception

...
File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 233, in <genexpr>
    args = (deepcopy(arg, memo) for arg in args)
            ~~~~~~~~^^^^^^^^^^^
  File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 138, in deepcopy
    y = copier(memo)
  File "/home/meowxiik/test3/.venv/lib/python3.14/site-packages/matplotlib/path.py", line 285, in __deepcopy__
    p = copy.deepcopy(super(), memo)
  File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 157, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 234, in _reconstruct
    y = func(*args)
  File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 233, in <genexpr>
    args = (deepcopy(arg, memo) for arg in args)
            ~~~~~~~~^^^^^^^^^^^
  File "/home/meowxiik/.local/share/uv/python/cpython-3.14.0a6-linux-x86_64-gnu/lib/python3.14/copy.py", line 138, in deepcopy
    y = copier(memo)
  File "/home/meowxiik/test3/.venv/lib/python3.14/site-packages/matplotlib/path.py", line 285, in __deepcopy__
    p = copy.deepcopy(super(), memo)
  File "/opt/pycharm-professional/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_pep_669_tracing.py", line 640, in py_raise_callback
    if frame is _get_top_level_frame():
                ~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/pycharm-professional/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_pep_669_tracing.py", line 176, in _get_top_level_frame
    name = splitext(basename(filename))[0]
                    ~~~~~~~~^^^^^^^^^^
  File "<frozen posixpath>", line 169, in basename
RecursionError: maximum recursion depth exceeded

Expected outcome

I do not get an exception

Additional information

Does not seem to occur when no renderer is found. Does seem to occur when ran in PyCharm and Marimo. Does not occur when uv run python3 main.py, which does this though

/home/meowxiik/test3/main.py:5: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
  plt.show()

Operating system

Linux

Matplotlib Version

3.10.1

Matplotlib Backend

module://backend_interagg

Python version

Python 3.14.0a6

Jupyter version

No response

Installation

None

@richard-hajek
Copy link
Author

richard-hajek commented Mar 20, 2025

Related: marimo-team/marimo#4178 ( Contains exact versions and environment config )

@rcomer
Copy link
Member

rcomer commented Mar 20, 2025

Duplicate of #29157 I think

@QuLogic
Copy link
Member

QuLogic commented Mar 20, 2025

Yes.

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

No branches or pull requests

3 participants