On 23/07/06, Hari Sekhon <[EMAIL PROTECTED]> wrote:
I've got a very simple script with cherrypy but for some reason the cherrypy server is constantly tracing back but it stays up, kind of, the performance etc though shows that something is wrong.

import cherrypy
import threading

def someFunc():
    while 1:
        print "working"

threading._start_new_thread( someFunc , () )

class someClass():
    def index(self):
        test="this is a test"
        return test
    index.exposed=True

cherrypy.root=someClass()
cherrypy.config.update( file="cherrypyconfig.txt" )
cherrypy.server.start()


The tracebacks I get are:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 242, in run
    request.parse_request()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgiserver.py", line 134, in parse_request
    method,path,version = request_line.strip().split(" ", 2)
ValueError: need more than 1 value to unpack
2006/07/23 17:58:46  INFO Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpwsgi.py", line 110, in wsgiApp
    environ['wsgi.url_scheme'],
  File "/usr/lib/python2.4/site-packages/cherrypy/_cpserver.py", line 227, in request
    requestLine, headers, rfile, scheme)
  File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 181, in __init__
    self.parseFirstLine()
  File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 223, in parseFirstLine
    request.method, path, request.protocol = request.requestLine.split()
ValueError: too many values to unpack


I don't understand, all I've asked the stupid cherrypy thing to do is to print one line...


Ok, when the somefunc() that is executed by threading runs, it doesn't cause the tracing back I showed above, it occurs only when I use one of the other two functions I have in it's place in the script via threading. The thing is, those other two functions both use try excepts inside to make sure there are no exceptions generated beyond the internal function, and neither of those functions can touch anything to do with the class used as the index of the cherrypy document root.

What is going on?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to