Stuck in the tutorial - aspen can't find the handler "handy" :-(

4 views
Skip to first unread message

Jan Winkelmann

unread,
Jan 6, 2009, 9:17:08 AM1/6/09
to aspen-users
Hi everybody,

I have no idea why this doesn't work. I set up everything just like
said in the tutorial, but on starting aspen in this directory he fails
with error "ImportError: No module named handy.py [handlers.conf, line
3]". Here's the whole output: (listing 1)
$ aspen
launching child process
starting child server
Traceback (most recent call last):
File "/usr/local/bin/aspen", line 3, in <module>
aspen.main()
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
__init__.py", line 402, in main
start_server()
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
__init__.py", line 189, in start_server
server = server_factory() # factored out to ease testing
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
__init__.py", line 159, in server_factory
website = website_factory()
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
__init__.py", line 148, in website_factory
configuration.load_plugins() # user modules loaded here
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
load.py", line 182, in load_plugins
self.handlers = self.load_handlers()
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
load.py", line 327, in load_handlers
obj = colon.colonize(name, fpname, lineno)
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
colon.py", line 43, in colonize
exec 'import %s as obj' % modname
File "<string>", line 1, in <module>
ImportError: No module named handy.py [handlers.conf, line 3]

then he writes this (listing 2)

Exception in thread Thread-1 (most likely raised during interpreter
shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.5/threading.py", line 486, in
__bootstrap_inner
File "/usr/lib/python2.5/threading.py", line 446, in run
File "/usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
restarter.py", line 153, in _look_for_changes
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute
'modules'
starting child server

and starts at the "starting child server" part of fig. 1 and begins to
loop this.

===

I don't know if this helps but this simple Ctrl+L in vim didn't work
either, he just printed the python code and the HTML code on the
website. However he only starts the server if __/etc/handlers.conf
doesn't link to any handlers (i only tried it without one)

===

Here are some stats, I don't know if they help:

$ python --version
Python 2.5.2
--
$ uname -a
Linux keks-t43 2.6.25-gentoo-r7+keks-0.5 #9 SMP Sat Oct 18 03:06:37
CEST 2008 i686 Intel(R) Pentium(R) M processor 1.86GHz GenuineIntel
GNU/Linux
--
>>> import aspen
>>>

works fine.

===

If you need any more info, feel free to ask me!

Thanks in advance, Jan

Chad Whitacre

unread,
Jan 6, 2009, 2:30:43 PM1/6/09
to Jan Winkelmann, aspen-users
Jan,

> on starting aspen in this directory he fails with error
> "ImportError: No module named handy.py [handlers.conf, line 3]

Where is handy.py relative to "this directory?" It should be in
./__/lib/python.

If that's not the problem, what does your handlers.conf look like?


> then he writes this (listing 2)

This is unrelated and harmless. Sorry for the error spam.



chad

Jan Winkelmann

unread,
Jan 31, 2009, 11:56:13 AM1/31/09
to aspen-users
Sorry this took so long, I was busy with school and afterwards totally
forgot about it.

handy.py was in ./__/lib/python2.6. I renamed it to ./__/lib/python
and...aspen comes up - but 127.0.0.1:8080 looks like this:
--
Traceback (most recent call last):
File "//usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
wsgiserver.py", line 625, in communicate
req.respond()
File "//usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
wsgiserver.py", line 357, in respond
response = self.wsgi_app(self.environ, self.start_response)
File "//usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
website.py", line 67, in __call__
handler = self.get_handler(fspath)
File "//usr/lib/python2.5/site-packages/aspen-0.8-py2.5.egg/aspen/
website.py", line 134, in get_handler
raise HandlerError("No handler found.")
HandlerError
--
My ./__/etc/handlers.conf looks like this:
--
fnmatch aspen.rules:fnmatch

[handy:handle]
fnmatch *.asp
--
Any ideas?

Jan Winkelmann
Reply all
Reply to author
Forward
0 new messages