[Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Manlio Perillo
Hi. In my WSGI framework: http://hg.mperillo.ath.cx/wsgix I have, in the `http` module, the functions `parse_query_string` and `parse_simple_post_data`. The first parse the query string and return a dictionary of strings, the latter parse the application/x-www-form-urlencoded client body and re

Re: [Web-SIG] [DB-SIG] WSGI thread affinity/interleaving

2008-07-28 Thread M.-A. Lemburg
Ian Bicking wrote: > James Y Knight wrote: >> I'm worried about database access. Most DBAPI adapters have >> threadsafety level 2: "Threads may share the module and >> connections.". So with those, at least, it should be fine to move a >> connection between threads, since "share OK" implies "

Re: [Web-SIG] [DB-SIG] WSGI thread affinity/interleaving

2008-07-28 Thread M.-A. Lemburg
James Y Knight wrote: > On Dec 18, 2005, at 6:57 PM, M.-A. Lemburg wrote: > >> Ian Bicking wrote: >> >>> James Y Knight wrote: >>> I'm worried about database access. Most DBAPI adapters have threadsafety level 2: "Threads may share the module and connections.". So with those, at lea

Re: [Web-SIG] [DB-SIG] WSGI thread affinity/interleaving

2008-07-28 Thread M.-A. Lemburg
Guido van Rossum wrote: > On 12/19/05, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> Ok. In that sense, I think "moving" is not really possible >> with database connections or cursors: these always rely on >> external resources and these may be relying on having the >> same thread context around when

[Web-SIG] ANNOUNCE: WSGI XSS Prevention Middleware

2008-07-28 Thread Richard Moore
Hi, I've just written a python WSGI middleware class to mitigate XSS flaws, it's released under the python license. I've attached the docs below. Cheers Rich. WSGI Middleware class that prevents cross-site scripting flaws in WSGI applications being exploited. Potentially malicious GET and POST

[Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread est
I am writing a small 'comet'-like app using flup, something like this: def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Flup works!\n']<-Could this be part of response output? Could I time.sleep() for a while then w

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread Raymond Hettinger
I'm inclined towards the fancy naming option. Ditching the most commonly used module in the standard library doesn't seem like progress to me. The thing that seems to bug people is choosing between urllib and urllib2 without knowing how they differ. Raymond ___

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread Facundo Batista
2008/2/28, Brett Cannon <[EMAIL PROTECTED]>: > urlparse -> url.parse > urllib -> GONE > urllib's utility functions -> url.quote > urllib2 -> url.request +1, exactly what I had in mind. -- .Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
On 2008-02-29 01:47, Brett Cannon wrote: > [BCC'ing stdlib-sig and web-sig so that both vote but that I don't > have to clear a bunch of replies in the stdlib-sig mailing list from > people not on both lists =) ] > > With PyCon approaching and having other stuff on my plate to deal with > I want t

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
On 2008-02-29 20:20, Brett Cannon wrote: >> So, I'd be +1 on the second approach, provided that those >> two classes make the transition into url.request as >> well. Otherwise, I'm +1 on the first approach and -1 >> on the second. >> > > Just to make sure I got this straight, as long as the tw

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
Brett Cannon wrote: On Fri, Feb 29, 2008 at 11:52 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: On 2008-02-29 20:20, Brett Cannon wrote: >> So, I'd be +1 on the second approach, provided that those >> two classes make the transition into url.request as >> well. Otherwise, I'm +1 on the firs

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
On 2008-03-01 05:06, Brett Cannon wrote: > Seriously, I just don't want to support two different approaches to > the same problem. Then what makes you believe that the urllib2 approach is the better one ? Why not move urllib2 to PyPI and keep urllib ? >> It's not really an argument for dropping

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
On 2008-03-01 21:13, Brett Cannon wrote: > On Sat, Mar 1, 2008 at 4:34 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2008-03-01 05:06, Brett Cannon wrote: >> > Seriously, I just don't want to support two different approaches to >> > the same problem. >> >> Then what makes you believe that t

Re: [Web-SIG] [stdlib-sig] Choosing one of two options for url* in the stdlib reorg

2008-07-28 Thread M.-A. Lemburg
On 2008-03-02 21:11, Brett Cannon wrote: > Well, look at the docs for urllib. There is a list of restrictions > (e.g., does not support the use of proxies which require > authentication). From what I can tell, those items on the list that > are an actual restriction do not carry over to urlli

Re: [Web-SIG] ngx.poll extension (was Re: Are you going to convert Pylons code into Python 3000?)

2008-07-28 Thread brian
>Manlio Perillo wrote: >> Brian Smith wrote: >> For "non-blocking reads", given environ["wsgi.input"].read(64000, >> min=8000): >> >> 1. If more than 64000 bytes are available without blocking, [64000] bytes >> are returned. >> 2. If less than 8000 bytes are available without blocking, then the >>

Re: [Web-SIG] urllib package addressing PEP 3108

2008-07-28 Thread Facundo Batista
2008/6/16 O.R.Senthil Kumaran <[EMAIL PROTECTED]>: > (urllib2.py and url handling functions from urllib (URLOpener, FancyURLOpener) > and then parse.py ( urlparse.py and parsing related methods from urllib). > http://bugs.python.org/issue2885 tracks the package creation. I think Jeremy will handl

[Web-SIG] some much-deferred admin of web-sig list...

2008-07-28 Thread Bill Janssen
I've just cleared the queue of admin tasks for the Web-SIG list, so don't be surprised to see some old messages appear... Bill ___ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/ma

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Etienne Robillard
On Mon, 18 Feb 2008 04:23:38 -0800 (PST) est <[EMAIL PROTECTED]> wrote: > I am writing a small 'comet'-like app using flup, something like > this: > > def myapp(environ, start_response): > start_response('200 OK', [('Content-Type', 'text/plain')]) > return ['Flup works!\n']<--

Re: [Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Ian Bicking
Manlio Perillo wrote: Hi. In my WSGI framework: http://hg.mperillo.ath.cx/wsgix I have, in the `http` module, the functions `parse_query_string` and `parse_simple_post_data`. The first parse the query string and return a dictionary of strings, the latter parse the application/x-www-form-urlenc

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Manlio Perillo
est ha scritto: I am writing a small 'comet'-like app using flup, something like this: def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Flup works!\n']<-Could this be part of response output? What do you mean b

Re: [Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Manlio Perillo
Ian Bicking ha scritto: Manlio Perillo wrote: Hi. In my WSGI framework: http://hg.mperillo.ath.cx/wsgix I have, in the `http` module, the functions `parse_query_string` and `parse_simple_post_data`. The first parse the query string and return a dictionary of strings, the latter parse the appl

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Donovan Preston
On Jul 28, 2008, at 12:52 PM, Etienne Robillard wrote: On Mon, 18 Feb 2008 04:23:38 -0800 (PST) est <[EMAIL PROTECTED]> wrote: I am writing a small 'comet'-like app using flup, something like this: So is WSGI really synchronous? How can I handle asynchronous outputs with flup/WSGI ? WSGI

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Phillip J. Eby
At 04:23 AM 2/18/2008 -0800, est wrote: I am writing a small 'comet'-like app using flup, something like this: def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Flup works!\n']<-Could this be part of response outpu

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Phillip J. Eby
At 04:57 PM 7/28/2008 -0700, Donovan Preston wrote: On Jul 28, 2008, at 12:52 PM, Etienne Robillard wrote: On Mon, 18 Feb 2008 04:23:38 -0800 (PST) est <[EMAIL PROTECTED]> wrote: I am writing a small 'comet'-like app using flup, something like this: So is WSGI really synchronous? How can

Re: [Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Bill Janssen
> The first parse the query string and return a dictionary of strings, the > latter parse the application/x-www-form-urlencoded client body and > return a dictionary of strings and the charset used by the client for > the unicode encoding. > Now, I'm thinking if these two function should instead r

Re: [Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Bill Janssen
> In wsgix I use utf-8 for decoding the QUERY_STRING, and the charset > specified in the POST'ed data (utf-8 or the charset found in the special > _charset_ field). That's probably wrong. We went through this recently on the python-dev list. While it's possible to tell the encoding of multipar

Re: [Web-SIG] Could WSGI handle Asynchronous response?

2008-07-28 Thread Donovan Preston
On Jul 28, 2008, at 6:21 PM, Phillip J. Eby wrote: At 04:57 PM 7/28/2008 -0700, Donovan Preston wrote: On Jul 28, 2008, at 12:52 PM, Etienne Robillard wrote: On Mon, 18 Feb 2008 04:23:38 -0800 (PST) est <[EMAIL PROTECTED]> wrote: I am writing a small 'comet'-like app using flup, something

Re: [Web-SIG] parsing of urlencoded data and Unicode

2008-07-28 Thread Manlio Perillo
Bill Janssen ha scritto: In wsgix I use utf-8 for decoding the QUERY_STRING, and the charset specified in the POST'ed data (utf-8 or the charset found in the special _charset_ field). That's probably wrong. We went through this recently on the python-dev list. While it's possible to tell the