From eghansah at gmail.com Mon Aug 4 00:01:00 2008 From: eghansah at gmail.com (eghansah) Date: Sun, 3 Aug 2008 22:01:00 +0000 Subject: [Web-SIG] Keg - A python web framework In-Reply-To: <3e371780808031457l75a10f51h883e1d96cca2943a@mail.gmail.com> References: <3e371780808031457l75a10f51h883e1d96cca2943a@mail.gmail.com> Message-ID: <3e371780808031501o5aa0ead1j872944dc1a1576b@mail.gmail.com> Hi, I've been working on a python web framework which I think might be of interest to you. Details may be found at http://code.google.com/p/keg/wiki/Concept. All suggestions or comments will be greatly appreciated. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dirk.holtwick at gmail.com Mon Aug 4 11:47:49 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 04 Aug 2008 11:47:49 +0200 Subject: [Web-SIG] Keg - A python web framework In-Reply-To: <3e371780808031501o5aa0ead1j872944dc1a1576b@mail.gmail.com> References: <3e371780808031457l75a10f51h883e1d96cca2943a@mail.gmail.com> <3e371780808031501o5aa0ead1j872944dc1a1576b@mail.gmail.com> Message-ID: <4896D045.8060502@gmail.com> Hi, I also wrote a new framework called Pyxer and I am looking for help on this. Maybe you or other members of that list are interested? It is mainly based on the tools of Ian Bicking and fully WSGI integrated. The new project tries also to make development for Google App Engine (GAE) much easier by simplifying the process of creating an application, writing it and the uploading it. Have a look here: http://code.google.com/p/pyxer/ More informations in the documentation: http://pyxer.googlecode.com/files/pyxer-0.4.0alpha.pdf THIS IS A VERY EARLY RELEASE! The framework not only supports GAE but also "Paster" and each other WSGI implementation. Since my favorite templating language Genshi is not supported on GAE I wrote my own ;) It is based on "html5lib" and does more or less the same than Genshi or Kit does. Sessions are supported by using "Beaker". JSON is also supported out of the box. So what makes it special? Well this framework is not so addicted to the MVC programming model than others. It mixes the Python files with the template and static files. So you have all nicely together in one directory (for now it is always called "public"). To create and start a new project just call: $ pyxer init $ cd $ pyxer serve The most simple "Hello World" is done by creating "public/__init__py" and then write: from pyxer.base import * @controller def index(): return "Hello World" That's it. If anybody is interested in helping me developing this tool I would be very glad! It is published under the MIT License, so everything is very liberal also for commercial use. Hope to hear from you and get some feedback. Thanks Dirk eghansah schrieb: > Hi, > > I've been working on a python web framework which I think might be of > interest to you. > Details may be found at http://code.google.com/p/keg/wiki/Concept. > > > All suggestions or comments will be greatly appreciated. > > > Thank you. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Web-SIG mailing list > Web-SIG at python.org > Web SIG: http://www.python.org/sigs/web-sig > Unsubscribe: http://mail.python.org/mailman/options/web-sig/dirk.holtwick%40gmail.com From orsenthil at gmail.com Fri Aug 8 00:17:09 2008 From: orsenthil at gmail.com (O.R.Senthil Kumaran) Date: Fri, 8 Aug 2008 03:47:09 +0530 Subject: [Web-SIG] [issue1432] Strange behavior of urlparse.urljoin Message-ID: <20080807221709.GD3370@gmail.com> This bug report is on particular behavior of urlparse.urljoin. The way it is currently coded is, compliant with RFC2396 With Base: http://a/b/c/d;p?q Relative URLS: ?y gives http://a/b/c/?y But the Bug Report points out that this is not valid behaviour and references RFC3986 (which has superceded RFC2396) as how handle it. Base: http://a/b/c/d;p?q Relative URL: "?y" = "http://a/b/c/d;p?y" I have a patch available to make this change. However, while discussing this issue with Facundo, we have a thought if this is correct time to incorporate this fix as Python 3.0 is already in BETA2. There has apparant change in 'working behaviour' due to update of the RFC. In my opinion, it is okay (as it been requested by a bug-report/user's need and have a justification in updated RFC), what does Web-SIG feel about this issue? Please provide your thoughts on this. > > Facundo Batista added the comment: > > Senthil: We should ask for advice in the web-sig list to see if this is > enough a "bug to be fixed" now that we're in beta for the releases. > > Thanks! > -- O.R.Senthil Kumaran http://uthcode.sarovar.org From foom at fuhm.net Fri Aug 8 01:01:36 2008 From: foom at fuhm.net (James Y Knight) Date: Thu, 7 Aug 2008 19:01:36 -0400 Subject: [Web-SIG] [issue1432] Strange behavior of urlparse.urljoin In-Reply-To: <20080807221709.GD3370@gmail.com> References: <20080807221709.GD3370@gmail.com> Message-ID: On Aug 7, 2008, at 6:17 PM, O.R.Senthil Kumaran wrote: > This bug report is on particular behavior of urlparse.urljoin. The > way it is > currently coded is, compliant with RFC2396 RFCs in the web area are often a meaningless waste of paper, but it's not always clear which ones are and which aren't. So please check things like this against actual browsers. Being compliant with a spec but different from the implementation in the browsers is really pretty useless. In this case, however, Safari and Firefox seem to follow your two tests at least, so that probably means RFC3986 is good to follow. I'd actually bet that common web browsers have /always/ had this behavior, and that the previous RFCs were buggy, although I admit I haven't gone back and tested netscape 1.1 or anything. I tested using the following test fragment. The two links I got were: http://a/b/c/d;p?y and http://a/b/c/;x which corresponds with your suggested change. So, if you asked me, I'd say it was a bug fix, because it's currently wrong when you compare against the thing that really counts: browsers. ?y
;x
James From janssen at parc.com Fri Aug 8 19:26:23 2008 From: janssen at parc.com (Bill Janssen) Date: Fri, 8 Aug 2008 10:26:23 PDT Subject: [Web-SIG] invalid http.cookiejar test? Message-ID: <08Aug8.102627pdt."58698"@synergy1.parc.xerox.com> I'm looking at the following test case in test_http_cookiejar, in the Python 3000 test suite. It seems to assume that URLs can have non-ASCII characters in them, and in fact random octets. My understanding of RFC 3986, the URI RFC, is that the URI must be all ASCII characters, though segments of the path, and parameters, and query elements, can all contain percent-encoded octets for various purposes. So I'd expect this test, which to my eyes contains one valid URL (the first one), and two invalid ones, to fail when it encounters the invalid URLs, but clearly the intent of whoever wrote this was that it would succeed. Which is the correct expectation? Bill def test_url_encoding(self): # Try some URL encodings of the PATHs. # (the behaviour here has changed from libwww-perl) c = CookieJar(DefaultCookiePolicy(rfc2965=True)) interact_2965(c, "http://www.acme.com/foo%2f%25/%3c%3c%0Anew%E5/%E5", "foo = bar; version = 1") [no problem so far...] cookie = interact_2965( c, "http://www.acme.com/foo%2f%25/<<%0anew\345/\346\370\345", 'bar=baz; path="/foo/"; version=1'); [..."cookie" should be None here, because URL was invalid...] version_re = re.compile(r'^\$version=\"?1\"?', re.I) [...so the following assertion should fail...] self.assert_("foo=bar" in cookie and version_re.search(cookie)) cookie = interact_2965( c, "http://www.acme.com/foo/%25/<<%0anew\345/\346\370\345") [...and this assertion should succeed, because of the invalid URL...] self.assert_(not cookie) # unicode URL doesn't raise exception [Um, why shouldn't this next bit raise an exception?] cookie = interact_2965(c, "http://www.acme.com/\xfc") From orsenthil at gmail.com Sun Aug 10 11:38:47 2008 From: orsenthil at gmail.com (O.R.Senthil Kumaran) Date: Sun, 10 Aug 2008 15:08:47 +0530 Subject: [Web-SIG] [issue1432] Strange behavior of urlparse.urljoin In-Reply-To: References: <20080807221709.GD3370@gmail.com> Message-ID: <20080810093847.GD1142@gmail.com> * scriptor James Y Knight, explico > > In this case, however, Safari and Firefox seem to follow your two tests at > least, so that probably means RFC3986 is good to follow. I'd actually bet > that common web browsers have /always/ had this behavior, and that the > previous RFCs were buggy, although I admit I haven't gone back and tested > netscape 1.1 or anything. > Thanks James. Explaination and the tests were a helpful confirmation. We shall go ahead and apply the patch the trunk and py3k. Thanks, Senthil From anartz at anartz.cjb.net Sun Aug 10 22:29:22 2008 From: anartz at anartz.cjb.net (anartz at anartz.cjb.net) Date: Sun, 10 Aug 2008 14:29:22 -0600 Subject: [Web-SIG] =?utf-8?q?passing_data_to_python_script_to_generate_cha?= =?utf-8?q?rt_dynamically=2E=2E=2E?= Message-ID: <200808102029.m7AKTSjX007420@cjb.net> Hi, Is it possible to pass data from an html command to a python script as an argument, to create a chart from the provided data? My best try so far could be the following lines, which as you probably guessed, don't work: [CODE] #!c:/Python24/python.exe -u import sys, os, cgi, urllib import cgitb; cgitb.enable() query = cgi.FieldStorage() TheData={'a':'ScatterPlot','x1': range(10),'y1': range(10),'l1':'First Legend','x2': range(5),'y2': range(5,0,-1),'l2':'Second Legend','t':'Some title','h':'Some X label','v':'Some Y label'} print "Content-type: text/html\n" print """

""" %{"TheData":urllib.quote(str(TheData))} [/CODE] the error reported in the web server (modified for simplicity) is: [ERROR] [Sun Aug 10 21:38:01 2008] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /path2Script/myscript.py%20OutputOf(urllib.quote(str(TheData))) HTTP/1.1 to file, referer: http://localhost/path2referer [/ERROR] I assume that the problem is that myscript.py is not found due to the added %20 in /myscript.py%20OutputOf(urllib.quote(str(TheData))) Any ideas of how I can pass the arguments to the python script? for reference, I am running windows XP with an apache server. Thanks. From fumanchu at aminus.org Mon Aug 11 00:08:23 2008 From: fumanchu at aminus.org (Robert Brewer) Date: Sun, 10 Aug 2008 15:08:23 -0700 Subject: [Web-SIG] passing data to python script to generate chart dynamically... In-Reply-To: <200808102029.m7AKTSjX007420@cjb.net> References: <200808102029.m7AKTSjX007420@cjb.net> Message-ID: anartz at anartz.cjb.net wrote: > Is it possible to pass data from an html command to a python script as > an argument, to create a chart from the provided data? http://en.wikipedia.org/wiki/Query_string is a good overview of how to do this via GET in the URL, with a mention of how to do it in the request body with POST. If you have further questions, you should ask at comp.lang.python: http://mail.python.org/mailman/listinfo/python-list Robert Brewer fumanchu at aminus.org From orsenthil at gmail.com Wed Aug 13 14:44:19 2008 From: orsenthil at gmail.com (O.R.Senthil Kumaran) Date: Wed, 13 Aug 2008 18:14:19 +0530 Subject: [Web-SIG] python bug issue2464 Message-ID: <20080813124418.GB4368@gmail.com> I am trying to write a fix for this bug http://bugs.python.org/issue2464 - urllib2 can't handle http://www.wikispaces.com What actually happening here is: 1) urllib2 tries to open http://www.wikispaces.com 2) It gets 302 Redirected to https://session.wikispaces.com/session/auth?authToken=1bd8784307f89a495cc1aafb075c4983 3) It again gets 302 Redirected to: 'http://www.wikispaces.com?responseToken=1bd8784307f89a495cc1aafb075c4983 After this, gets a 200 code, but when the page it retrived it 400 Bad Request! Firefox has NO problem in getting the actual page though. Here is the O/P of the session (I have made print header.items() at http_error_302 method in HTTPRedirectHandler): >>> obj1 = urllib2.urlopen("http://www.wikispaces.com") [('content-length', '0'), ('x-whom', 'w9-prod-http, p1'), ('set-cookie', 'slave=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, test=1; expires=Wed, 13-Aug-2008 13:03:51 GMT; path=/'), ('server', 'nginx/0.6.30'), ('connection', 'close'), ('location', 'https://session.wikispaces.com/session/auth?authToken=4b3eecb5c1ab301689e446cf03b3a585'), ('date', 'Wed, 13 Aug 2008 12:33:51 GMT'), ('p3p', 'CP: ALL DSP COR CURa ADMa DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; charset=utf-8')] [('content-length', '0'), ('x-whom', 'w8-prod-https, p1'), ('set-cookie', 'master=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, master=7de5d46e15fd23b1ddf782c565d4fb3a; expires=Thu, 14-Aug-2008 13:03:53 GMT; path=/; domain=session.wikispaces.com'), ('server', 'nginx/0.6.30'), ('connection', 'close'), ('location', 'http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585'), ('date', 'Wed, 13 Aug 2008 12:33:53 GMT'), ('p3p', 'CP: ALL DSP COR CURa ADMa DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; charset=utf-8')] >>> print obj1.geturl() http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585 >>> print obj1.code 200 >>> print obj1.headers >>> print obj1.info() >>> print obj1.read() 400 Bad Request

400 Bad Request


nginx/0.6.30
With all this happening with urllib2, firefox is able to handle this properly. Also I notice that I suffix the url with a dummy path say url = "http://www.wikispaces.com/dummy_url_path". The urlopen request will still to through 302-302-200. but with dummy_url_path appended in the redirections and then read() will succeed! Please share your opinion on where do you think, that urllib2 is going wrong here! I am not able to drill down to the fault point. This has NOT got to do with null characters in the redirection url as noted in the bug report. Thanks, Senthil From exarkun at divmod.com Wed Aug 13 16:17:05 2008 From: exarkun at divmod.com (Jean-Paul Calderone) Date: Wed, 13 Aug 2008 10:17:05 -0400 Subject: [Web-SIG] python bug issue2464 In-Reply-To: <20080813124418.GB4368@gmail.com> Message-ID: <20080813141705.29191.1643319309.divmod.quotient.13881@ohm> On Wed, 13 Aug 2008 18:14:19 +0530, "O.R.Senthil Kumaran" wrote: > >I am trying to write a fix for this bug http://bugs.python.org/issue2464 >- urllib2 can't handle http://www.wikispaces.com > >What actually happening here is: > >1) urllib2 tries to open http://www.wikispaces.com >2) It gets 302 Redirected to >https://session.wikispaces.com/session/auth?authToken=1bd8784307f89a495cc1aafb075c4983 >3) It again gets 302 Redirected to: >'http://www.wikispaces.com?responseToken=1bd8784307f89a495cc1aafb075c4983 > >After this, gets a 200 code, but when the page it retrived it 400 Bad Request! > >Firefox has NO problem in getting the actual page though. > >Here is the O/P of the session (I have made print header.items() at >http_error_302 method in HTTPRedirectHandler): > >>>> obj1 = urllib2.urlopen("http://www.wikispaces.com") >[('content-length', '0'), ('x-whom', 'w9-prod-http, p1'), ('set-cookie', >'slave=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, test=1; expires=Wed, >13-Aug-2008 13:03:51 GMT; path=/'), ('server', 'nginx/0.6.30'), ('connection', >'close'), ('location', >'https://session.wikispaces.com/session/auth?authToken=4b3eecb5c1ab301689e446cf03b3a585'), >('date', 'Wed, 13 Aug 2008 12:33:51 GMT'), ('p3p', 'CP: ALL DSP COR CURa ADMa >DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; >charset=utf-8')] >[('content-length', '0'), ('x-whom', 'w8-prod-https, p1'), ('set-cookie', >'master=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, >master=7de5d46e15fd23b1ddf782c565d4fb3a; expires=Thu, 14-Aug-2008 13:03:53 GMT; >path=/; domain=session.wikispaces.com'), ('server', 'nginx/0.6.30'), >('connection', 'close'), ('location', >'http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585'), >('date', 'Wed, 13 Aug 2008 12:33:53 GMT'), ('p3p', 'CP: ALL DSP COR CURa ADMa >DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; >charset=utf-8')] >>>> print obj1.geturl() >http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585 >>>> print obj1.code >200 >>>> print obj1.headers > >>>> print obj1.info() > >>>> print obj1.read() > >400 Bad Request > >

400 Bad Request

>
nginx/0.6.30
> > > >With all this happening with urllib2, firefox is able to handle this properly. >Also I notice that I suffix the url with a dummy path say >url = "http://www.wikispaces.com/dummy_url_path". The urlopen request will >still to through 302-302-200. but with dummy_url_path appended in the >redirections and then read() will succeed! > >Please share your opinion on where do you think, that urllib2 is going wrong >here! I am not able to drill down to the fault point. >This has NOT got to do with null characters in the redirection url as noted in >the bug report. > Some things: http://foo.com This is not a valid URL. The correct URL for the intended location here is: http://foo.com/ This is the root of the problem, I suspect. Firefox notices this problem and fixes it when deciding what requests to make. For example, while urllib2 ultimately asks for this URL: ?responseToken=f02a955460b2cc180e9bf1faa8efd383 Firefox recognizes that this is silly and instead asks for: /?responseToken=5007a08643c2b4dd719a8848024b2c7a The tokens are different because these are values from actual requests. Notice the important difference, though - Firefox's request begins with a /. Likely, urllib2 should do a bit more validation of its input and make sure it is only making requests which follow the protocol. Jean-Paul From sidnei at enfoldsystems.com Wed Aug 13 17:25:43 2008 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Wed, 13 Aug 2008 12:25:43 -0300 Subject: [Web-SIG] python bug issue2464 In-Reply-To: <20080813141705.29191.1643319309.divmod.quotient.13881@ohm> References: <20080813124418.GB4368@gmail.com> <20080813141705.29191.1643319309.divmod.quotient.13881@ohm> Message-ID: I also noticed that there's a Set-Cookie header in there. If you're not handling cookies that could potentially cause some trouble too, though I suspect this is not the problem here. On Wed, Aug 13, 2008 at 11:17 AM, Jean-Paul Calderone wrote: > On Wed, 13 Aug 2008 18:14:19 +0530, "O.R.Senthil Kumaran" > wrote: >> >> I am trying to write a fix for this bug http://bugs.python.org/issue2464 >> - urllib2 can't handle http://www.wikispaces.com >> >> What actually happening here is: >> >> 1) urllib2 tries to open http://www.wikispaces.com >> 2) It gets 302 Redirected to >> >> https://session.wikispaces.com/session/auth?authToken=1bd8784307f89a495cc1aafb075c4983 >> 3) It again gets 302 Redirected to: >> 'http://www.wikispaces.com?responseToken=1bd8784307f89a495cc1aafb075c4983 >> >> After this, gets a 200 code, but when the page it retrived it 400 Bad >> Request! >> >> Firefox has NO problem in getting the actual page though. >> >> Here is the O/P of the session (I have made print header.items() at >> http_error_302 method in HTTPRedirectHandler): >> >>>>> obj1 = urllib2.urlopen("http://www.wikispaces.com") >> >> [('content-length', '0'), ('x-whom', 'w9-prod-http, p1'), ('set-cookie', >> 'slave=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, test=1; >> expires=Wed, >> 13-Aug-2008 13:03:51 GMT; path=/'), ('server', 'nginx/0.6.30'), >> ('connection', >> 'close'), ('location', >> >> 'https://session.wikispaces.com/session/auth?authToken=4b3eecb5c1ab301689e446cf03b3a585'), >> ('date', 'Wed, 13 Aug 2008 12:33:51 GMT'), ('p3p', 'CP: ALL DSP COR CURa >> ADMa >> DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; >> charset=utf-8')] >> [('content-length', '0'), ('x-whom', 'w8-prod-https, p1'), ('set-cookie', >> 'master=1; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, >> master=7de5d46e15fd23b1ddf782c565d4fb3a; expires=Thu, 14-Aug-2008 13:03:53 >> GMT; >> path=/; domain=session.wikispaces.com'), ('server', 'nginx/0.6.30'), >> ('connection', 'close'), ('location', >> >> 'http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585'), >> ('date', 'Wed, 13 Aug 2008 12:33:53 GMT'), ('p3p', 'CP: ALL DSP COR CURa >> ADMa >> DEVa CONo OUR IND ONL COM NAV INT CNT STA'), ('content-type', 'text/html; >> charset=utf-8')] >>>>> >>>>> print obj1.geturl() >> >> http://www.wikispaces.com?responseToken=4b3eecb5c1ab301689e446cf03b3a585 >>>>> >>>>> print obj1.code >> >> 200 >>>>> >>>>> print obj1.headers >> >>>>> print obj1.info() >> >>>>> print obj1.read() >> >> >> 400 Bad Request >> >>

400 Bad Request

>>
nginx/0.6.30
>> >> >> >> With all this happening with urllib2, firefox is able to handle this >> properly. >> Also I notice that I suffix the url with a dummy path say >> url = "http://www.wikispaces.com/dummy_url_path". The urlopen request will >> still to through 302-302-200. but with dummy_url_path appended in the >> redirections and then read() will succeed! >> >> Please share your opinion on where do you think, that urllib2 is going >> wrong >> here! I am not able to drill down to the fault point. >> This has NOT got to do with null characters in the redirection url as >> noted in >> the bug report. >> > > Some things: > > http://foo.com > > This is not a valid URL. The correct URL for the intended location here > is: > > http://foo.com/ > > This is the root of the problem, I suspect. Firefox notices this problem > and fixes it when deciding what requests to make. For example, while > urllib2 ultimately asks for this URL: > > ?responseToken=f02a955460b2cc180e9bf1faa8efd383 > > Firefox recognizes that this is silly and instead asks for: > > /?responseToken=5007a08643c2b4dd719a8848024b2c7a > > The tokens are different because these are values from actual requests. > Notice the important difference, though - Firefox's request begins with > a /. > > Likely, urllib2 should do a bit more validation of its input and make > sure it is only making requests which follow the protocol. > > Jean-Paul > _______________________________________________ > Web-SIG mailing list > Web-SIG at python.org > Web SIG: http://www.python.org/sigs/web-sig > Unsubscribe: > http://mail.python.org/mailman/options/web-sig/sidnei%40enfoldsystems.com > -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From orsenthil at gmail.com Wed Aug 13 17:30:28 2008 From: orsenthil at gmail.com (O.R.Senthil Kumaran) Date: Wed, 13 Aug 2008 21:00:28 +0530 Subject: [Web-SIG] python bug issue2464 Message-ID: <20080813153028.GB4703@gmail.com> * scriptor Jean-Paul Calderone, explico > Some things: > > http://foo.com > > This is not a valid URL. The correct URL for the intended location here > is: > > http://foo.com/ > > This is the root of the problem, I suspect. Firefox notices this problem I doubt, if this is the problem, Jean. I tried, >>> obj = urllib2.urlopen("http://www.wikispaces.com/") Ended up at the same problem as described in my original post. > The tokens are different because these are values from actual requests. > Notice the important difference, though - Firefox's request begins with > a /. Were those from the same site? I got different set of tokens as well. > Likely, urllib2 should do a bit more validation of its input and make > sure it is only making requests which follow the protocol. I doubt if that was as simple. I am trying to figure out where the redirection is getting lost of how firefox is figuring it out. It *might* be a bad implementation that we are dealing, but still would like to know where the problem escaping. -- O.R.Senthil Kumaran http://uthcode.sarovar.org From exarkun at divmod.com Wed Aug 13 17:52:16 2008 From: exarkun at divmod.com (Jean-Paul Calderone) Date: Wed, 13 Aug 2008 11:52:16 -0400 Subject: [Web-SIG] python bug issue2464 In-Reply-To: <20080813153028.GB4703@gmail.com> Message-ID: <20080813155216.29191.1943860929.divmod.quotient.13908@ohm> On Wed, 13 Aug 2008 21:00:28 +0530, "O.R.Senthil Kumaran" wrote: >* scriptor Jean-Paul Calderone, explico >> Some things: >> >> http://foo.com >> >> This is not a valid URL. The correct URL for the intended location here >> is: >> >> http://foo.com/ >> >> This is the root of the problem, I suspect. Firefox notices this problem > >I doubt, if this is the problem, Jean. >I tried, >>>> obj = urllib2.urlopen("http://www.wikispaces.com/") > >Ended up at the same problem as described in my original post. > >> The tokens are different because these are values from actual requests. >> Notice the important difference, though - Firefox's request begins with >> a /. >Were those from the same site? I got different set of tokens as well. > >> Likely, urllib2 should do a bit more validation of its input and make >> sure it is only making requests which follow the protocol. > >I doubt if that was as simple. I am trying to figure out where the redirection >is getting lost of how firefox is figuring it out. >It *might* be a bad implementation that we are dealing, but still would like to >know where the problem escaping. Adding the / to the end of the originally requested URL doesn't help. The redirect that wikispaces.com generates is also missing a /. It's that redirect URL which ultimately causes the problem. It's pretty easy to see what's going on; start up wireshark and take a look. Jean-Paul From t.broyer at gmail.com Sun Aug 17 15:30:54 2008 From: t.broyer at gmail.com (Thomas Broyer) Date: Sun, 17 Aug 2008 15:30:54 +0200 Subject: [Web-SIG] python bug issue2464 In-Reply-To: <20080813141705.29191.1643319309.divmod.quotient.13881@ohm> References: <20080813124418.GB4368@gmail.com> <20080813141705.29191.1643319309.divmod.quotient.13881@ohm> Message-ID: On Wed, Aug 13, 2008 at 4:17 PM, Jean-Paul Calderone wrote: > > Some things: > > http://foo.com > > This is not a valid URL. That's not what RFC 3986 says: " The scheme and path components are required, though the path may be empty (no characters). When authority is present, the path must either be empty or begin with a slash ("/") character." -- http://www.ietf.org/rfc/rfc3986.txt (section 3, page 16) > The correct URL for the intended location here > is: > > http://foo.com/ That's the HTTP interpretation: connect to foo.com and send a request for path "/", because HTTP cannot deal with empty paths (and they have the exact same meaning; at least as far as HTTP is concerned, I'm not sure about RFC 3986...) > This is the root of the problem, I suspect. So this is a bug in urllib2. -- Thomas Broyer From eghansah at gmail.com Sun Aug 3 23:57:48 2008 From: eghansah at gmail.com (eghansah) Date: Sun, 03 Aug 2008 21:57:48 -0000 Subject: [Web-SIG] Keg - A python web framework Message-ID: <3e371780808031457l75a10f51h883e1d96cca2943a@mail.gmail.com> Hi, I've been working on a python web framework which I think might be of interest to you. Details may be found at http://code.google.com/p/keg/wiki/Concept. All suggestions or comments will be greatly appreciated. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jspicklemire at gmail.com Thu Aug 14 16:11:17 2008 From: jspicklemire at gmail.com (Jerry Spicklemire) Date: Thu, 14 Aug 2008 14:11:17 -0000 Subject: [Web-SIG] Async API for Python Message-ID: <4a038ea30808140711p13bf09c9j54c8fd0c958555c6@mail.gmail.com> Sorry, if this turns up twice ... Phillip J. Eby wrote, on Tue Jul 29 03:21:18 CEST 2008: "There is no async API that's part of WSGI itself, and it's unlikely there will ever be one unless there ends up being an async API for Python as well." http://mail.python.org/pipermail/web-sig/2008-July/003547.html Following up, perhaps this would be of interest: "New PEP proposal: C Micro-Threading" "This PEP adds micro-threading (or 'green threads') at the C level so that micro-threading is built in and can be used with very little coding effort at the python level. The implementation is quite similar to the Twisted Deferred_/Reactor_ model, but applied at the C level by extending the C API slightly. Doing this provides the Twisted capabilities to python, without requiring the python programmer to code in the Twisted event driven style. Thus, legacy python code would gain the benefits that Twisted provides with very little modification. Burying the event driven mechanism in the C level should also give the same benefits to python GUI interface tools so that the python programmers don't have to deal with event driven programming there either. This capability may also be used to provide some of the features that Stackless Python provides, such as microthreads and channels (here, called micro_pipes)." http://mail.python.org/pipermail/python-ideas/2008-August/001788.html At first glance, the brilliant bit seems to be that the existing Python exception handling process would be applied to async operations, without requiring a "Twisted" coding style. BTW, the PEP author, Bruce Frederiksen, is the author who presented at PyCon, in Chicago, about PyKE, his Python Knowledge Engine project, that makes "compilable" much of what is done dynamically in many popular Python Web Frameworks. The potential to address the "Python is Slow!" meme may be significant, as seen here: http://groups.google.com/group/pyke/browse_thread/thread/433dd213e581536f Just a "heads up" from a longtime lurker, Jerry Spicklemire -------------- next part -------------- An HTML attachment was scrubbed... URL: