[LinuxCNC/linuxcnc PR#322] axis.py: Dont try to convert unicode to unicode

未分类 bolang 4个月前 (10-15) 24次浏览

Issue #322 | 状态: 已关闭 | 作者: jepler | 创建时间: 2017-09-03


I noticed when running in the ru_RU.UTF-8 locale that the message
File “/home/jepler/src/linuxcnc/bin/axis”, line 1419, in jogspeedlistboxchange
if i == unicode(value, ‘utf-8’):
TypeError: decoding Unicode is not supported
was displayed on the screen. Almost certainly, the incremental
jog combobox would not behave properly when this error occurs.

Instead of making an assumption that ‘i’ is Unicode and ‘value’
is ‘bytes’ (str), conditional reencode them based on their
runtime type.

Testing performed:
* Test with LANG=C.UTF-8 and LANG=ruRU.UTF8
* start axis, F1 F2
* select continuous or incremental jog via keyboard
* select continuous or incremental jog via mouse
* with each selection, jogged X axis with arrow keys
No regressions detected.


评论 (1)

#1 – jepler 于 2017-09-03

@SebKuzminsky OK for 2.7?


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/322

喜欢 (0)