[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python3 port for Blends tasks pages [Was: Python 3 transition: please prepare your service and its dependencies]

Hi Ole,

On Sun, Nov 17, 2019 at 01:13:50PM +0100, Ole Streicher wrote:
> as far as I recall fro the old mails, it should work with Python 3.
> However we didn't switch since we didn't want to mix it with the move
> towards UDD.
> Could you just try to run the scripts manually and forward the
> errors/problems you got? IMO all the encoding problems were solved.

I had permanent encoding problems which never were solved (but I had
no need to care for a long time).

I fetched a new UDD clone and did

$ git diff
diff --git a/webtools/tasks.py b/webtools/tasks.py
index 6b4313e..55375a2 100755
--- a/webtools/tasks.py
+++ b/webtools/tasks.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import codecs
$ ./tasks.py debichem
Traceback (most recent call last):
  File "./tasks.py", line 54, in <module>
    for lang in languages)
  File "./tasks.py", line 54, in <genexpr>
    for lang in languages)
  File "/usr/lib/python3.7/gettext.py", line 548, in translation
    t = _translations.setdefault(key, class_(fp))
  File "/usr/lib/python3.7/gettext.py", line 260, in __init__
  File "/usr/lib/python3.7/gettext.py", line 421, in _parse
    catalog[str(msg, charset)] = str(tmsg, charset)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./tasks.py", line 57, in <module>
NameError: name 'logger' is not defined

Kind regards



Reply to: