List Info

Thread: $180 reward for help in tackling the hardest problem in the universe.




$180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-25 20:55:25
Ok, well it's probably not as hard as Fermat...but...it is giving me an extreme case of gas. Basically, I will pay $100 to the first person who can tell me why this upload is failing. The money will be available through paypal. All I need is your email address. I am trying to upload a file from a flash app running in firefox on windows xp to a turbogears controller running on linux. The controller is never getting dispatched, as is apparent from the lack of output from my "print 'got here' " statement. I tried this print trick in another controller in same TG app just to be sure, and it did, in fact, work there. What I'm seeing is that cherrypy is trying to read the file and timing out. I added some print statements inside cherrypy in both read and readline in the httptools.py module. Then I tried posting a small file first with the flex application, then with a very simple html upload form. The results are as follows: ------------------------------------------------------------------------------------------------------------------------------------------------------------ Simple HTML post (this worked fine, my controller got dispatched from cherrypy which did not choke): ------------------------------------------------------------------------------------------------------------------------------------------------------------ 'POST /upload HTTP/1.1rn' 'Host: www01.videoonramp.com:8080rn' 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9rn' 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5rn' 'Accept-Language: en-us,en;q=0.5rn' 'Accept-Encoding: gzip,deflatern' 'Accept-Charset: UTF-8,*rn' 'Keep-Alive: 300rn' 'Connection: keep-alivern' 'Referer: http://www01.videoonramp.com:8080/testUploadrn' 'Cookie: tg-visit=a45746678ee38f1a27c12923cc260a190891f594rn' 'Content-Type: multipart/form-data; boundary=---------------------------187161971819895rn' 'Content-Length: 677rn' 'rn' '-----------------------------187161971819895rn' 'Content-Disposition: form-data; name="myFile"; filename=".project"rn' 'Content-Type: application/octet-streamrn' 'rn' 'rn' 'rn' 'tUploaderrn' 'trn' 'trn' 'trn' 'trn' 'ttrn' 'tttcom.adobe.flexbuilder.project.flexbuilderrn' 'tttrn' 'tttrn' 'ttrn' 'trn' 'trn' 'ttcom.adobe.flexbuilder.project.flexnaturern' 'ttcom.adobe.flexbuilder.project.actionscriptnaturern' 'trn' 'rn' 'rn' '-----------------------------187161971819895--rn' 2007-01-25 11:39:59,140 turbogears.identity INFO Identity is available... ***************** ***************** 74.192.146.128 - - "POST /upload HTTP/1.1" 200 152 "http://www01.videoonramp.com:8080/testUpload" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9" 2007-01-25 11:40:19,017 turbogears.identity.savisit INFO updating visit (a45746678ee38f1a27c12923cc260a190891f594) to expire at 2007-01-25 11:59:59.140276 ------------------------------------------------------------------------------------------------------------------------------------------------------------ Post same file from Flex app (this choked cherrypy as you will see below): ------------------------------------------------------------------------------------------------------------------------------------------------------------ 'POST /postFile HTTP/1.1rn' 'Accept: text/*rn' 'Content-Type: multipart/form-data; boundary=----------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6rn' 'User-Agent: Shockwave Flashrn' 'Host: www01.videoonramp.com:8080rn' 'Content-Length: 885rn' 'Connection: Keep-Alivern' 'Cache-Control: no-cachern' 'rn' '------------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6rn' 'Content-Disposition: form-data; name="Filename"rn' 'rn' '.projectrn' '------------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6rn' 'Content-Disposition: form-data; name="Filedata"; filename=".project"rn' 'Content-Type: application/octet-streamrn' 'rn' 'rn' 'rn' 'tUploaderrn' 'trn' 'trn' 'trn' 'trn' 'ttrn' 'tttcom.adobe.flexbuilder.project.flexbuilderrn' 'tttrn' 'tttrn' 'ttrn' 'trn' 'trn' 'ttcom.adobe.flexbuilder.project.flexnaturern' 'ttcom.adobe.flexbuilder.project.actionscriptnaturern' 'trn' 'rn' 'rn' '------------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6rn' 'Content-Disposition: form-data; name="Upload"rn' 'rn' 'Submit Queryrn' 2007-01-25 11:42:46,458 cherrypy.msg INFO HTTP: Traceback (most recent call last): File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 98, in _run self.processBody() File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 230, in processBody keep_blank_values=1) File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cpcgifs.py", line 8, in __init__ cgi.FieldStorage.__init__(self, *args, **kwds) File "/opt/python2.4.4/lib/python2.4/cgi.py", line 530, in __init__ self.read_multi(environ, keep_blank_values, strict_parsing) File "/opt/python2.4.4/lib/python2.4/cgi.py", line 655, in read_multi environ, keep_blank_values, strict_parsing) File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cpcgifs.py", line 8, in __init__ cgi.FieldStorage.__init__(self, *args, **kwds) File "/opt/python2.4.4/lib/python2.4/cgi.py", line 532, in __init__ self.read_single() File "/opt/python2.4.4/lib/python2.4/cgi.py", line 665, in read_single self.read_lines() File "/opt/python2.4.4/lib/python2.4/cgi.py", line 687, in read_lines self.read_lines_to_outerboundary() File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cpcgifs.py", line 31, in read_lines_to_outerboundary line = self.fp.readline(1<<16) File "/opt/python2.4.4/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/lib/httptools.py", line 502, in readline data = self.rfile.readline(size) File "/opt/python2.4.4/lib/python2.4/socket.py", line 359, in readline data = self._sock.recv(self._rbufsize) timeout: timed out Request Headers: Content-Length: 885 USER-AGENT: Shockwave Flash CONNECTION: Keep-Alive CONTENT-LENGTH: 885 HOST: www01.videoonramp.com:8080 CACHE-CONTROL: no-cache CONTENT-TYPE: multipart/form-data; boundary=----------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6 ACCEPT: text/* Remote-Addr: 74.192.146.128 Content-Type: multipart/form-data; boundary=----------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6 Remote-Host: 74.192.146.128 74.192.146.128 - - "POST /postFile HTTP/1.1" 500 2505 "" "Shockwave Flash" Any help towards fixing this will be greatly appreciated - and if you help me over the top (so my upload works) you get the money. One caveat: The payout value decreases with time (like a stock option in the market). It will decrease by $10 per hour until it hits a floor of $100. schedule: 21:00 - $180 ... midnite- $150 ... 4:00 - $110 5:00 - $100 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-usersgooglegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribegooglegroups.com For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en -~----------~----~----~----~------~----~------~--~---
Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-25 23:59:29
Jesse James wrote: > Subject: [cherrypy-users] $180 reward for help in > tackling the hardest problem in the universe. First, the repeated posts with no new information (other than a new bounty amount) are getting tedious. The people who know how to fix this aren't going to be motivated by the amount. I understand you want this fixed as soon as possible, but multiple carrot-and-stick attempts are making your case less desirable to work on, not more. > What I'm seeing is that cherrypy is trying to read the file > and timing out. Without seeing the data that's sent but not received, it's difficult to ascertain *exactly* what the problem is. However, I've run some tests with the POST body you provided and was able to reproduce the timeouts. In all cases, the timeout occurs because 1) the POST body doesn't follow the multipart MIME spec, and 2) when reading multipart bodies, Python's CGI module doesn't use the global Content-Length value to know when to stop--it just keeps reading until it sees the correct "closing boundary"; if that's malformed, it gets stuck in a "while 1:" loop until timeout. There are two ways to work around this behavior. One, you could expect the timeout, trap it, and get on with life. This will mean a few seconds extra time to finish receiving an upload, but shouldn't have any adverse affects on the actual received body. This can be done by changing cherrypy/_cpcgifs.py in the following manner: def read_lines_to_outerboundary(self): """Internal: read lines until outerboundary.""" next = "--" + self.outerboundary last = next + "--" delim = "" last_line_lfend = True import socket while 1: try: line = self.fp.readline(1<<16) except socket.timeout: self.done = -1 break if not line: self.done = -1 break if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break if strippedline == last: self.done = 1 break odelim = delim if line[-2:] == "rn": delim = "rn" line = line[:-2] last_line_lfend = True elif line[-1] == "n": delim = "n" line = line[:-1] last_line_lfend = True else: delim = "" last_line_lfend = False self.__write(odelim + line) Two, the Content-Length for the entire request (as provided by the Flex app) seems to be correct. So you could in theory read the entire body based on that Content-Length and stick it in a StringIO object or temporary file, and then hand that to the FieldStorage call (or just set request.rfile to it, which does the same thing). This could be done in a before_request_body filter. I would check the headers for ('User-Agent', 'Shockwave Flash'), a multipart Content-Type, and a valid (nonzero) Content-Length before executing such special-case code. And you would want to read it in chunks, to reduce Denial-of-Service attacks with huge files, and then, at the end of the whole read(), have a look at the received data and see exactly how it's malformed. A multipart message should end with a "closing boundary"; in your example, the last line should be: '------------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6--rn' I got timeouts whether I removed either or both of the last "--" or the "rn", so my guess is one of those is not present. Once you figure out exactly how it's malformed, you can add what's missing to your StringIO or temp file, and then it should work normally when you hand it off to FieldStorage inside _cphttptools.processBody. But again, you should only do this rewriting of the body if the appropriate headers exist. If you can figure out exactly how the data is malformed, we'd really appreciate a note so we can distribute an official fix. Robert Brewer System Architect Amor Ministries fumanchuamor.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-usersgooglegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribegooglegroups.com For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en -~----------~----~----~----~------~----~------~--~---
Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 01:50:34
Robert Brewer wrote: > Jesse James wrote: >> Subject: [cherrypy-users] $180 reward for help in >> tackling the hardest problem in the universe. > > First, the repeated posts with no new information (other than a new bounty amount) are getting tedious. The people who know how to fix this aren't going to be motivated by the amount. I understand you want this fixed as soon as possible, but multiple carrot-and-stick attempts are making your case less desirable to work on, not more. > I concur. I would actually like to stress if the notion that rewarding with cash does not entitle for pressuring either lists nor people around here. I'd appreciate if the tone could change. - Sylvain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-usersgooglegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribegooglegroups.com For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en -~----------~----~----~----~------~----~------~--~---
Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 20:57:51
ok.  I sent the same file twice, once with flex and once
with the
simple html form.
This time I printed out the contents of the wsgi.input in
the
before_request_body filter each time and here's what I
observed (with
my own ---start body---, ---end body--- marker included for
clarity):

SIMPLE HTML:
---------- start body ---------------
-----------------------------21718375316139
Content-Disposition: form-data;
name="file_handle";
filename="hello.txt"
Content-Type: text/plain

hello

world

each man is an island.

-----------------------------21718375316139--

---------- end body ---------------


FLEX:
---------- start body ---------------
------------ei4gL6ei4GI3GI3ei4ae0gL6ei4ae0
Content-Disposition: form-data; name="Filename"

hello.txt
------------ei4gL6ei4GI3GI3ei4ae0gL6ei4ae0
Content-Disposition: form-data; name="Filedata";
filename="hello.txt"
Content-Type: application/octet-stream

hello

world

each man is an island.

------------ei4gL6ei4GI3GI3ei4ae0gL6ei4ae0
Content-Disposition: form-data; name="Upload"

Submit Query
------------ei4gL6ei4GI3GI3ei4ae0gL6ei4ae0--
---------- end body ---------------

as you can see, flex is doing some strange things here.

I still have not figured out how to re-inject the stream
back into CP
correctly so the controller method is not getting properly
invoked. I
get this:
Traceback (most recent call last):
  File
"c:python24libsite-packagesCherryPy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:python24libsite-packagesCherryPy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 254, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 arguments (1 given)





On 25 Jan, 23:59, "Robert Brewer" <fuman...amor.org> wrote:
> Jesse James wrote:
> > Subject: [cherrypy-users] $180 reward for help in
> > tackling the hardest problem in the
universe.First, the repeated posts with no new information
(other than a new bounty amount) are getting tedious. The
people who know how to fix this aren't going to be motivated
by the amount. I understand you want this fixed as soon as
possible, but multiple carrot-and-stick attempts are making
your case less desirable to work on, not more.
>
> > What I'm seeing is that cherrypy is trying to read
the file
> > and timing out.Without seeing the data that's sent
but not received, it's difficult to ascertain *exactly* what
the problem is. However, I've run some tests with the POST
body you provided and was able to reproduce the timeouts. In
all cases, the timeout occurs because 1) the POST body
doesn't follow the multipart MIME spec, and 2) when reading
multipart bodies, Python's CGI module doesn't use the global
Content-Length value to know when to stop--it just keeps
reading until it sees the correct "closing
boundary"; if that's malformed, it gets stuck in a
"while 1:" loop until timeout. There are two ways
to work around this behavior.
>
> One, you could expect the timeout, trap it, and get on
with life. This will mean a few seconds extra time to finish
receiving an upload, but shouldn't have any adverse affects
on the actual received body. This can be done by changing
cherrypy/_cpcgifs.py in the following manner:
>
>     def read_lines_to_outerboundary(self):
>         """Internal: read lines until
outerboundary."""
>         next = "--" + self.outerboundary
>         last = next + "--"
>         delim = ""
>         last_line_lfend = True
>
>         import socket
>
>         while 1:
>
>             try:
>                 line = self.fp.readline(1<<16)
>             except socket.timeout:
>                 self.done = -1
>                 break
>
>             if not line:
>                 self.done = -1
>                 break
>             if line[:2] == "--" and
last_line_lfend:
>                 strippedline = line.strip()
>                 if strippedline == next:
>                     break
>                 if strippedline == last:
>                     self.done = 1
>                     break
>             odelim = delim
>             if line[-2:] == "rn":
>                 delim = "rn"
>                 line = line[:-2]
>                 last_line_lfend = True
>             elif line[-1] == "n":
>                 delim = "n"
>                 line = line[:-1]
>                 last_line_lfend = True
>             else:
>                 delim = ""
>                 last_line_lfend = False
>             self.__write(odelim + line)
>
> Two, the Content-Length for the entire request (as
provided by the Flex app) seems to be correct. So you could
in theory read the entire body based on that Content-Length
and stick it in a StringIO object or temporary file, and
then hand that to the FieldStorage call (or just set
request.rfile to it, which does the same thing). This could
be done in a before_request_body filter. I would check the
headers for ('User-Agent', 'Shockwave Flash'), a multipart
Content-Type, and a valid (nonzero) Content-Length before
executing such special-case code. And you would want to read
it in chunks, to reduce Denial-of-Service attacks with huge
files, and then, at the end of the whole read(), have a look
at the received data and see exactly how it's malformed. A
multipart message should end with a "closing
boundary"; in your example, the last line should be:
>
>     '------------KM7Ij5cH2KM7Ef1gL6ae0ae0cH2gL6--rn'
>
> I got timeouts whether I removed either or both of the
last "--" or the "rn", so my guess is
one of those is not present. Once you figure out exactly how
it's malformed, you can add what's missing to your StringIO
or temp file, and then it should work normally when you hand
it off to FieldStorage inside _cphttptools.processBody. But
again, you should only do this rewriting of the body if the
appropriate headers exist.
>
> If you can figure out exactly how the data is
malformed, we'd really appreciate a note so we can
distribute an official fix.
>
> Robert Brewer
> System Architect
> Amor Ministries
> fuman...amor.org
> 
>  winmail.dat
> 6KDownload


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 21:45:04
On Jan 26, 6:57 pm, "Jesse James"
<joel.re...gmail.com> wrote:
> as you can see, flex is doing some strange things
here.

Yes; it's omitting the last CRLF that most multipart-MIME
producers
include.

> I still have not figured out how to re-inject the
stream back into CP
> correctly so the controller method is not getting
properly invoked.
> TypeError: upload() takes at least 2 arguments (1
given)

That's a problem with the number of args in your page
handler function.
Your example needs to have a pgae handler signature like:

    def upload(Upload, Filename, Filedata):
        ....

I've opened a ticket and posted a working, tested patch for
this issue
[1]. Although it hasn't been approved for inclusion in the
distro yet
(and might never be because it's so rare), I suggest you try
it out.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org

[1] http://www.cherryp
y.org/ticket/648


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 22:16:26

> > I still have not figured out how to re-inject the
stream back into CP
> > correctly so the controller method is not getting
properly invoked.
> > TypeError: upload() takes at least 2 arguments (1
given)That's a problem with the number of args in your page
handler function.
> Your example needs to have a pgae handler signature
like:
>
>     def upload(Upload, Filename, Filedata):
>         ....

I don't understand the statement above. If the error says
that upload
takes 2 arguments (self and file_handle), and it is only
getting one (1
given) (and BTW, it works fine without the
before_request_body filter),
why would I need any additional args?
Seems like I was somehow messing up the request processing
with my
filter logic. BTW, if I commented out the line where I read
the
request.rfile in that filter, the request works.

I will test the patch and post again with the results.
Thanks for your help in this matter.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 22:36:21

> > I still have not figured out how to re-inject the
stream back into CP
> > correctly so the controller method is not getting
properly invoked.
> > TypeError: upload() takes at least 2 arguments (1
given)That's a problem with the number of args in your page
handler function.
> Your example needs to have a pgae handler signature
like:
>
>     def upload(Upload, Filename, Filedata):
>         ....

I don't understand the statement above. If the error says
that upload
takes 2 arguments (self and file_handle), and it is only
getting one (1
given) (and BTW, it works fine without the
before_request_body filter),
why would I need any additional args?
Seems like I was somehow messing up the request processing
with my
filter logic. BTW, if I commented out the line where I read
the
request.rfile in that filter, the request works.

I will test the patch and post again with the results.
Thanks for your help in this matter.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 22:59:17
Jesse James wrote:
> > > I still have not figured out how to re-inject
the stream
> > > back into CP correctly so the controller
method is not
> > > getting properly invoked.
> > > TypeError: upload() takes at least 2
arguments (1 given)
> > That's a problem with the number of args in your
page handler function.
> > Your example needs to have a page handler
signature like:
> >
> >     def upload(Upload, Filename, Filedata):
> >         ....
> 
> I don't understand the statement above. If the error
says
> that upload takes 2 arguments (self and file_handle),
> and it is only getting one (1 given) (and BTW, it
works
> fine without the before_request_body filter), why would
I
> need any additional args?

Those are the args I see with my patch, and which you would
see if the request included the trailing CRLF as expected.
You're right that your filter may change the expected
signature. Sorry for any confusion.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


  
Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-26 23:43:43
ok, I installed the patch, now I'm getting this:

got here 1
got here 3
httptools.paramsFromCGIForm(forms):
FieldStorage(None, None, [FieldStorage('Filename', None,
'hello.txt'),
FieldStorage('file', 'hello.txt', 'hellornrnworldrnr
neach man is an island.rntrn!'),
FieldStorage('Upload', None,
'Submit Query')])
got here 5
2007-01-26 23:39:13,328 cherrypy.msg INFO HTTP: Page
handler: <bound
method Uploader.upload of <vor.uploader.Uploader object
at 0x
01B83930>>
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 259, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 non-keyword arguments
(1 given)
Request Headers:
  Content-Length: 458
  USER-AGENT: Shockwave Flash
  CONNECTION: Keep-Alive
  CONTENT-LENGTH: 458
  HOST: localhost:8080
  CACHE-CONTROL: no-cache
  CONTENT-TYPE: multipart/form-data;
boundary=----------Ij5GI3gL6gL6Ef1GI3GI3Ef1Ef1gL6
  ACCEPT: text/*
  Remote-Addr: 127.0.0.1
  Content-Type: multipart/form-data;
boundary=----------Ij5GI3gL6gL6Ef1GI3GI3Ef1Ef1gL6
  Remote-Host: 127.0.0.1
127.0.0.1 - - "POST /upload/upload HTTP/1.1" 500
1286 "" "Shockwave
Flash"
2007-01-26 23:39:13,390 cherrypy.msg INFO DEBUG:     NOT
FOUND file:
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt
2007-01-26 23:39:13,530 turbogears.identity INFO Identity
is
available...
2007-01-26 23:39:13,530 cherrypy.msg INFO HTTP: Page
handler: "The path
'/static/uploader/images/hello.txt' was not found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 251, in main
    page_handler, object_path, virtual_path =
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 319, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=b159954b8dd348f2cab62729e2ede205624c6cc3
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US;
rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/html;q=0
.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 1335
"" "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 00:56:19
ok, I installed the patch, now I'm getting this:

got here 1
got here 3
httptools.paramsFromCGIForm(forms):
FieldStorage(None, None, [FieldStorage('Filename', None,
'hello.txt'),
FieldStorage('file', 'hello.txt', 'hellornrnworldrnr
neach man is an island.rntrn!'),
FieldStorage('Upload', None,
'Submit Query')])
got here 5
2007-01-26 23:39:13,328 cherrypy.msg INFO HTTP: Page
handler: <bound
method Uploader.upload of <vor.uploader.Uploader object
at 0x
01B83930>>
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 259, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 non-keyword arguments
(1 given)
Request Headers:
  Content-Length: 458
  USER-AGENT: Shockwave Flash
  CONNECTION: Keep-Alive
  CONTENT-LENGTH: 458
  HOST: localhost:8080
  CACHE-CONTROL: no-cache
  CONTENT-TYPE: multipart/form-data;
boundary=----------Ij5GI3gL6gL6Ef1GI3GI3Ef1Ef1gL6
  ACCEPT: text/*
  Remote-Addr: 127.0.0.1
  Content-Type: multipart/form-data;
boundary=----------Ij5GI3gL6gL6Ef1GI3GI3Ef1Ef1gL6
  Remote-Host: 127.0.0.1
127.0.0.1 - - "POST /upload/upload HTTP/1.1" 500
1286 "" "Shockwave
Flash"
2007-01-26 23:39:13,390 cherrypy.msg INFO DEBUG:     NOT
FOUND file:
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt
2007-01-26 23:39:13,530 turbogears.identity INFO Identity
is
available...
2007-01-26 23:39:13,530 cherrypy.msg INFO HTTP: Page
handler: "The path
'/static/uploader/images/hello.txt' was not found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 251, in main
    page_handler, object_path, virtual_path =
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy_cphttptools.py",
line 319, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=b159954b8dd348f2cab62729e2ede205624c6cc3
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US;
rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/html;q=0
.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 1335
"" "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 11:54:28
Jesse James wrote:
> ok, I installed the patch, now I'm getting this:
> FieldStorage(None, None, [FieldStorage('Filename',
None, 'hello.txt'),
> FieldStorage('file', 'hello.txt',
'hellornrnworldrnr
> neach man is an island.rntrn!'),
FieldStorage('Upload', None,
> 'Submit Query')])
> TypeError: upload() takes at least 2 non-keyword
arguments (1 given)

Did you revert your other changes?

Try printing forms.keys(); what does it contain? On mine,
it's always ['Filename', 'Filedata', 'Upload']; those are
then used as keyword arguments to the page handler (the
'upload' method). Given the output you showed above,
forms.keys() should be a 3-item list. If you get something
different, then...there's something wrong with your
install.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


  
Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 13:17:48
On 27 Jan, 11:54, "Robert Brewer" <fuman...amor.org> wrote:
> Jesse James wrote:
> > ok, I installed the patch, now I'm getting this:
> > FieldStorage(None, None, [FieldStorage('Filename',
None, 'hello.txt'),
> > FieldStorage('file', 'hello.txt',
'hellornrnworldrnr
> > neach man is an island.rntrn!'),
FieldStorage('Upload', None,
> > 'Submit Query')])
> > TypeError: upload() takes at least 2 non-keyword
arguments (1 given)Did you revert your other changes?
>
> Try printing forms.keys(); what does it contain? On
mine, it's always ['Filename', 'Filedata', 'Upload']; those
are then used as keyword arguments to the page handler (the
'upload' method). Given the output you showed above,
forms.keys() should be a 3-item list. If you get something
different, then...there's something wrong with your
install.

Robert,
I am using your patch exactly as you posted it. I suspect
there is 
something wrong with the logic in cherrypy that deals with
the 
boundary markers.

Again, the traceback reveals that upload is expecting 2 args
(one 
being self) but is only being called with 1 (thus the
parsing of the 
request is not producing any args).

Here is the result on stdout including a print forms.keys()
section:
------------------------ wrapper ---------------------
------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello.txt

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello



world



each man is an island.

2007-01-27 13:15:17,467 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt


!

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

Submit Query

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7--
>>>>>>>>>>forms.keys()
2007-01-27 13:15:17,500 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"
['Filename', 'file', 'Upload']
got here 5
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: <bound 
method Uploader.upload of <vor.uploader.Uploader object
at 0x
01B7F910>>
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 258, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 non-keyword arguments
(1 given)
Request Headers:
  Content-Length: 458
  USER-AGENT: Shockwave Flash
  CONNECTION: Keep-Alive
  CONTENT-LENGTH: 458
  HOST: localhost:8080
  CACHE-CONTROL: no-cache
  CONTENT-TYPE: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  ACCEPT: text/*
  Remote-Addr: 127.0.0.1
  Content-Type: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  Remote-Host: 127.0.0.1
127.0.0.1 - - "POST /upload/upload HTTP/1.1" 500
1286 "" "Shockwave 
Flash"
2007-01-27 13:15:17,578 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt
2007-01-27 13:15:17,578 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,655 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 13:32:43
On 27 Jan, 11:54, "Robert Brewer" <fuman...amor.org> wrote:
> Jesse James wrote:
> > ok, I installed the patch, now I'm getting this:
> > FieldStorage(None, None, [FieldStorage('Filename',
None, 'hello.txt'),
> > FieldStorage('file', 'hello.txt',
'hellornrnworldrnr
> > neach man is an island.rntrn!'),
FieldStorage('Upload', None,
> > 'Submit Query')])
> > TypeError: upload() takes at least 2 non-keyword
arguments (1 given)Did you revert your other changes?
>
> Try printing forms.keys(); what does it contain? On
mine, it's always ['Filename', 'Filedata', 'Upload']; those
are then used as keyword arguments to the page handler (the
'upload' method). Given the output you showed above,
forms.keys() should be a 3-item list. If you get something
different, then...there's something wrong with your
install.

Robert,
I am using your patch exactly as you posted it. I suspect
there is 
something wrong with the logic in cherrypy that deals with
the 
boundary markers.

Again, the traceback reveals that upload is expecting 2 args
(one 
being self) but is only being called with 1 (thus the
parsing of the 
request is not producing any args).

Here is the result on stdout including a print forms.keys()
section:
------------------------ wrapper ---------------------
------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello.txt

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello



world



each man is an island.

2007-01-27 13:15:17,467 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt


!

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

Submit Query

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7--
>>>>>>>>>>forms.keys()
2007-01-27 13:15:17,500 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"
['Filename', 'file', 'Upload']
got here 5
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: <bound 
method Uploader.upload of <vor.uploader.Uploader object
at 0x
01B7F910>>
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 258, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 non-keyword arguments
(1 given)
Request Headers:
  Content-Length: 458
  USER-AGENT: Shockwave Flash
  CONNECTION: Keep-Alive
  CONTENT-LENGTH: 458
  HOST: localhost:8080
  CACHE-CONTROL: no-cache
  CONTENT-TYPE: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  ACCEPT: text/*
  Remote-Addr: 127.0.0.1
  Content-Type: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  Remote-Host: 127.0.0.1
127.0.0.1 - - "POST /upload/upload HTTP/1.1" 500
1286 "" "Shockwave 
Flash"
2007-01-27 13:15:17,578 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt
2007-01-27 13:15:17,578 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,655 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 13:31:58
On 27 Jan, 11:54, "Robert Brewer" <fuman...amor.org> wrote:
> Jesse James wrote:
> > ok, I installed the patch, now I'm getting this:
> > FieldStorage(None, None, [FieldStorage('Filename',
None, 'hello.txt'),
> > FieldStorage('file', 'hello.txt',
'hellornrnworldrnr
> > neach man is an island.rntrn!'),
FieldStorage('Upload', None,
> > 'Submit Query')])
> > TypeError: upload() takes at least 2 non-keyword
arguments (1 given)Did you revert your other changes?
>
> Try printing forms.keys(); what does it contain? On
mine, it's always ['Filename', 'Filedata', 'Upload']; those
are then used as keyword arguments to the page handler (the
'upload' method). Given the output you showed above,
forms.keys() should be a 3-item list. If you get something
different, then...there's something wrong with your
install.

Robert,
I am using your patch exactly as you posted it. I suspect
there is 
something wrong with the logic in cherrypy that deals with
the 
boundary markers.

Again, the traceback reveals that upload is expecting 2 args
(one 
being self) but is only being called with 1 (thus the
parsing of the 
request is not producing any args).

Here is the result on stdout including a print forms.keys()
section:
------------------------ wrapper ---------------------
------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello.txt

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

hello



world



each man is an island.

2007-01-27 13:15:17,467 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt


!

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7

Submit Query

------------Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7--
>>>>>>>>>>forms.keys()
2007-01-27 13:15:17,500 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"
['Filename', 'file', 'Upload']
got here 5
2007-01-27 13:15:17,515 cherrypy.msg INFO HTTP: Page
handler: <bound 
method Uploader.upload of <vor.uploader.Uploader object
at 0x
01B7F910>>
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 258, in main
    body = page_handler(*virtual_path, **self.params)
TypeError: upload() takes at least 2 non-keyword arguments
(1 given)
Request Headers:
  Content-Length: 458
  USER-AGENT: Shockwave Flash
  CONNECTION: Keep-Alive
  CONTENT-LENGTH: 458
  HOST: localhost:8080
  CACHE-CONTROL: no-cache
  CONTENT-TYPE: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  ACCEPT: text/*
  Remote-Addr: 127.0.0.1
  Content-Type: multipart/form-data; boundary=----------
Ef1ei4gL6ei4Ij5Ef1Ij5ae0gL6KM7
  Remote-Host: 127.0.0.1
127.0.0.1 - - "POST /upload/upload HTTP/1.1" 500
1286 "" "Shockwave 
Flash"
2007-01-27 13:15:17,578 cherrypy.msg INFO DEBUG:     NOT
FOUND file: 
C:/Projects/VOR/vor/vor/staticuploader/images/hello.txt
2007-01-27 13:15:17,578 turbogears.identity INFO Identity is

available...
2007-01-27 13:15:17,655 cherrypy.msg INFO HTTP: Page
handler: "The 
path '/static/uploader/images/hello.txt' was not
found."
Traceback (most recent call last):
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 105, in _run
    self.main()
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 250, in main
    page_handler, object_path, virtual_path = 
self.mapPathToObject(path)
  File
"c:Python24libsite-packagescherrypy-2.2.1-py2.4.egg
cherrypy
_cphttptools.py", line 318, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404
Request Headers:
  COOKIE: tg-visit=ad83d530d98600bfe39f47cf1a3f24e4ebe2f1df
  Content-Length:
  ACCEPT-CHARSET: UTF-8,*
  USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:
1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
  CONNECTION: keep-alive
  HOST: localhost:8080
  ACCEPT:
text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Remote-Addr: 127.0.0.1
  ACCEPT-LANGUAGE: en-us,en;q=0.5
  Content-Type:
  Remote-Host: 127.0.0.1
  ACCEPT-ENCODING: gzip,deflate
  KEEP-ALIVE: 300
127.0.0.1 - - "GET /static/uploader/images/hello.txt
HTTP/1.1" 404 
1335 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8
.0.9) Gecko/20061206 Firefox/1.5.0.9"



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 13:35:10
Jesse James wrote:
> On 27 Jan, 11:54, "Robert Brewer"
<fuman...amor.org> wrote:
>> Jesse James wrote:
>>> ok, I installed the patch, now I'm getting
this:
>>> FieldStorage(None, None,
[FieldStorage('Filename', None, 'hello.txt'),
>>> FieldStorage('file', 'hello.txt',
'hellornrnworldrnr
>>> neach man is an island.rntrn!'),
FieldStorage('Upload', None,
>>> 'Submit Query')])
>>> TypeError: upload() takes at least 2
non-keyword arguments (1 given)Did you revert your other
changes?
>> Try printing forms.keys(); what does it contain? On
mine, it's always ['Filename', 'Filedata', 'Upload']; those
are then used as keyword arguments to the page handler (the
'upload' method). Given the output you showed above,
forms.keys() should be a 3-item list. If you get something
different, then...there's something wrong with your
install.
> 
> Robert,
> I am using your patch exactly as you posted it. I
suspect there is 
> something wrong with the logic in cherrypy that deals
with the 
> boundary markers.
> 
> Again, the traceback reveals that upload is expecting 2
args (one 
> being self) but is only being called with 1 (thus the
parsing of the 
> request is not producing any args).
> 

Can't you lookup yourself then which arg is missing?

- Sylvain

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: $180 reward for help in tackling the hardest problem in the universe.
user name
2007-01-27 15:58:37


> > Again, the traceback reveals that upload is
expecting 2 args (one
> > being self) but is only being called with 1 (thus
the parsing of the
> > request is not producing any args).Can't you
lookup yourself then which arg is missing?
>
again, when I run this with a web form that only produces a
single 
argument, I can correctly fire my controller (page handler,
whatever 
term you prefer) and it works - it retrieves the correct
data from the 
uploaded file.
This is with the single part multi-part form:

SIMPLE HTML:
---------- start body ---------------
-----------------------------21718375316139
Content-Disposition: form-data;
name="file_handle";
filename="hello.txt"
Content-Type: text/plain

hello

world

each man is an island.

-----------------------------21718375316139--

---------- end body ---------------


however, when I send it from flex, with Robert's filter in
place to 
handle the missing CRLF, it does not produce any arguments
to pass to 
the handler (forms is empty).  Thus, my attempt at
convincing someone 
who cares that cherrypy is broken, probably in the
read_multi method 
of the FieldStorage class. I guess I'll just have to fix it
myself.
thanks.
Joel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---


[1-16]

about | contact  Other archives ( Real Estate discussion Medical topics )