New submission from Martin Panter:

>>> import tkinter, tkinter.font
>>> tk = tkinter.Tk()
>>> tkinter.font.nametofont("TkHeadingFont").measure("string")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/proj/python/cpython/Lib/tkinter/font.py", line 154, in measure
    return self._root.tk.getint(self._call("font", "measure", self.name, *args))
AttributeError: 'Font' object has no attribute '_root'

This appears to be broken by revision cb80dd82d3da, Issue 23880, which included 
this change at the end of the measure() method:

-return int(self._call("font", "measure", self.name, *args))
+return self._root.tk.getint(self._call("font", "measure", self.name, *args))

The Font class does not have a “_root” attribute.

----------
components: Tkinter
messages: 245003
nosy: serhiy.storchaka, vadmium
priority: normal
severity: normal
stage: needs patch
status: open
title: tkinter.font.Font.measure() broken in 3.5
type: behavior
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24408>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to