On Python 3.6 I get a warning when running the tests:
$ bin/test
/Users/maurits/tools/src/i18ndude/src/i18ndude/pygettext.py:159:
DeprecationWarning: the imp module is deprecated in favour of importlib;
see the module's documentation for alternative uses
import imp
/Users/maurits/tools/src/i18ndude/lib/python3.6/importlib/_bootstrap.py:219:
ImportWarning: can't resolve package from __spec__ or __package__,
falling back on __name__ and __path__
return f(*args, **kwds)
...
This is only during tests, not during normal handling.
Our pygettext.py is an old copy from a file that is now in the core Python source code. When I copy that version, we need two small fixes in our extract.py to call normalize with an extra encoding argument utf-8. Then the tests almost pass on Python 3. There is one failure:
So this fails with a message with a non-ascii default, which should not happen in English normally. So for most cases we could live with this.
But on Python2 it is broken. A few print statements are fixable, but we get an ImportError for import importlib.machinery. I haven't dived in, but I expect that on Python 2 you would have to use the imp module instead, which is what Python 3.6 was warning about all along.
So that seems something to pick up somewhere in 2020. :-)
On Python 3.6 I get a warning when running the tests:
This is only during tests, not during normal handling. Our pygettext.py is an old copy from a file that is now in the core Python source code. When I copy that version, we need two small fixes in our
extract.py
to callnormalize
with an extra encoding argumentutf-8
. Then the tests almost pass on Python 3. There is one failure:So this fails with a message with a non-ascii default, which should not happen in English normally. So for most cases we could live with this.
But on Python2 it is broken. A few print statements are fixable, but we get an
ImportError
forimport importlib.machinery
. I haven't dived in, but I expect that on Python 2 you would have to use theimp
module instead, which is what Python 3.6 was warning about all along.So that seems something to pick up somewhere in 2020. :-)