Tkinter deallocation warnings after plotting tests

Đang mở
#141 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
matplotlib, python
Lĩnh vực
backend, testing-qa

Hướng nghiên cứu

Start with the three named tests in tests/integration/test_contour_plot_examples.py and reproduce the warnings in the stated Python 3.14, pytest and matplotlib environment. Trace how those tests create and clean up figures and Tkinter objects, then check whether cleanup occurs outside the GUI event loop. Done means the deallocation warnings are resolved and the integration tests pass; the issue does not identify a fix or more specific files to inspect.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

code hygiene infrastructure plotting

Warnings are emitted during the integration test suite when Tkinter objects are finalised:

PytestUnraisableExceptionWarning:
Exception ignored while calling deallocator
<function Variable.__del__ ...>

RuntimeError: main thread is not in main loop

The same error also occurs in tkinter.Image.__del__, where Tkinter attempts to delete an image from the Tcl/Tk interpreter.

The warnings have been observed in association with the following tests:

  • test_example_29_global_average_annual_temperature
  • test_example_7_lat_pressure_zonal_mean
  • test_example_10_latitude_time_hovmuller

emerging there in practice as:

tests/integration/test_contour_plot_examples.py::test_example_10_latitude_time_hovmuller
  /home/slb93/miniconda3/envs/cfplot-test-env/lib/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored while calling deallocator <function Image.__del__ at 0x7f6ee9513530>: None
  
  Traceback (most recent call last):
    File "/home/slb93/miniconda3/envs/cfplot-test-env/lib/python3.14/tkinter/__init__.py", line 4332, in __del__
      self.tk.call('image', 'delete', self.name)
      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  RuntimeError: main thread is not in main loop
  
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

The warnings appear to arise during GUI-object cleanup rather than directly from the plotting operations. The available traceback does not yet establish whether figures or Tkinter objects are being retained beyond the lifetime of the GUI event loop, or whether this is a Matplotlib/Tkinter backend cleanup issue.

Environment

  • Python: 3.14
  • Test framework: pytest
  • Plotting library: matplotlib
  • GUI library involved in traceback: Tkinter
  • Environment: cfplot-test-env
Ngôn ngữ chính
Python
Star
21
Fork
11
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NCAS-CMS/cf-plot

Tất cả issue của NCAS-CMS/cf-plot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.