You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When setting logging level to trace, _write_message can crash with a UnicodeError
Expected behavior
Never hard crash while logging.
Probably there is some issue with picking up the codec, but logging binary strings with a catch Exception: something went wrong would be better than the current behaviour.
To Reproduce
Have a Korean version of windows 10 (which has the default cp949 codec) and a function call which returns a utf-8 string with special characters in a kv file.
Code and Logs and screenshots
kivy.lang.builder.BuilderException: Parser: File "C:\Users\sande\Desktop\katrain\katrain\popups.kv", line 56:
...
54:<I18NPopup>:
55: background_color: [*[c*255/66 for c in BACKGROUND_COLOR[:3]], 1]
>> 56: title: i18n._(self.title_key)
57: title_size: DESC_FONT_SIZE
58: title_font: self.font_name
...
UnicodeEncodeError: 'cp949' codec can't encode character '\xe8' in position 29: illegal multibyte sequence
File "C:\Users\sande\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 699, in _apply_rule
setattr(widget_set, key, value)
File "kivy\weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
File "kivy\properties.pyx", line 497, in kivy.properties.Property.__set__
File "kivy\properties.pyx", line 544, in kivy.properties.Property.set
File "kivy\properties.pyx", line 599, in kivy.properties.Property.dispatch
File "kivy\_event.pyx", line 1248, in kivy._event.EventObservers.dispatch
File "kivy\_event.pyx", line 1130, in kivy._event.EventObservers._dispatch
File "C:\Users\sande\Anaconda3\lib\site-packages\kivy\lang\builder.py", line 68, in call_fn
trace('Lang: call_fn => value=%r' % (e_value, ))
File "C:\Users\sande\Anaconda3\lib\logging\__init__.py", line 1449, in log
self._log(level, msg, args, **kwargs)
File "C:\Users\sande\Anaconda3\lib\logging\__init__.py", line 1519, in _log
self.handle(record)
File "C:\Users\sande\Anaconda3\lib\logging\__init__.py", line 1529, in handle
self.callHandlers(record)
File "C:\Users\sande\Anaconda3\lib\logging\__init__.py", line 1591, in callHandlers
hdlr.handle(record)
File "C:\Users\sande\Anaconda3\lib\logging\__init__.py", line 905, in handle
self.emit(record)
File "C:\Users\sande\Anaconda3\lib\site-packages\kivy\logger.py", line 263, in emit
self._write_message(message)
File "C:\Users\sande\Anaconda3\lib\site-packages\kivy\logger.py", line 234, in _write_message
stream.write(fs % msg)
The text was updated successfully, but these errors were encountered:
Software Versions
Describe the bug
When setting logging level to trace, _write_message can crash with a UnicodeError
Expected behavior
Never hard crash while logging.
Probably there is some issue with picking up the codec, but logging binary strings with a catch Exception: something went wrong would be better than the current behaviour.
To Reproduce
Have a Korean version of windows 10 (which has the default cp949 codec) and a function call which returns a utf-8 string with special characters in a kv file.
Code and Logs and screenshots
The text was updated successfully, but these errors were encountered: