Fwd: cherrypy 2.0.0

4 views
Skip to first unread message

s|s

unread,
Nov 22, 2006, 10:53:12 AM11/22/06
to cherryp...@googlegroups.com
---------- Forwarded message ----------
From: s|s <supree...@gmail.com>
Date: Nov 22, 2006 8:48 PM
Subject: cherrypy 2.0.0
To: jytho...@lists.sourceforge.net


I have been trying to use jpython. My work mostly involves web and
hence I am trying to run django on jpython.

As a stepping stone, I have gotten cherrypy 2.0.0 to work on jpython.

As an example

[ss@localhost tutorial]$ java -jar
~/dev/jython/trunk/jython/dist/jython.jar 05_derived_objects.py
2006/11/22 20:34:07 CONFIG INFO Reading infos from configFile: tutorial.conf
2006/11/22 20:34:07 CONFIG INFO Server parameters:
2006/11/22 20:34:07 CONFIG INFO logToScreen: 1
2006/11/22 20:34:07 CONFIG INFO logFile:
2006/11/22 20:34:07 CONFIG INFO protocolVersion: HTTP/1.0
2006/11/22 20:34:07 CONFIG INFO socketHost:
2006/11/22 20:34:07 CONFIG INFO socketPort: 8080
2006/11/22 20:34:07 CONFIG INFO socketFile:
2006/11/22 20:34:07 CONFIG INFO reverseDNS: 0
2006/11/22 20:34:07 CONFIG INFO socketQueueSize: 5
2006/11/22 20:34:07 CONFIG INFO threadPool: 10
2006/11/22 20:34:07 CONFIG INFO sslKeyFile:
2006/11/22 20:34:07 CONFIG INFO sessionStorageType: ram
2006/11/22 20:34:07 CONFIG INFO sessionTimeout: 60 min
2006/11/22 20:34:07 CONFIG INFO cleanUpDelay: 60 min
2006/11/22 20:34:07 CONFIG INFO sessionCookieName: CherryPySession
2006/11/22 20:34:07 CONFIG INFO sessionStorageFileDir:
2006/11/22 20:34:07 CONFIG INFO staticContent: []
2006/11/22 20:34:07 HTTP INFO Serving HTTP on socket: ('', 8080)
2006/11/22 20:34:12 HTTP INFO localhost.localdomain - GET / HTTP/1.1


For this stuff to work, need to patch distutils. I modified distutils
from python 2.4. It works with some changes.

cherrypy 2.0.0 mostly required "from __future__ import generators".

Also I would like to know why this error occurs

('_local__key', 'thread.local.2') {}
Traceback (innermost last):
File "05_derived_objects.py", line 75, in ?
File "/home/ss/dev/jython/trunk/jython/dist/Lib/cherrypy/_cpserver.py",
line 74, in start
File "/home/ss/dev/jython/trunk/jython/dist/Lib/cherrypy/_cpthreadinglocal.py",
line 158, in __new__
TypeError: keys in namespace must be strings

regards

Supreet

Robert Brewer

unread,
Nov 22, 2006, 12:02:40 PM11/22/06
to cherryp...@googlegroups.com
s|s wrote:
> I have been trying to use jpython. My work mostly
> involves web and hence I am trying to run django on jpython.
> As a stepping stone, I have gotten cherrypy 2.0.0
> to work on jpython.
> cherrypy 2.0.0 mostly required "from __future__
> import generators".
> Also I would like to know why this error occurs
>
> ('_local__key', 'thread.local.2') {}
> Traceback (innermost last):
> File "05_derived_objects.py", line 75, in ?
> File "/home/ss/dev/jython/trunk/jython/dist/
> Lib/cherrypy/_cpserver.py",
> line 74, in start
> File "/home/ss/dev/jython/trunk/jython/dist/
> Lib/cherrypy/_cpthreadinglocal.py",
> line 158, in __new__
> TypeError: keys in namespace must be strings

This looks like a bug in the _cpthreadinglocal module (which was copied straight from the Python Lib, so it's probably a bug there, too). Try changing _cpthreadinglocal line 145 from:

key = '_local__key', 'thread.local.' + str(id(self))

to:

key = 'thread.local.' + str(id(self))


That seems to work for me under CPython. Let me know if it works for you with Jython, and we'll patch our code and tell the Python devs about it.


Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org

winmail.dat
Reply all
Reply to author
Forward
0 new messages