Ticket #10053 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

KeyError: 'customfieldadmin/locale' on 0.11

Reported by: gustavo@42ideas.mx Assigned to: 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

t10053-no_locale_in_build-r11409.diff (0.9 kB) - added by osimons on 05/25/12 10:15:06.
The 'locale' directory may not always exist.

Change History

05/25/12 10:13:53 changed 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

05/25/12 10:15:06 changed by osimons

  • attachment t10053-no_locale_in_build-r11409.diff added.

The 'locale' directory may not always exist.

05/26/12 06:25:58 changed by grubio

  • status changed from new to closed.
  • resolution set to fixed.

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

05/26/12 11:13:29 changed by osimons

  • status changed from closed to reopened.
  • resolution deleted.

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.

05/26/12 11:17:58 changed by osimons

  • status changed from reopened to closed.
  • resolution set to fixed.

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


Add/Change #10053 (KeyError: 'customfieldadmin/locale' on 0.11)




Change Properties
Action