wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

Issue loading babel-jinja2 #56

Closed jplaverdure closed 9 years ago

jplaverdure commented 9 years ago

I'm having an issue loading the babel-jinja2 plugin:

%> pot-create -c lingua.cfg proteolims
Traceback (most recent call last):
  File "/u/jpl/virtenvs/proteolims/bin/pot-create", line 9, in <module>
    load_entry_point('lingua==3.9', 'console_scripts', 'pot-create')()
  File "build/bdist.linux-x86_64/egg/lingua/extract.py", line 262, in main
  File "build/bdist.linux-x86_64/egg/lingua/extractors/babel.py", line 42, in __call__
  File "build/bdist.linux-x86_64/egg/lingua/extractors/__init__.py", line 42, in check_c_format

  File "/u/jpl/virtenvs/proteolims/lib64/python2.6/re.py", line 186, in finditer
    return _compile(pattern, flags).finditer(string)
TypeError: expected string or buffer

If I remove the -c argument, lingua runs fine but does not visit the jinja2 files.. Any idea what the source of this problem might be ?

lingua.cfg:

[extensions]
.jinja2 = babel-jinja2

My extractors:

%> pot-create --list-extractors
babel-ignore      Pseudo extractor that does not actually extract anything, but simply
babel-javascript  Extract messages from JavaScript source code.
babel-jinja2      Babel extraction method for Jinja templates.
babel-mako        Extract messages from Mako templates.
babel-python      Extract messages from Python source code.
chameleon         Chameleon templates (defaults to Python expressions)
python            Python sources
xml               Chameleon templates (defaults to Python expressions)
zcml              Zope Configuration Markup Language (ZCML)
zope              Zope templates (defaults to TALES expressions)
wichert commented 9 years ago

What exact versions of lingua, Babel and jinja2 are you using?

jplaverdure commented 9 years ago

Sorry for the missing info: Babel 1.3 Jinja2 2.7.3 lingua 3.9

Also: Python 2.6.6

wichert commented 9 years ago

I can't reproduce this error. You can find my test in this gist.

The only difference I can see is that I use Python 2.7, but that should not matter as far as I can see.

jplaverdure commented 9 years ago

Hmmm, allright, i'll need to check what might be wrong with my virtual environment. You might as well close the issue.

JP

On Thu, 30 Apr 2015 at 15:39 Wichert Akkerman notifications@github.com wrote:

I can't reproduce this error. You can find my test in this gist https://gist.github.com/wichert/1dc8be3d81cbf27582f1.

The only difference I can see is that I use Python 2.7, but that should not matter as far as I can see.

— Reply to this email directly or view it on GitHub https://github.com/wichert/lingua/issues/56#issuecomment-97941163.