FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: macOS: PyPy 3.8 (v7.3.9) threading get_native_id Broken · Issue #24094 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: macOS: PyPy 3.8 (v7.3.9) threading get_native_id Broken #24094

Closed

Description

Bug summary

In PyPy 3.8 (v7.3.9), matplotlib 3.6.0 is cannot be imported, leading to breakage.

Ref.: https://foss.heptapod.net/pypy/pypy/-/issues/3764

Code for reproduction

import matplotlib.pyplot as plt

Actual outcome

AttributeError: module 'threading' has no attribute 'get_native_id'

in matplotlib/pyplot.py:337

     def _warn_if_gui_out_of_main_thread():
         # This compares native thread ids because even if python-level Thread
         # objects match, the underlying OS thread (which is what really matters)
         # may be different on Python implementations with green threads.
         if (_get_required_interactive_framework(_get_backend_mod()) and
 >               threading.get_native_id() != threading.main_thread().native_id):
 E               AttributeError: module 'threading' has no attribute 'get_native_id'

Expected outcome

Work as usual.

Additional information

This has been first posted in PyPy: https://foss.heptapod.net/pypy/pypy/-/issues/3764

I saw this on Conda-Forge, starting a few weeks ago as they shipped the latest PyPy 3.8.

Operating system

macOS 11.7 (x86_64) via Azure Pipelines 14 Runner

Matplotlib Version

3.6.0

Matplotlib Backend

default

Python version

PyPy 3.8 (v7.3.9)

Jupyter version

N/A

Installation

conda

Activity

  1. added this to the v3.6.2 milestone on Oct 12, 2022
  2. QuLogic commented on Oct 14, 2022

    Member

    @anntzer should we just fall back to the previous thread ID implementation when get_native_id is unavailable?

  3. anntzer commented on Oct 14, 2022

    Contributor

    I would guess that's better than nothing? This was added in #23445 to better support green threads, which may not really be a problem with pypy anyways? (I don't know if such threading libraries exist for pypy...)

  4. added a commit that references this issue on Oct 15, 2022
    d4cf0f7
  5. ax3l commented on Oct 15, 2022

    Author

    Thank you all for the fix! 🎉

  6. added a commit that references this issue on Oct 18, 2022
    b1d8575
  7. added a commit that references this issue on Oct 24, 2022
    5e133e1
  8. added a commit that references this issue on Dec 19, 2022
    8811962
  9. added a commit that references this issue on Apr 19, 2026
    3996482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL