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.

classification
Title: UnicodeDecodeError when invoke method configure() of Menu instance
Type: resource usage Stage: resolved
Components: Tkinter Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: sbellct, serhiy.storchaka
Priority: normal Keywords:

Created on 2018-08-30 15:55 by sbellct, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg324389 - (view) Author: Tao Chen (sbellct) Date: 2018-08-30 15:55
[Brief Description]
Python 3.7.0 IDLE. After create one Menu instance, and invoke it's config() or configure() method without any parameter, python print UnicodeDecodeError.


[Walk around]
menubar = Menu(root)
menubar.config(font=('Arial'))



[LOG]
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from tkinter import *
>>> root = Tk()
>>> menubar = Menu(root)
>>> menubar.config()
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    menubar.config()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 2: invalid continuation byte


>>> menubar.cget('font')
Traceback (most recent call last):
  File "<pyshell#15>", line 1, in <module>
    menubar.cget('font')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 2: invalid continuation byte

>>> platform.uname()
uname_result(system='Windows', node='xxx', release='7', version='6.1.7601', machine='AMD64', processor='Intel64 Family 6 Model 78 Stepping 3, GenuineIntel')
msg383502 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-12-21 09:40
There should no be any UnicodeDecodeError now. Tkinter on Windows uses now the UTF-16 encoding with the surrogatepass error handler which should never fail.

Could you please confirm that the issue is gone?
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78731
2021-07-09 20:28:46serhiy.storchakasetstatus: pending -> closed
resolution: out of date
stage: resolved
2020-12-21 09:40:32serhiy.storchakasetstatus: open -> pending

messages: + msg383502
2018-08-30 17:17:20serhiy.storchakasetnosy: + serhiy.storchaka
2018-08-30 15:55:48sbellctcreate