New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lingua 4.x breaks the Lingua extractor #255
Comments
Changes by Laurent DAVERIO (@ldaverio):
|
Wichert Akkerman (@wichert) wrote: This is my fault: I had not realised that a recent refactoring impacted the API used by plugins. Since this is likely to impact more plugins I think this should be addressed in lingua. |
Michael Bayer (@zzzeek) wrote:
→ f9faef9 |
Laurent DAVERIO (@ldaverio) wrote: FWIW, I've been using the patched version of Mako (with the change in |
Michael Bayer (@zzzeek) wrote: that's not fixing the failure I'm getting, which is:
this might be just local to the test but I don't have resources to debug this plugin myself. |
Wichert Akkerman (@wichert) wrote: I've pushed a change to lingua which allows passing bytes instances to the Python extractor again. @ldaverio can you please check if that fixes your problem? |
Laurent DAVERIO (@ldaverio) wrote: Hello Wichert, sorry for the late reply. I've just tested the 4 following combinations :
With Lingua 4.8, my patched Mako works for me, the other fails with:
With Lingua 4.9, both fail with a second error message (but the UnicodeWarning message happens only with regular Mako 1.0.4):
I can't investigate the problem right now, but I'll try to do it asap, possibly this weekend. |
Laurent DAVERIO (@ldaverio) wrote: Hello again, in addition to the Lingua 4.9 problem, which forced me to stay at 4.8.1, it now appears that setuptools >= 20.6.6 breaks "po-create" :( :( :( So, I have to pin setuptools==20.4...
|
Migrated issue, originally created by Laurent DAVERIO (@ldaverio)
When upgrading from Lingua 3.12 to Lingua 4.x, an attempt to extract strings from a Mako template fails with the following message:
File "/Users/xxxxxxx/pydev/lib/python3.5/tokenize.py", line 560, in _tokenize
if line[pos] in '#\r\n': # skip comments or blank lines
This message also appeared in issue #72 of the wichert/lingua repository on GitHub:
wichert/lingua#72
The problem seems to be that "tokenize requires unicode input". And in effect, it seems that I can get rid of the problem by changing line 35 of ext/linguaplugin.py from :
code = io.ByteIO(source)
to:
code = io.StringIO(str(source, encoding='utf-8'))
I'm not sure of all the implications yet, so I don't want to issue a pull request, but this fix seems to work for me.
The text was updated successfully, but these errors were encountered: