Modify ↓
Ticket #105 (closed defect: fixed)
Crash when exporter section has the wrong syntax (in mapping file)
| Reported by: | andihit | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.9.3 |
| Component: | Message Extraction | Version: | 0.9.2 |
| Keywords: | Cc: |
Description
When I write e.g.
jinja2 = jinja2.ext.babel_extract
instead of
jinja2 = jinja2.ext:babel_extract
(note the last colon)
babel crashes:
Traceback (most recent call last): File "C:\Python25\Scripts\pybabel-script.py", line 8, in <module> load_entry_point('Babel==0.9.2', 'console_scripts', 'pybabel')() File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\frontend.py", line 1078, in main return CommandLineInterface().run(sys.argv) File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\frontend.py", line 649, in run return getattr(self, cmdname)(args[1:]) File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\frontend.py", line 885, in extract for filename, lineno, message, comments in extracted: File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\extract.py", line 153, in extract_from_dir options=options): File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\extract.py", line 179, in extract_from_file return list(extract(method, fileobj, keywords, comment_tags, options)) File "c:\python25\lib\site-packages\Babel-0.9.2-py2.5.egg\babel\messages\extract.py", line 238, in extract if func is None: UnboundLocalError: local variable 'func' referenced before assignment
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

This was actually already fixed in [358]. I'll amend the fix by also allowing method specification in the form package.module.funcname, i.e. you can simply use a dot instead of the colon.