Nevow accesses static resources by filename (as opposed to by an open stream), which causes problems for packaging tools such as py2app

Bug #1225488 reported by Zooko Wilcox-O'Hearn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nevow
New
Undecided
Unassigned

Bug Description

Nevow loads resources by invoking "resource_filename", e.g. http://bazaar.launchpad.net/~divmod-dev/divmod.org/trunk/annotate/head:/Nevow/formless/webform.py#L26 . Packaging tools like py2exe and py2app can easily provide named resources through the "resource_string" or "resource_stream" APIs (http://pythonhosted.org/distribute/pkg_resources.html#resourcemanager-api), but it is more complicated to provide a resource through the "resource_filename" API, and it typically results in failures like this:

  File "allmydata/__init__.pyc", line 265, in <module>
  File "allmydata/__init__.pyc", line 180, in get_package_versions_and_locations
  File "nevow/__init__.pyc", line 143, in <module>
  File "nevow/__init__.pyc", line 29, in load
  File "nevow/util.pyc", line 183, in _namedAnyWithBuiltinTranslation
  File "twisted/python/reflect.pyc", line 464, in namedAny
  File "twisted/python/reflect.pyc", line 400, in _importAndCheckStack
  File "formless/webform.pyc", line 26, in <module>
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 884, in resource_filename
  File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 1516, in get_resource_filename
NotImplementedError: resource_filename() only supported for .egg, not .zip

(Copied from this bug report: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/182#comment:34 .)

One way to fix this bug would be to change Nevow to never need filenames for static resources and instead to make do with streams for static resources.

affects: divmod.org → nevow
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.