Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue27939

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Tkinter mainloop raises when setting the value of ttk.LabeledScale
Type:behaviorStage:resolved
Components:TkinterVersions:Python 3.7, Python 3.6, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: serhiy.storchakaNosy List: goyodiaz, python-dev, serhiy.storchaka
Priority:normalKeywords:patch

Created on2016-09-02 10:20 bygoyodiaz, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
tkinter_intvar_float_value.patchserhiy.storchaka,2016-10-24 14:13review
Pull Requests
URLStatusLinkedEdit
PR 552closeddstufft,2017-03-31 16:36
Messages (3)
msg274223 -(view)Author: Goyo (goyodiaz)Date: 2016-09-02 10:20
Calling mainloop after setting the value of a ttk.LabeledScale raises an error. The same happens if the value is set after entering the mainloop.Does not affect python 3.4.3. Does not affect ttk.Scale. No error is raised if you do not call mainloop.import tkinter as tkimport tkinter.ttk as ttkroot = tk.Tk()w = ttk.LabeledScale(root)w.pack()w.scale.set(1)root.mainloop()Traceback (most recent call last):  File "d:\users\u938001\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1550, in __call__    return self.func(*args)  File "d:\users\u938001\AppData\Local\Programs\Python\Python35-32\lib\tkinter\ttk.py", line 1540, in _adjust    newval = self._variable.get()  File "d:\users\u938001\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 355, in get    return self._tk.getint(self._tk.globalgetvar(self._name))TypeError: getint() argument must be str, not floatDuring handling of the above exception, another exception occurred:Traceback (most recent call last):  File "itcomp.py", line 8, in <module>    root.mainloop()  File "d:\users\u938001\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1131, in mainloop    self.tk.mainloop(n)  File "d:\users\u938001\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1554, in __call__    self.widget._report_exception()AttributeError: 'IntVar' object has no attribute '_report_exception'
msg279307 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-10-24 14:13
This is caused by replacing int() by self._tk.getint() in IntVar.get() (issue23880). But the failure can be reproduced even in 3.4 if set tk.wantobjects = 0 before creating root widget.One way is making getint() accepting floats. This fizes original example, but doesn't solve the issue for tk.wantobjects = 0.Other way is making IntVar.get() falling back to integer part of getdouble(). This fixes the example in both modes. Proposed patch goes this way.
msg279732 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-10-30 16:53
New changeset394b2b4da150 by Serhiy Storchaka in branch '3.5':Issue#27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale causedhttps://hg.python.org/cpython/rev/394b2b4da150New changeset91884d043fdc by Serhiy Storchaka in branch '3.6':Issue#27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale causedhttps://hg.python.org/cpython/rev/91884d043fdcNew changeset9e3931aa1ff0 by Serhiy Storchaka in branch 'default':Issue#27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale causedhttps://hg.python.org/cpython/rev/9e3931aa1ff0
History
DateUserActionArgs
2022-04-11 14:58:35adminsetgithub: 72126
2017-03-31 16:36:26dstufftsetpull_requests: +pull_request1005
2016-10-30 16:53:56serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-10-30 16:53:28python-devsetnosy: +python-dev
messages: +msg279732
2016-10-24 14:13:45serhiy.storchakasetfiles: +tkinter_intvar_float_value.patch
versions: + Python 3.7
messages: +msg279307

assignee:serhiy.storchaka
keywords: +patch
stage: needs patch -> patch review
2016-09-03 01:06:31terry.reedysetnosy: +serhiy.storchaka
stage: needs patch
type: crash -> behavior

versions: + Python 3.6
2016-09-02 10:20:34goyodiazcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp