This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients culler, serhiy.storchaka, terry.reedy
Date 2017-05-13.06:02:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494655375.08.0.90281559941.issue30310@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-05-13 06:02:55terry.reedysetrecipients: + terry.reedy, culler, serhiy.storchaka
2017-05-13 06:02:55terry.reedysetmessageid: <1494655375.08.0.90281559941.issue30310@psf.upfronthosting.co.za>
2017-05-13 06:02:55terry.reedylinkissue30310 messages
2017-05-13 06:02:54terry.reedycreate