Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
Crash report
What happened?
I am still learning python and then found out that this gives me a segmentation fault.
To reproduce, it should be enough to just run the python file. I commented what line leads to the segmentation fault.
I'm on an Ubuntu vm, used python 3.10, upgraded to 3.12 after I encountered the segfault.
tkinter version is 8.6
I attached the python file and the core dump, as well as the error file thing that Ubuntu creates instead of core dumps
I dont think I can be of much help with additional information, I know nothing.
importtkinterroot=tkinter.Tk()# Create a Canvas widget inside a Frame to hold your scrollable contentcanvas=tkinter.Canvas(root)scrollbar=tkinter.Scrollbar(root,orient="vertical",command=canvas.yview)rootS=tkinter.Frame(canvas)rootS.bind("<Configure>",lambdae:canvas.configure(scrollregion=canvas.bbox("all") ))canvas.create_window((0,0),window=rootS,anchor="nw")canvas.configure(yscrollcommand=scrollbar.set)# Pack the scrollbar and canvasscrollbar.pack(side="right",fill="y")canvas.pack(side="left",fill="both",expand=True)defcenter_rootS(event):# Center the scrollable_frame within the canvasrootS.update_idletasks()canvas_width=canvas.winfo_width()canvas_height=canvas.winfo_height()scrollable_frame_width=rootS.winfo_reqwidth()scrollable_frame_height=rootS.winfo_reqheight()x_offset= (canvas_width-scrollable_frame_width)//2y_offset= (canvas_height-scrollable_frame_height)//2canvas.create_window((x_offset,y_offset),window=rootS,anchor="nw")# <---- this line creates a segfaultroot.bind("<Configure>",center_rootS)root.mainloop();
CPython versions tested on:
3.10, 3.12
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.12.4 (main, Jul 18 2024, 13:27:24) [GCC 11.4.0]