Bug #1113

Ошибка cl-update UnicodeEncodeError:'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)(calculate.update.update:633)

Added by Тимофей Захарчук 30 days ago. Updated 7 days ago.

Status:Resolved Start:01/19/2019
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Calculate Utilities Spent time: -
Target version:-
Votes: 0

Description

Вылезла такая ошибка

Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/calculate/core/server/func.py", line 718, in run
res = method(*args)
File "/usr/lib64/python2.7/site-packages/calculate/update/update.py", line 976, in emerge_ask
self.startEmerging(emerge)
File "/usr/lib64/python2.7/site-packages/calculate/update/update.py", line 899, in _startEmerging
emerge.run()
File "/usr/lib64/python2.7/site-packages/calculate/update/emerge_parser.py", line 722, in run
if element.action(child) is False:
File "/usr/lib64/python2.7/site-packages/calculate/update/emerge_parser.py", line 537, in action
self.notify(observer, groups)
File "/usr/lib64/python2.7/site-packages/calculate/update/emerge_parser.py", line 554, in notify
binary=bool(groups0))
File "/usr/lib64/python2.7/site-packages/calculate/update/update.py", line 633, in _printEmergePackage
("{part} {package}").format(part=part, package=name))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128) * UnicodeEncodeError:'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)(calculate.update.update:633)

РЕШЕНИЕ

Необходимо вставить вот такой код:

import sys
reload(sys);
sys.setdefaultencoding('utf8')

в начало файлов:
/usr/lib64/python2.7/site-packages/calculate/core/server/func.py
/usr/lib64/python2.7/site-packages/calculate/update/update.py
/usr/lib64/python2.7/site-packages/calculate/update/emerge_parser.py

Данной ошибке в питоне 2.7 сто лет в обед - а у нас она только что проявилась
ПРОСЬБА к РАЗРАБОТЧИКАМ - ПОПРАВИТЬ данные файлы

History

Updated by Mikhail Hiretsky 7 days ago

  • Status changed from New to Resolved

Исправлено в calculate-utils-3.6.3.2

Also available in: Atom PDF

Thank you!