Edgewall Software
Modify

Ticket #105 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

comment:1 Changed 4 years ago by cmlenz

  • Priority changed from major to minor
  • Status changed from new to assigned
  • Component changed from General to Message Extraction
  • Milestone changed from 1.0 to 0.9.3

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.

comment:2 Changed 4 years ago by cmlenz

  • Status changed from assigned to closed
  • Resolution set to fixed

Done in [365].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.