Frustrations with CherryPy

2 views
Skip to first unread message

samuraisam

unread,
Aug 2, 2006, 7:49:14 PM8/2/06
to TurboGears
CherryPy - Do people actually try to see if something works before
implementing it? Is it not complete? I have found two major, yet *easy*
to fix errors with CherryPy that will make certain features not work,
and I've only just begun using beyond what
average-joe-screencast-watcher uses.

For example (my most major gripe):

return serveFile([...])

Does not work like it should. When the file is unmodified (I know
there's a ticket for this...) it returns a list or something like that,
yet, still sets the headers for content disposition, content length,
all that jazz, so... what? Manually reset them before returning the
correct headers (304 Not Modified)?

Also, when it *does* work, if your filename contains spaces, it doesn't
send you a working file. Sure, if the downloader were to *know* what
file type they were getting, they could add the extension. This is
ridiculously easy to fix:

http://www.turbogears.org/docs/api/source/cherrypy.lib.cptools-module.html#262

Simply double-quote the filetype param of the Content-Disposition
header. I mean, seriously... Even the FileUploadTutorial doesn't
address this. If someone were to be trying Turbogears out and file
uploading/download were important to them... odds are they'll try
something with a space in. Oops, **** that, it doesn't work.

Sorry for the rant, but honestly, this is really frustrating.

-Sam

Jorge Godoy

unread,
Aug 2, 2006, 8:04:48 PM8/2/06
to turbo...@googlegroups.com
"samuraisam" <samur...@gmail.com> writes:

> address this. If someone were to be trying Turbogears out and file
> uploading/download were important to them... odds are they'll try
> something with a space in. Oops, **** that, it doesn't work.

Probably due to my Unix background, but I have no files on my system with
spaces in it. And no files with accented letters.

This is a common practice in Windows, though. (And even there I've seen lots
of programs that had problems with spaces and accented letters, so they should
also be avoided there...)

I would only test spaces if I remembered that but I'd probably be bitten by
such a problem when going to the user-test environment.

--
Jorge Godoy <jgo...@gmail.com>

fumanchu

unread,
Aug 3, 2006, 12:28:34 AM8/3/06
to TurboGears
Thanks for the bug reports. Odd that you're the first person to mention
either of these issues...

Although serveFile only sets Content-Type if the file has not been
modified, it probably shouldn't even do that. I've filed a ticket for
this:
http://www.cherrypy.org/ticket/544.

The "filename" parameter of a Content-Disposition header should always
be quoted whether it has spaces or not. Filed as:
http://www.cherrypy.org/ticket/545.


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

samuraisam

unread,
Aug 3, 2006, 1:06:58 PM8/3/06
to TurboGears
fumanchu -- Thank you for your quick response. I updated and it works
just as advertised now.

Thanks again,
Sam

Reply all
Reply to author
Forward
0 new messages