Google Groups Home
Help | Sign in
cStringIO problem with new version of cherrypy
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Nicolas Évrard  
View profile
 More options Jul 4, 4:14 am
From: Nicolas Évrard <ni...@altern.org>
Date: Fri, 4 Jul 2008 10:14:04 +0200
Local: Fri, Jul 4 2008 4:14 am
Subject: cStringIO problem with new version of cherrypy
Hello,

Today I did a svn up (I'm now at revision 2012) to test my application
with the new and shiny cherrypy.

But when I try to contact the server I've got the following tracebacks
in the browser:

File "/home/nicoe/python/cherrypy/wsgiserver/__init__.py", line 983, in communicate
     req.parse_request()
File "/home/nicoe/python/cherrypy/wsgiserver/__init__.py", line 304, in parse_request
     self._parse_request()
File "/home/nicoe/python/cherrypy/wsgiserver/__init__.py", line 317, in _parse_request
     request_line = self.rfile.readline()
File "/home/nicoe/python/cherrypy/wsgiserver/__init__.py", line 212, in readline
     data = self.rfile.readline(256)
File "/home/nicoe/python/cherrypy/wsgiserver/__init__.py", line 823, in readline
     nl = data.find('\n', 0, size)
AttributeError: 'cStringIO.StringO' object has no attribute 'find'

Does anybody knows what can cause this bug ?

--
(°>  Nicolas Évrard
/ )  Liège - Belgique
^^


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sylvain Hellegouarch  
View profile
 More options Jul 4, 5:39 am
From: "Sylvain Hellegouarch" <s...@defuze.org>
Date: Fri, 4 Jul 2008 11:39:49 +0200 (CEST)
Local: Fri, Jul 4 2008 5:39 am
Subject: Re: [cherrypy-users] cStringIO problem with new version of cherrypy

You're using a new version of Python and they changed the way to buffer
the read input in socket._fileobject. At least up to Python 2.5.x they
were using a string. They moved to a StringIO object.

http://svn.python.org/view/python/trunk/Lib/socket.py?rev=63788&view=...

Look at the __init__() method of socket._fileobject.

The problem is that CherryPy inherits from socket._fileobject and
overwrites some of the methods like readline(). The subclass therefore
expects self._rbug to be a string, not a StringIO.

I don't know how Robert would like to handle that case (probably a huge if
on the Python version and have two distinct CP_fileobject classes.

For now your best bet is to downgrade your Python version to 2.5.2

- Sylvain

--
Sylvain Hellegouarch
http://www.defuze.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sylvain Hellegouarch  
View profile
 More options Jul 4, 5:47 am
From: "Sylvain Hellegouarch" <s...@defuze.org>
Date: Fri, 4 Jul 2008 11:47:13 +0200 (CEST)
Local: Fri, Jul 4 2008 5:47 am
Subject: Re: [cherrypy-users] Re: cStringIO problem with new version of cherrypy

> You're using a new version of Python and they changed the way to buffer
> the read input in socket._fileobject. At least up to Python 2.5.x they
> were using a string. They moved to a StringIO object.

> http://svn.python.org/view/python/trunk/Lib/socket.py?rev=63788&view=...

> Look at the __init__() method of socket._fileobject.

FYI the rational behind that change:
http://svn.python.org/view?rev=62627&view=rev

They might backport it to 2.5 too eventually.

--
Sylvain Hellegouarch
http://www.defuze.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicolas Évrard  
View profile
 More options Jul 4, 6:04 am
From: Nicolas Évrard <ni...@altern.org>
Date: Fri, 4 Jul 2008 12:04:33 +0200
Local: Fri, Jul 4 2008 6:04 am
Subject: Re: [cherrypy-users] Re: cStringIO problem with new version of cherrypy
* Sylvain Hellegouarch  [2008-07-04 11:39 +0200]:

Thank you Sylvain for this quick anwser, I will use python2.4 for my
tests.

--
(°>  Nicolas Évrard
/ )  Liège - Belgique
^^


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim Jones  
View profile
 More options Jul 6, 7:00 am
From: Jim Jones <jjimjjo...@googlemail.com>
Date: Sun, 06 Jul 2008 13:00:19 +0200
Local: Sun, Jul 6 2008 7:00 am
Subject: Re: [cherrypy-users] Re: cStringIO problem with new version of cherrypy

does this affect the just released CP 3.1.0?

-jim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Brewer  
View profile
 More options Jul 6, 10:49 am
From: "Robert Brewer" <fuman...@aminus.org>
Date: Sun, 6 Jul 2008 07:49:14 -0700
Local: Sun, Jul 6 2008 10:49 am
Subject: RE: [cherrypy-users] Re: cStringIO problem with new version of cherrypy

http://svn.python.org/view/python/trunk/Lib/socket.py?rev=63788&view=ma

Yes, it does. Do we have a ticket yet?

Robert Brewer
fuman...@aminus.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nusgnaf@gmail.com  
View profile
 More options Jul 8, 1:35 pm
From: "nusg...@gmail.com" <nusg...@gmail.com>
Date: Tue, 8 Jul 2008 10:35:08 -0700 (PDT)
Local: Tues, Jul 8 2008 1:35 pm
Subject: Re: cStringIO problem with new version of cherrypy
Hi, I find out CP_fileobject.{flush|read|readline} are mostly
identical to its superclass socket._fileobject.
I tried delete these 3 methods, and got a working cherrypy on Python
2.6b1+ (trunk:64757, Jul 6 2008, 23:16:51)
Later on, I rerun the testsuite
on python 2.5.1: all tests pass
on python 2.6: only 3 tests failed.
Unfortunately I couldn't tracking down python 2.6 related problems,
please see attached logs under ticket 837 for details.

On Jul 6, 10:49 pm, "Robert Brewer" <fuman...@aminus.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google