Opened 8 years ago

Closed 8 years ago

#10053 closed defect (fixed)

KeyError: 'customfieldadmin/locale' on 0.11

Reported by: Gustavo Rubio Owned by: osimons
Priority: normal Component: CustomFieldAdminPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


I just compiled the egg manually and installed it copying the egg file to the plugins directory and then modifying the trac.ini, afterwards I get this message on my trac installation:

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/trac/web/", line 378, in send_error
  File "/usr/lib/python2.6/dist-packages/trac/web/", line 738, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.6/dist-packages/trac/web/", line 704, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/lib/python2.6/dist-packages/trac/web/", line 439, in get_all_templates_dirs
    for provider in self.template_providers:
  File "/usr/lib/python2.6/dist-packages/trac/", line 70, in extensions
    return filter(None, [component.compmgr[cls] for cls in extensions])
  File "/usr/lib/python2.6/dist-packages/trac/", line 207, in __getitem__
    component = cls(self)
  File "/usr/lib/python2.6/dist-packages/trac/", line 111, in maybe_init
  File "build/bdist.linux-x86_64/egg/customfieldadmin/", line 28, in __init__
  File "/usr/lib/python2.6/dist-packages/trac/", line 111, in maybe_init
  File "build/bdist.linux-x86_64/egg/customfieldadmin/", line 59, in __init__
    locale_dir = resource_filename(__name__, 'locale')
  File "/home/ftideasmx/rootenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/", line 882, in resource_filename
    self, resource_name
  File "/home/ftideasmx/rootenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/", line 1352, in get_resource_filename
    return self._extract_resource(manager, zip_path)
  File "/home/ftideasmx/rootenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/", line 1363, in _extract_resource
    zip_stat = self.zipinfo[zip_path]
KeyError: 'customfieldadmin/locale'

I'm pretty sure it has to do with the locale folder not being found inside the egg because if I take a look at the egg contents I cannot see the "locale" folder, not sure if it has to be there and was not copied/built.

Maybe I'm missing some dependency?... I'm running trac 0.11.7 on FastCGI...

Attachments (1)

t10053-no_locale_in_build-r11409.diff (889 bytes) - added by osimons 8 years ago.
The 'locale' directory may not always exist.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by osimons

No Babel, no 'locale' directory. Which is usually fine, except for the one reference I see where I don't properly account for the fact that it may not always be found.

Could you try the attached patch, please? Using the same setup that you already have (ie. no Babel).

See attachment:t10053-no_locale_in_build-r11409.diff

Changed 8 years ago by osimons

The 'locale' directory may not always exist.

comment:2 Changed 8 years ago by Gustavo Rubio

Resolution: fixed
Status: newclosed

Applied the patch, it is working now. Thanks for your quick response!

comment:3 Changed 8 years ago by osimons

Resolution: fixed
Status: closedreopened

Thanks for testing, but the issue isn't really closed until the patch is actually applied to the source... Hang on, I'll commit it.

comment:4 Changed 8 years ago by osimons

Resolution: fixed
Status: reopenedclosed

(In [11597]) CustomFieldAdminPlugin: The 'locale' directory may not exist in all installations, so need more careful access. Fixes #10053.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.