Terry J. Reedy added the comment:
Test needed.
import Tkinter as tk
import tkFont as tkf
root = tk.Tk()
font = tkf.Font(root, size=20, family=u"MS \u30b4\u30b7\u30c3\u30af")
reproduces the failure in Marc's example.
File "C:\Programs\Python27\lib\lib-tk\tkFont.py", line 74, in __init__
font = self._set(options)
File "C:\Programs\Python27\lib\lib-tk\tkFont.py", line 51, in _set
options.append(str(v))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-6:
ordinal not in range(128)
After patching my installed 2.7.13, the code runs without exception and font is
created, with the unrecognized family replaced by Ariel.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30310>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com