CherryPy traceback on startup

0 views
Skip to first unread message

Graham Ashton

unread,
Dec 12, 2005, 12:05:25 PM12/12/05
to TurboGears
Hi. I'm trying to install TG on my Ubuntu (breezy) box. I followed the
instructions on the download page:

sudo python ez_setup.py -f
http://www.turbogears.org/download/index.html --script-dir
/usr/local/bin TurboGears

I then created a new project:

tg-admin fruitbat
cd fruitbat
python fruitbat-start.py

The server then starts up, but as soon as I access the URL I get a
traceback:

2005/12/12 11:58:22 HTTP INFO Serving HTTP on http://localhost:8080/
2005/12/12 11:58:25 INFO Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 285, in run
applyFilters('onEndResource')
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 641, in applyFilters
method()
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/lib/filter/sessionfilter.py",
line 205, in onEndResource
sess = cherrypy.request._session
NameError: global name 'cherrypy' is not defined

127.0.0.1 - - [2005/12/12 11:58:25] "GET / HTTP/1.1" 500 1236

I imagine there's something fishy going on with my install, given that
CherryPy 2.1.0 is deemed stable.

Is it a known issue?

Graham

Jared Kuolt

unread,
Dec 12, 2005, 12:07:22 PM12/12/05
to turbo...@googlegroups.com
Does it happen every time you start the project?


--
jared...@gmail.com

Graham Ashton

unread,
Dec 12, 2005, 12:12:19 PM12/12/05
to TurboGears
Yes, without fail. I get a similar traceback in the browser window
whenever I refresh the page too.

--
Graham

Sylvain Hellegouarch

unread,
Dec 12, 2005, 12:17:00 PM12/12/05
to turbo...@googlegroups.com
Hi there,

I think it's a bug from the session filter of CherryPy 2.1

try to add to the sessionfilter.py file on line 204:

global cherrypy
import cherrypy

Then try again.

- Sylvain

Selon Jared Kuolt <jared...@gmail.com>:


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Graham Ashton

unread,
Dec 12, 2005, 12:15:52 PM12/12/05
to TurboGears
Sylvain Hellegouarch wrote:
>
> try to add to the sessionfilter.py file on line 204:
>
> global cherrypy
> import cherrypy

Thanks for that.

I made the edit then restarted. This time it got a bit further, but
fell over a bit further on.

2005/12/12 12:10:07 INFO Traceback (most recent call last):


File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 285, in run
applyFilters('onEndResource')
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 641, in applyFilters
method()
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/lib/filter/sessionfilter.py",

line 207, in onEndResource
sess = cherrypy.request._session
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/__init__.py",
line 70, in __getattr__
return getattr(childobject, name)
AttributeError: _AttributeDump instance has no attribute '_session'

127.0.0.1 - - [2005/12/12 12:10:07] "GET / HTTP/1.1" 500 1406

--
Graham

Sylvain Hellegouarch

unread,
Dec 12, 2005, 12:24:10 PM12/12/05
to turbo...@googlegroups.com
Hmmm, would you mind adding as well:

if hasattr(cherrypy.request, '_session'):

before the "sess = cherrypy.request._session" line

This filter is known to have some issues that Remi is working on.

- Sylvain

Selon Graham Ashton <graham...@gmail.com>:

Graham Ashton

unread,
Dec 12, 2005, 12:52:30 PM12/12/05
to TurboGears
Sylvain Hellegouarch wrote:
> Hmmm, would you mind adding as well:
>
> if hasattr(cherrypy.request, '_session'):
>
> before the "sess = cherrypy.request._session" line

Yep, that got it past the sessionfilter.py problems. Then it stacked it
again, failing while loading cookies:

2005/12/12 12:46:27 INFO Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 263, in run
self.processRequestHeaders()
File
"/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py",
line 340, in processRequestHeaders
request.simpleCookie.load(value)
File "/usr/lib/python2.4/Cookie.py", line 621, in load
self.__ParseString(rawdata)
File "/usr/lib/python2.4/Cookie.py", line 652, in __ParseString
self.__set(K, rval, cval)
File "/usr/lib/python2.4/Cookie.py", line 574, in __set
M.set(key, real_value, coded_value)
File "/usr/lib/python2.4/Cookie.py", line 453, in set
raise CookieError("Illegal key value: %s" % key)
CookieError: Illegal key value: hide:inst2

> This filter is known to have some issues that Remi is working on.

Would you recommend that I downgrade? If so, is there any easy way to
do that with the setuptools?

Thanks again.

--
Graham

Sylvain Hellegouarch

unread,
Dec 12, 2005, 12:59:50 PM12/12/05
to turbo...@googlegroups.com

> Would you recommend that I downgrade? If so, is there any easy way to
> do that with the setuptools?

Downgrading, hell no :)
If you don't mind, I'd rather have you moving this thread to the CherryPy users
list so that Remi can handle it directly.

- Sylvain

Graham Ashton

unread,
Dec 12, 2005, 1:23:23 PM12/12/05
to TurboGears
Reply all
Reply to author
Forward
0 new messages