Bug 36677 - Падает в локали ru_RU.utf8
Summary: Падает в локали ru_RU.utf8
Status: ASSIGNED
Alias: None
Product: Sisyphus
Classification: Development
Component: hplip-gui (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Andrey Cherepanov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-24 14:25 MSK by Ivan A. Melnikov
Modified: 2021-02-19 10:30 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2019-04-24 14:25:56 MSK
Сизиф, x86_64, hplip-gui-3.19.3-alt1.noarch

Ошибка первая: при запуске hp-info окно показывается и сразу закрывается, даже не доотрисовавшись:

$ LANG=ru_RU.ut8 hp-info

HP Linux Imaging and Printing System (ver. 3.19.3)
Device Information Utility ver. 5.2

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


(process:28803): Gtk-WARNING **: 15:18:58.357: Locale not supported by C library.
        Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/usr/share/hplip/ui5/infodialog.py", line 293, in DeviceUriComboBox_currentChanged
    self.updateInfoTable()
  File "/usr/share/hplip/ui5/infodialog.py", line 198, in updateInfoTable
    i = QTableWidgetItem(str(t))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Aborted (core dumped)



Похожая ошибка обнаружена в hp-toolbox: в окне "HP Device Manager", при выборе вкладки "Status", окно закрывается, при этом в консоли:

\Traceback (most recent call last):
  File "/usr/share/hplip/ui5/devmgr5.py", line 567, in Tabs_currentChanged
    self.TabIndex[tab]()
  File "/usr/share/hplip/ui5/devmgr5.py", line 1313, in updateStatusTab
    self.updateStatusTable()
  File "/usr/share/hplip/ui5/devmgr5.py", line 1407, in updateStatusTable
    tt = str("%s %s"%(dt.toString(),desc))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Aborted (core dumped)
Comment 1 Ivan A. Melnikov 2019-04-24 14:28:33 MSK
В локали en_US.utf8 (или просто С) эти ошибки воспроизвести не удалось.

Изначально проблема замечена в sisyphus_mipsel, для той же версии пакета.
Comment 2 Vitaly Lipatov 2019-04-24 17:01:48 MSK
(В ответ на комментарий №0)
> Сизиф, x86_64, hplip-gui-3.19.3-alt1.noarch
> 
> Ошибка первая: при запуске hp-info окно показывается и сразу закрывается, даже
> не доотрисовавшись:
> 
> $ LANG=ru_RU.ut8 hp-info
тут неверно указано название кодировки (ut8 вместо utf8).
 
Видимо, поэтому
> (process:28803): Gtk-WARNING **: 15:18:58.357: Locale not supported by C
> library.
>         Using the fallback 'C' locale.

Ну и дальше python не будет читать что-то вне latin1, если у локали нет кодировки utf8:
>     i = QTableWidgetItem(str(t))
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1:
> ordinal not in range(128)
> Aborted (core dumped)
Comment 3 Ivan A. Melnikov 2019-04-24 17:09:54 MSK
> > $ LANG=ru_RU.ut8 hp-info
> тут неверно указано название кодировки (ut8 вместо utf8).

Да, простите, но проблема не в этом. С ru_RU.utf8 и ru_RU.UTF-8 падает также. Изначально проблема замечена на mipsel-ной машине с локалью, выставленной системно (не помню, кто это делает -- display manager?)

[18:03:45 ~/Downloads <130>]$ LANG=ru_RU.utf8 hp-toolbox

HP Linux Imaging and Printing System (ver. 3.19.3)
HP Device Manager ver. 15.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

\
HP Linux Imaging and Printing System (ver. 3.19.3)
System Tray Status Service ver. 2.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
error: Unable to find hp-upgrade --notify on PATH.
Traceback (most recent call last):
  File "/usr/share/hplip/ui5/devmgr5.py", line 567, in Tabs_currentChanged
    self.TabIndex[tab]()
  File "/usr/share/hplip/ui5/devmgr5.py", line 1313, in updateStatusTab
    self.updateStatusTable()
  File "/usr/share/hplip/ui5/devmgr5.py", line 1407, in updateStatusTable
    tt = str("%s %s"%(dt.toString(),desc))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Aborted (core dumped)


[18:06:39 ~/Downloads <134>]$ LANG=ru_RU.utf8 hp-info

HP Linux Imaging and Printing System (ver. 3.19.3)
Device Information Utility ver. 5.2

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Traceback (most recent call last):
  File "/usr/share/hplip/ui5/infodialog.py", line 293, in DeviceUriComboBox_currentChanged
    self.updateInfoTable()
  File "/usr/share/hplip/ui5/infodialog.py", line 198, in updateInfoTable
    i = QTableWidgetItem(str(t))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Aborted (core dumped)
Comment 4 Andrey Cherepanov 2021-02-19 10:30:19 MSK
Прошу проверить с версией >= 3.19.10 (в этой версии перешли на Python3). Я посмотрел на p9/x86_64 - не воспроизводится.