Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[ Bug] Python crash when do win.read()

Đang mở
#6,620 12 bình luận 1 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
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu với việc tạo Window tối thiểu và vòng lặp win.read() được mô tả trong issue, sử dụng Python 3.12.1, macOS Sonoma 14.1, tkinter 8.6.13 và PySimpleGUI 4.60.5. So sánh hành vi với Python 3.9 và kiểm tra crash trace macOS/Tk được cung cấp. Công việc được xem là hoàn tất khi crash đã được báo cáo được tái hiện và issue được giải quyết hoặc giới hạn tương thích của nó được ghi rõ ràng.

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

Mô tả

Missing Code To Duplicate Platform Specific Issue - Mac
Type of Issue (Enhancement, Error, Bug, Question)

Operating System

Mac Sonoma 14.1

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()
Python version: 3.12.1 (v3.12.1:2305ca5144, Dec 7 2023, 17:23:38) [Clang 13.0.0 (clang-1300.0.29.30)]
port: tkinter
tkinter version: 8.6.13
PySimpleGUI version: 4.60.5
PySimpleGUI filename: /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PySimpleGUI/PySimpleGUI.py


Your Experience In Months or Years (optional)

Years Python programming experience

Years Programming experience overall

Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)

Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description

If I use Python3.12, then python will crash when do "evt, val = win.read()"
with same script, If I use Python3.9, then UI will launch successfully for "evt, val = win.read()"

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:


# Paste your code here
win = sg.Window(window_title, main_layout, alpha_channel=0.95, grab_anywhere=False, resizable=True)
while True:
     evt, val = win.read()

Screenshot, Sketch, or Drawing

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication macOSVersion]: unrecognized selector sent to instance 0x12ca1c050'
*** First throw call stack:
(
0 CoreFoundation 0x0000000189f92800 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000189a89eb4 objc_exception_throw + 60
2 CoreFoundation 0x000000018a0443bc -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x0000000189efca84 forwarding + 1572
4 CoreFoundation 0x0000000189efc3a0 _CF_forwarding_prep_0 + 96
5 libtk8.6.dylib 0x000000013ccc63e8 GetRGBA + 64
6 libtk8.6.dylib 0x000000013ccc6168 TkpGetColor + 476
7 libtk8.6.dylib 0x000000013cc144b4 Tk_GetColor + 152
8 libtk8.6.dylib 0x000000013cc05c98 Tk_Get3DBorder + 136
9 libtk8.6.dylib 0x000000013cc05ae8 Tk_Alloc3DBorderFromObj + 144
10 libtk8.6.dylib 0x000000013cc159b4 DoObjConfig + 832
11 libtk8.6.dylib 0x000000013cc1557c Tk_InitOptions + 372
12 libtk8.6.dylib 0x000000013cc15460 Tk_InitOptions + 88
13 libtk8.6.dylib 0x000000013cc419a8 CreateFrame + 1472
14 libtk8.6.dylib 0x000000013cc41ca8 TkListCreateFrame + 156
15 libtk8.6.dylib 0x000000013cc3a690 Initialize + 1856
16 _tkinter.cpython-312-darwin.so 0x000000011ca26390 Tcl_AppInit + 92
17 _tkinter.cpython-312-darwin.so 0x000000011ca2138c Tkapp_New + 548
18 _tkinter.cpython-312-darwin.so 0x000000011ca21164 _tkinter_create_impl + 268
19 _tkinter.cpython-312-darwin.so 0x000000011ca20c3c _tkinter_create + 236
20 Python 0x0000000105d1d820 _PyEval_EvalFrameDefault + 50696
21 Python 0x0000000105bd70fc _PyObject_FastCallDictTstate + 96
22 Python 0x0000000105c742c8 slot_tp_init + 208
23 Python 0x0000000105c6914c type_call + 148
24 Python 0x0000000105bd7378 _PyObject_MakeTpCall + 128
25 Python 0x0000000105d1ca40 _PyEval_EvalFrameDefault + 47144
26 Python 0x0000000105d10f00 PyEval_EvalCode + 304
27 Python 0x0000000105d91448 run_mod + 176
28 Python 0x0000000105d904d8 pyrun_file + 148
29 Python 0x0000000105d8f43c _PyRun_SimpleFileObject + 304
30 Python 0x0000000105d8f0ac _PyRun_AnyFileObject + 248
31 Python 0x0000000105dbd330 pymain_run_file_obj + 220
32 Python 0x0000000105dbd070 pymain_run_file + 72
33 Python 0x0000000105dbc9a8 Py_RunMain + 1464
34 Python 0x0000000105dbcb48 pymain_main + 36
35 Python 0x0000000105dbcbc0 Py_BytesMain + 40
36 dyld 0x0000000189ac50e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException


Watcha Makin?

If you care to share something about your project, it would be awesome to hear what you're building.

Ngôn ngữ chính
Python
Star
13.8k
Fork
1.8k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 PySimpleGUI/PySimpleGUI

Tất cả issue của PySimpleGUI/PySimpleGUI

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.