Modify

Opened 12 years ago

Closed 12 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

Description

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/api.py", line 378, in send_error
    'text/html')
  File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 738, in render_template
    template = self.load_template(filename, method=method)
  File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 704, in load_template
    self.templates = TemplateLoader(self.get_all_templates_dirs(),
  File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 439, in get_all_templates_dirs
    for provider in self.template_providers:
  File "/usr/lib/python2.6/dist-packages/trac/core.py", line 70, in extensions
    return filter(None, [component.compmgr[cls] for cls in extensions])
  File "/usr/lib/python2.6/dist-packages/trac/core.py", line 207, in __getitem__
    component = cls(self)
  File "/usr/lib/python2.6/dist-packages/trac/core.py", line 111, in maybe_init
    init(self)
  File "build/bdist.linux-x86_64/egg/customfieldadmin/admin.py", line 28, in __init__
    CustomFields(self.env)
  File "/usr/lib/python2.6/dist-packages/trac/core.py", line 111, in maybe_init
    init(self)
  File "build/bdist.linux-x86_64/egg/customfieldadmin/api.py", 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/pkg_resources.py", line 882, in resource_filename
    self, resource_name
  File "/home/ftideasmx/rootenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", 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/pkg_resources.py", 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 12 years ago.
The 'locale' directory may not always exist.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 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 12 years ago by osimons

The 'locale' directory may not always exist.

comment:2 Changed 12 years ago by Gustavo Rubio

Resolution: fixed
Status: newclosed

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

comment:3 Changed 12 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 12 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
Action
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.