[issue26673] Tkinter error when opening IDLE configuration menu

Petr Viktorin report at bugs.python.org
Mon Apr 11 05:56:33 EDT 2016


Petr Viktorin added the comment:

I can reproduce this with Python 2.7.11 and somewhat recent build from hg default (3.6.0a0) on Fedora 23.
Putting these lines in my personal config-main.cfg solves this::

    [EditorWindow]
    font= courier

idlelib/config-main.def has a different default::

    [EditorWindow]
    font= TkFixedFont

Putting that value in my personal config-main.cfg makes the bug manifest itself again.
With "nonexistent-font-name-7202125ed0a", the bug does not appear.
With an existing font, "DejaVu Sans Mono", the bug does not appear.

I hacked the code to get the values used in the line, ``self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))``. For TkFixedFont (the buggy case), they are::

    self._w: '.139719100555208.139719021773312.139719021373632.139719021374064.139719021375144.13971902101484
0.139719021045736.139719021045880'
    cmd: 'configure'
    cnf: {'font': ('dejavu sans mono', '', 'normal')}
    _flatten((self._w, cmd)): ('.139719100555208.139719021773312.139719021373632.139719021374064.139719021375144.1397190210148
40.139719021045736.139719021045880', 'configure')
    self._options(cnf): ('-font', u'{dejavu sans mono} {} normal')

For the good case ("courier" font):

    self._w:'.140181531287496.140181452501216.140181451999568.140181451999712.140181452055904.140181451660176.140181451660464',
    cmd: 'configure'
    cnf: {'font': ('courier', '10', 'normal')}
    _flatten((self._w, cmd)): ('.140181531287496.140181452501216.140181451999568.140181451999712.140181452055904.140181451660176.140181451660464', 'configure')
    self._options(cnf):  ('-font', u'courier 10 normal')

The difference is indeed that it's getting an empty string for the font size.
This happens even if "font-size= 10" is explicitly in the config file.

At this point I'm not sure how to investigate further. Could someone more familiar with Tk look at the issue? I'll be happy to provide more information. (Hopefully bugs.python.org notifications reach my inbox.)

----------
nosy: +encukou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26673>
_______________________________________


More information about the Python-bugs-list mailing list