Cherrypy is a convoluted mess of a hack.

3 views
Skip to first unread message

lingwitt

unread,
Feb 27, 2007, 10:07:33 PM2/27/07
to cherrypy-devel
That's my opinion.

Sylvain Hellegouarch

unread,
Feb 27, 2007, 10:16:30 PM2/27/07
to cherryp...@googlegroups.com
lingwitt wrote:
> That's my opinion.

I'm happy you've shared also the argumentation going with the subject of
your email.

And just because I'm in a good mood, here is a link that you'll
certainly enjoy: http://wiki.python.org/moin/WebFrameworks

- Sylvain

ling...@gmail.com

unread,
Feb 28, 2007, 4:00:07 AM2/28/07
to cherryp...@googlegroups.com
Thank you kindly.

I really like the CherryPy interface, but before I finished trying to find my
way around the innards, I had my shirt on inside-out!

After looking at the list, and a few other implementations in detail,
I've decided that CherryPy is the best for me anyway; it doesn't try
too hard and it leaves little to want.

I think the next revision should concentrate mostly on code cleanup.


I will take this opportunity to point people to the following one-sided discussion,
where interesting things have come up (namely, it seems to be a Mac OS X problem):

Robert Brewer

unread,
Feb 28, 2007, 11:23:42 AM2/28/07
to cherryp...@googlegroups.com
ling...@gmail.com wrote:
> I really like the CherryPy interface, but before
> I finished trying to find my way around the innards,
> I had my shirt on inside-out!

I take that as high praise. It means we've successfully taken a very
complex domain and provided an interface you are able to like. The
competition between specs, implementations, and users never ends. ;)

I'm sorry I haven't been able to address your issue yet. We are a small
team of 3, and 2 of us were at PyCon all weekend.

It looks to me like you're hitting the same problem as
http://www.cherrypy.org/ticket/598. If you find this is true, I'd
appreciate it if you can add any new information to it. I don't have
access to a Mac, so I naturally find it difficult to solve.


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

M. David Peterson

unread,
Feb 28, 2007, 12:09:34 PM2/28/07
to cherryp...@googlegroups.com
On 2/28/07, Robert Brewer <fuma...@amor.org> wrote:

I don't have
access to a Mac, so I naturally find it difficult to solve.

I do, and would be happy to help work through the issue.  Sylvain: Could you guide me? 

--
/M:D

M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155

ling...@gmail.com

unread,
Feb 28, 2007, 12:43:45 PM2/28/07
to cherryp...@googlegroups.com
On 28 Feb 2007, at 11:23:42 AM, Robert Brewer wrote:
I'm sorry I haven't been able to address your issue yet. We are a small
team of 3, and 2 of us were at PyCon all weekend.

PyCon, ah.

It looks to me like you're hitting the same problem as
http://www.cherrypy.org/ticket/598. If you find this is true, I'd
appreciate it if you can add any new information to it. I don't have
access to a Mac, so I naturally find it difficult to solve.

Thanks for the heads up (though, I wish I had seen that earlier).
That is exactly my problem.

I too tried to solve the problem by buffering the data, as the author
of the ticket tried; the difference is that I buffered with a bunch of
calls to sendall rather than send.

So perhaps the problem is with sendall.

I did read somewhere that sendall is incompatible with the idea
of nonblocking; maybe linux handles the mix better.

Also, I tried my app with web.py and it sends the data just fine
on Mac OS X by means of python lib's HTTPResponse (or some such).

On 28 Feb 2007, at 12:09:34 PM, M. David Peterson wrote:
On 2/28/07, Robert Brewer <fuma...@amor.org> wrote:

I don't have
access to a Mac, so I naturally find it difficult to solve.
I do, and would be happy to help work through the issue.  Sylvain: Could you guide me? 

Please have a look at http://www.cherrypy.org/ticket/598
and at The Devil's Number:

In particular, try this out:

devils_number = 66608

class HelloWorld(object):
    @cherrypy.expose
    def index(self):
        return 't' * devils_number 

which should work until you set this instead:

devils_number = 66609

Similarly, images of certain size don't work.

M. David Peterson

unread,
Feb 28, 2007, 1:09:14 PM2/28/07
to cherryp...@googlegroups.com
The results,

System Spec,

Python 2.4.4
Mac OSX 10.4.8
CherryPy SVN r1623

The Code,

import cherrypy

devils_number = 66609


class HelloWorld(object):
@cherrypy.expose
def index(self):
return 't' * devils_number

if __name__ == '__main__':
cherrypy.config.update({'server.socket_port': 8090})

cherrypy.quickstart (HelloWorld())

The Result,

Using,

"(This only happens when accessing the server from another computer)"

from the original thread @ http://groups.google.co.uk/group/cherrypy-devel/browse_thread/thread/fea3f6e2231a0812 < as my guide,

Accessing this instance from a different machine (Windows) via Opera with the following spec,

Version 9.20
Build 8713
Platform Win32
System Windows XP

I have been unable to repro the bug.  In other words, both values of 66608 and 66609 behave as is expected for proper operation.

Robert Brewer

unread,
Feb 28, 2007, 1:20:14 PM2/28/07
to cherryp...@googlegroups.com
Thanks! I wonder if it's specific to CP 2?


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


________________________________

M. David Peterson

unread,
Feb 28, 2007, 1:32:29 PM2/28/07
to cherryp...@googlegroups.com
Not sure, but would be happy to test as needed... Sylvain, can you handle the guidance with this again?  Will need to take place later today or tomorrow, but you and I are already in sync in this regard, so if you see an opportunity to run throug a quick test, please let me know...

On 2/28/07, Robert Brewer <fuma...@amor.org> wrote:
        cherrypy.config.update ({'server.socket_port': 8090})


        cherrypy.quickstart (HelloWorld())

        The Result,

        Using,

        "(This only happens when accessing the server from another
computer)"

        from the original thread @
http://groups.google.co.uk/group/cherrypy-devel/browse_thread/thread/fea
3f6e2231a0812 < as my guide,

        Accessing this instance from a different machine (Windows) via
Opera with the following spec,

        Version 9.20
        Build 8713
        Platform Win32
        System Windows XP

        I have been unable to repro the bug.  In other words, both
values of 66608 and 66609 behave as is expected for proper operation.



ling...@gmail.com

unread,
Feb 28, 2007, 1:33:42 PM2/28/07
to cherryp...@googlegroups.com

On 28 Feb 2007, at 1:09:14 PM, M. David Peterson wrote:
> Python 2.4.4
> Mac OSX 10.4.8
> CherryPy SVN r1623
>
> Accessing this instance from a different machine (Windows) via
> Opera with the following spec,
>
> Version 9.20
> Build 8713
> Platform Win32
> System Windows XP
>
> I have been unable to repro the bug. In other words, both values
> of 66608 and 66609 behave as is expected for proper operation.

Well, you are right!

It seems to work with python 2.3 too (the default installation).

I believe the problem must lie with python 2.5, which I believe the
bug report may mention.

Try with python 2.5.

Thanks for your help!


ling...@gmail.com

unread,
Feb 28, 2007, 1:34:54 PM2/28/07
to cherryp...@googlegroups.com
On 28 Feb 2007, at 1:20:14 PM, Robert Brewer wrote:

Thanks! I wonder if it's specific to CP 2?


No, I'm using latest SVN as well.

Check out the response I just sent.

ling...@gmail.com

unread,
Mar 1, 2007, 6:25:40 AM3/1/07
to cherryp...@googlegroups.com
On 28 Feb 2007, at 1:32:29 PM, M. David Peterson wrote:

Not sure, but would be happy to test as needed... Sylvain, can you handle the guidance with this again?  Will need to take place later today or tomorrow, but you and I are already in sync in this regard, so if you see an opportunity to run throug a quick test, please let me know... 

I did more thorough testing, and these are my results.

on this system:

Mac OS X 10.4.8
Build 8L127
PowerBook G4


Python:

Python 2.6a from svn failed with 'Resource temporarily unailable'
Python 2.5 from svn failed with 'Resource temporarily unailable'
Python 2.4 from svn failed with 'Resource temporarily unailable'
python 2.3 couldn't really get python to install.

System default 2.3.5: works like a charm.


It must have been a fluke earlier, when I reported that 2.4.4 also worked
on my system (I didn't test it for more than one request).

Are you sure you had it working on 2.4.4?

I also tried installing python 2.4 and 2.5 from a binary distribution, but no improvement.

Sylvain Hellegouarch

unread,
Mar 1, 2007, 6:49:40 AM3/1/07
to cherryp...@googlegroups.com, cherryp...@googlegroups.com
It would be more interesting that you try directly with the socket module
without going through CherryPy and see if you could reproduce the problem.
If yes then it would be more appropriate to report the bug on the Python
list than here.

- Sylvain

ling...@gmail.com

unread,
Mar 1, 2007, 11:27:15 AM3/1/07
to cherryp...@googlegroups.com
On 1 Mar 2007, at 6:49:40 AM, Sylvain Hellegouarch wrote:


It would be more interesting that you try directly with the socket module

without going through CherryPy and see if you could reproduce the problem.

If yes then it would be more appropriate to report the bug on the Python

list than here.


I suppose so.

However, web.py doesn't have any problems.

I'll try sockets directly later.

ling...@gmail.com

unread,
Mar 1, 2007, 11:49:21 AM3/1/07
to cherryp...@googlegroups.com
Also, CherryPy seems to serve static pages (including images) just fine.

M. David Peterson

unread,
Mar 1, 2007, 4:22:24 PM3/1/07
to cherryp...@googlegroups.com
> Are you sure you had it working on 2.4.4?

Hmmm.. let me check: Yes.

lingwitt

unread,
Mar 1, 2007, 4:46:27 PM3/1/07
to cherrypy-devel
On Mar 1, 4:22 pm, "M. David Peterson" <xmlhac...@gmail.com> wrote:
> > Are you sure you had it working on 2.4.4?
>
> Hmmm.. let me check: Yes.

Yikes!

Please try it with Python 2.5.

If it works, then there is something wrong with my system (perhaps
some third-party socket library that is confusing things).

M. David Peterson

unread,
Mar 1, 2007, 4:54:12 PM3/1/07
to cherryp...@googlegroups.com
Sure, though it won't be until later tonight that I will be able to get to it.  Will update this thread accordingly.

ling...@gmail.com

unread,
Mar 6, 2007, 6:21:47 PM3/6/07
to cherryp...@googlegroups.com
On 1 Mar 2007, at 4:54:12 PM, M. David Peterson wrote:

On 3/1/07, lingwitt < ling...@gmail.com> wrote:

On Mar 1, 4:22 pm, "M. David Peterson" < xmlhac...@gmail.com> wrote:
> > Are you sure you had it working on 2.4.4?
>
> Hmmm.. let me check: Yes.

Yikes!

Please try it with Python 2.5.

If it works, then there is something wrong with my system (perhaps
some third-party socket library that is confusing things).
Sure, though it won't be until later tonight that I will be able to get to it.  Will update this thread accordingly.

Hey again,

Have you had a chance to try anything out?

Thanks for your interest.


PS
I'm wondering if perhaps you emailed me personally and it got lost in a filter.
To keep something like that from happening, I've sent this email through the list.
Reply all
Reply to author
Forward
0 new messages