[New-bugs-announce] [issue44971] Named widget has NoneType after single line creation

Russell Crosser report at bugs.python.org
Sat Aug 21 10:55:34 EDT 2021


New submission from Russell Crosser <russell.crosser at gmail.com>:

Declaring a widget in the following form:
...
label2 = ttk.Label(root, text='Show2 Label').pack()
...
leaves the widget with a NoneType, and unable to be assigned to (for instance to assign new text). If giving a widget a name, I expect to use it later in the program.
This declaration works correctly:
...
label2 = ttk.Label(root, text='Show2 Label')
label2.pack()
...
Simple tkinter program attached. Only tested with 3.9.6 on Win 10.

----------
components: Tkinter
files: test_pack.py
messages: 400032
nosy: rcrosser
priority: normal
severity: normal
status: open
title: Named widget has NoneType after single line creation
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file50228/test_pack.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44971>
_______________________________________


More information about the New-bugs-announce mailing list