ptahproject/ptah — Issue #58: Capital Letters in Distribution Name Results in ImportError
Author: jayd3e
Created: 2011-11-07 00:25:02+00:00
State: open

To reproduce this error, follow the install process in the README up until generating the scaffold and then issue the following command:
paster create -t ptah101 DemoApp

Continue with the rest of the instructions and then attempt to serve the application. The exception is thrown b/c the list of packages in ptah.config.api that is retrieved from list_packages() looks like this ['ptah', 'demoapp', 'DemoApp']. This is due to the load_packages() in ptah.config.apo function adding both the distribution name and the module name, don't really know why it does this. I think load_packages() or perhaps even list_packages() should instead iterate over the result of iter_entry_points('ptah') (http://packages.python.org/distribute/pkg_resources.html#convenience-api), but I wasn't confident in this enough to commit any changes.

(jayd3e_ptah)jayd3e@SniperWolf:~/Projects/jayd3e_ptah/DemoApp$ paster serve settings.ini
File "/home/jayd3e/Projects/jayd3e_ptah/DemoApp/demoapp/__init__.py", line 42, in main
ptah.config.initialize(None, excludes, config.registry)
File "/home/jayd3e/Projects/jayd3e_ptah/ptah/ptah/config/api.py", line 99, in initialize
actions.extend(directives.scan(pkg, seen, exclude_filter))
File "/home/jayd3e/Projects/jayd3e_ptah/ptah/ptah/config/directives.py", line 263, in scan
\__import\__(package)
ImportError: No module named DemoApp