Re: [Web-SIG] WSGI for Python 3

2010-08-30 Thread P.J. Eby
At 02:37 PM 8/30/2010 +1000, Graham Dumpleton wrote: Anyway, rather than keep arguing the point and move forward, let us perhaps start now with the following definitions and new names to identify them. We can even go a bit stupid and give each its own code name so they are in part more memorable.

Re: [Web-SIG] WSGI for Python 3

2010-08-30 Thread Ian Bicking
Just to narrow in on one case, URLs, there are a few pieces of information that make up the URL: wsgi.url_scheme: this is *not* present in the request, it's inferred somehow (e.g., by the port the client connected to) HTTP_HOST: this is a header. It typically contains both the hostname and the p

Re: [Web-SIG] WSGI for Python 3

2010-08-29 Thread Graham Dumpleton
On 30 August 2010 13:07, P.J. Eby wrote: > At 11:16 AM 8/30/2010 +1000, Graham Dumpleton wrote: >> >> Although I almost begged that if we are going to discuss bytes, >> compared to text/unicode, that agreement at least first be made about >> the definition of the bytes leaning option, that request

Re: [Web-SIG] WSGI for Python 3

2010-08-29 Thread P.J. Eby
At 11:16 AM 8/30/2010 +1000, Graham Dumpleton wrote: Although I almost begged that if we are going to discuss bytes, compared to text/unicode, that agreement at least first be made about the definition of the bytes leaning option, that request has pretty well fallen on death ears. Did you not s

Re: [Web-SIG] WSGI for Python 3

2010-08-29 Thread Graham Dumpleton
On 30 August 2010 11:02, Ian Bicking wrote: > Ugh... why are we back at bytes again? Because no official decision, by way of a vote or even consensus, has ever been made, the bytes option never goes away. The problem with bytes, before one even tries to compare it to text/unicode option, is that

Re: [Web-SIG] WSGI for Python 3

2010-08-29 Thread Ian Bicking
Ugh... why are we back at bytes again? I don't know of any concrete problems with using Latin1 (basically how mod_wsgi works). It would be nice to try out some tricky cases -- cookie parsing, HTTP proxies, output-modifying middleware, a few other cases. But I don't see a reason to expect they wo

Re: [Web-SIG] WSGI for Python 3

2010-08-28 Thread Georg Brandl
Am 28.08.2010 13:13, schrieb Armin Ronacher: > Hi, > > On 2010-08-28 1:04 PM, Georg Brandl wrote: >> Let me just throw in here that it's *NOT* too late to do something about >> Python 3.2. It is not even in beta state yet, and I am very willing to >> introduce the changes to make web programming

Re: [Web-SIG] WSGI for Python 3

2010-08-28 Thread Armin Ronacher
Hi, On 2010-08-28 1:04 PM, Georg Brandl wrote: Let me just throw in here that it's *NOT* too late to do something about Python 3.2. It is not even in beta state yet, and I am very willing to introduce the changes to make web programming work again, or even hold up 3.2 for a bit if you need more

Re: [Web-SIG] WSGI for Python 3

2010-08-28 Thread Georg Brandl
Am 27.08.2010 01:37, schrieb Armin Ronacher: > Hi, > > Is there a status update on that now I missed? Did something decide on > bytes for the environment values or are we still unsure about that? > > From a discussion lately I had with Graham on #pocoo it seems like he > lost interest on supp

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Armin Ronacher
Hi, On 2010-08-27 6:05 PM, Christoph Zwerschke wrote: > Btw, another problem with this is that the lower() method does not know > that it has to use latin1 when lowercasing. That is not a problem insofar that case insensitive HTTP tokens are limited to ASCII only. Regards, Armin _

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Paul Davis
On Fri, Aug 27, 2010 at 4:04 PM, Robert Brewer wrote: > Paul Davis wrote: >> > Since the major stumbling block, irrespective of other changes, >> > to any sort of agreement is still bytes vs unicode >> >> I ran into this while I was attempting to put together enough code to >> play with a wsgiref2

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Robert Brewer
Paul Davis wrote: > > Since the major stumbling block, irrespective of other changes, > > to any sort of agreement is still bytes vs unicode > > I ran into this while I was attempting to put together enough code to > play with a wsgiref2 that ran on both 2.x and 3.x. As Graham has > deftly pointed

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Paul Davis
On Fri, Aug 27, 2010 at 12:17 AM, Graham Dumpleton wrote: > On 27 August 2010 13:45, P.J. Eby wrote: >> At 01:37 AM 8/27/2010 +0200, Armin Ronacher wrote: >>> >>> Hi, >>> >>> Is there a status update on that now I missed?  Did something decide on >>> bytes for the environment values or are we sti

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Christoph Zwerschke
Am 27.08.2010 18:27 schrieb P.J. Eby: > At 06:05 PM 8/27/2010 +0200, Christoph Zwerschke wrote: >> user = 'özkan'.encode('latin1') >> if user = request.META.get('REMOTE_USER', b'').lower(): >> >> will not work it the user has logged in as 'Özkan'. > > Isn't that a problem with code that does this

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread P.J. Eby
At 02:17 PM 8/27/2010 +1000, Graham Dumpleton wrote: Since the major stumbling block, irrespective of other changes, to any sort of agreement is still bytes vs unicode, and where we have a reasonable clear definition of what unicode suggestion is, can we please as a first step get a definition of

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread P.J. Eby
At 06:05 PM 8/27/2010 +0200, Christoph Zwerschke wrote: For instance, user = 'özkan'.encode('latin1') if user in request.META.get('REMOTE_USER', b'').lower(): will not work it the user has logged in as 'Özkan'. Isn't that a problem with code that does this now? ___

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Christoph Zwerschke
Am 27.08.2010 16:22 schrieb Armin Ronacher: > For an all bytes approach a tool would have to recognize that this is > from a WSGI environment and change the code to this: > > if b'msie' in request.META.get('HTTP_USER_AGENT', b'').lower(): Btw, another problem with this is that the lower() method

Re: [Web-SIG] WSGI for Python 3

2010-08-27 Thread Armin Ronacher
Hi, On 2010-08-27 5:45 AM, P.J. Eby wrote: > At 01:37 AM 8/27/2010 +0200, Armin Ronacher wrote: > To the extent we're "unsure", I think the holdup is simply that nobody > has tried doing an all-bytes WSGI implementation -- unless of course you > count all our Python 2.x experience as experience w

Re: [Web-SIG] WSGI for Python 3

2010-08-26 Thread Graham Dumpleton
On 27 August 2010 13:45, P.J. Eby wrote: > At 01:37 AM 8/27/2010 +0200, Armin Ronacher wrote: >> >> Hi, >> >> Is there a status update on that now I missed?  Did something decide on >> bytes for the environment values or are we still unsure about that? > > To the extent we're "unsure", I think the

Re: [Web-SIG] WSGI for Python 3

2010-08-26 Thread P.J. Eby
At 01:37 AM 8/27/2010 +0200, Armin Ronacher wrote: Hi, Is there a status update on that now I missed? Did something decide on bytes for the environment values or are we still unsure about that? To the extent we're "unsure", I think the holdup is simply that nobody has tried doing an all-byt

Re: [Web-SIG] WSGI for Python 3

2010-08-26 Thread Armin Ronacher
Hi, Is there a status update on that now I missed? Did something decide on bytes for the environment values or are we still unsure about that? From a discussion lately I had with Graham on #pocoo it seems like he lost interest on supporting WSGI on Python 3 for the time being due to lack of

Re: [Web-SIG] WSGI for Python 3

2010-07-20 Thread Graham Dumpleton
On Tuesday, July 20, 2010, Etienne Robillard wrote: > > > > > > > Sorry to disagree. I dont think I've misunderstood any comments in this > thread. > At least some (encoding) issues seems from happening in Windows. Can you please then point out which specific issue you are taking about? The only

Re: [Web-SIG] WSGI for Python 3

2010-07-20 Thread Graham Dumpleton
On Tuesday, July 20, 2010, Etienne Robillard wrote: > > > > > > > > > > > AFAICT, the main difference is that under a > bytes-only regime, the changes should be more consistent/mechanical, i.e., > able to be performed by relatively superficial code inspection. > > > > The problem in all these

Re: [Web-SIG] WSGI for Python 3

2010-07-19 Thread Paul Davis
On Tue, Jul 20, 2010 at 12:37 AM, Graham Dumpleton wrote: > On 19 July 2010 03:19, P.J. Eby wrote: >> At 01:01 PM 7/18/2010 +1000, Graham Dumpleton wrote: >>> >>> This is on the basis that if people are going to have to rewrite their >>> code >>> a fair bit to handle bytes everywhere, >> >> What

Re: [Web-SIG] WSGI for Python 3

2010-07-19 Thread Graham Dumpleton
On 19 July 2010 03:19, P.J. Eby wrote: > At 01:01 PM 7/18/2010 +1000, Graham Dumpleton wrote: >> >> This is on the basis that if people are going to have to rewrite their >> code >> a fair bit to handle bytes everywhere, > > What you mean by "rewrite their code a fair bit", and who is it that you

Re: [Web-SIG] WSGI for Python 3

2010-07-19 Thread Graham Dumpleton
Go back through my blog and read some of the posts there so you have some of the history. Recent discussions build on some of the stuff there and I don't think anyone has the time to keep explaining all this to every new person who comes along. Graham On Monday, July 19, 2010, Aaron Watters wrot

Re: [Web-SIG] WSGI for Python 3

2010-07-19 Thread Aaron Watters
I'm still in denial regarding Python 3 generally speaking, but it looks like something important is going on here.  Could someone summarize the main points (intelligible to a Python 2 troglodyte)? thanks in advance,  -- Aaron Watters === % man less less is more. __

Re: [Web-SIG] WSGI for Python 3

2010-07-18 Thread P.J. Eby
At 01:01 PM 7/18/2010 +1000, Graham Dumpleton wrote: This is on the basis that if people are going to have to rewrite their code a fair bit to handle bytes everywhere, What you mean by "rewrite their code a fair bit", and who is it that you think will have to do this? Or, more precisely, how

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Chris McDonough
On Fri, 2010-07-16 at 23:38 -0500, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 9:43 PM, Chris McDonough > wrote: > > > Nah, not nearly that hard: > > > > path_info = > > > > urllib.parse.unquote_to_bytes(environ['wsgi.raw_path_info']).decode('UTF-

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Graham Dumpleton
On 17 July 2010 22:30, wrote: > On Fri, 16 Jul 2010, P.J. Eby wrote: > >> At 02:28 PM 7/16/2010 -0500, Ian Bicking wrote: >> There should be one, and preferably *only* one, obvious way to do it. >> >> And given that HTTP is inherently a bunch of bytes, bytes is the one >> obvious way. > > I think

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Ian Bicking
On Sat, Jul 17, 2010 at 5:57 AM, Armin Ronacher wrote: > On 7/17/10 9:15 AM, Ian Bicking wrote: > >> This is an Apache-specific issue. It definitely doesn't apply to >> paste.httpserver, I doubt CherryPy or wsgiref. I don't really know how >> Nginx or other servers work. >> > > This will be an

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Bill Janssen
Chris McDonough wrote: > On Sat, 2010-07-17 at 01:33 +0200, Armin Ronacher wrote: > > Hi, > > > > On 7/17/10 1:20 AM, Chris McDonough wrote: > > > Let me know if I'm missing something. > > The only thing you miss is that the bytes type of Python 3 is badly > > supported in the stdlib (not an i

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread William Dode
On 17-07-2010, chris.d...@gmail.com wrote: > On Fri, 16 Jul 2010, P.J. Eby wrote: > >> At 02:28 PM 7/16/2010 -0500, Ian Bicking wrote: >> There should be one, and preferably *only* one, obvious way to do it. >> >> And given that HTTP is inherently a bunch of bytes, bytes is the one obvious >> way.

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Alan Kennedy
[PJ Eby] > IOW, the bytes/string discussion on Python-dev has kind of led me to realize > that we might just as well make the *entire* stack bytes (incoming and > outgoing headers *and* streams), and rewrite that bit in PEP 333 about using > str on "Python 3000" to say we go with bytes on Python 3+

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread chris . dent
On Fri, 16 Jul 2010, P.J. Eby wrote: At 02:28 PM 7/16/2010 -0500, Ian Bicking wrote: There should be one, and preferably *only* one, obvious way to do it. And given that HTTP is inherently a bunch of bytes, bytes is the one obvious way. I think this makes sense. The thing which is assembling

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Armin Ronacher
Hi, On 7/17/10 12:57 PM, Armin Ronacher wrote: In fact, this will be an issue for things like middlewares that want to map applications to paths. In fact, this already is an issue on Python 2 already, just that nobody cares. s/applications/serving static files from folders/ Regards, Armin ___

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Armin Ronacher
Hi, On 7/17/10 9:15 AM, Ian Bicking wrote: This is an Apache-specific issue. It definitely doesn't apply to paste.httpserver, I doubt CherryPy or wsgiref. I don't really know how Nginx or other servers work. This will be an issue for every server that... * supports unicode filesystems * de

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Graham Dumpleton
On Saturday, July 17, 2010, Ian Bicking wrote: > On Sat, Jul 17, 2010 at 12:38 AM, Graham Dumpleton > wrote: > > > On Friday, July 16, 2010, And Clover wrote: >> On 07/14/2010 06:43 AM, Ian Bicking wrote: >> >> >> There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, >> and HTTP_COOKIE. >>

Re: [Web-SIG] WSGI for Python 3

2010-07-17 Thread Ian Bicking
On Sat, Jul 17, 2010 at 12:38 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > On Friday, July 16, 2010, And Clover wrote: > > On 07/14/2010 06:43 AM, Ian Bicking wrote: > > > > > > There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, > > and HTTP_COOKIE. > > > > > > (And of thos

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Graham Dumpleton wrote: > On Saturday, July 17, 2010, Ian Bicking wrote: >> On Fri, Jul 16, 2010 at 1:40 PM, P.J. Eby wrote: >> >> >> At 11:07 AM 7/16/2010 -0500, Ian Bicking wrote: >> >> And this doesn't help with Python 3: either we have byte values of >> SCRIPT_NA

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 1:40 PM, P.J. Eby wrote: > > > At 11:07 AM 7/16/2010 -0500, Ian Bicking wrote: > > And this doesn't help with Python 3: either we have byte values of > SCRIPT_NAME and PATH_INFO in Python 3, or we have text values.  I thin

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Gustavo Narea wrote: > Hello, > > Ian said: >> Having two ways of expressing the same information will lead to bugs >> related to which data is canonical.  If an application is using >> SCRIPT_NAME/PATH_INFO and then updates those values in any way, and >> wsgi.raw_scri

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 12:28 PM, Chris McDonough wrote: > > > On Fri, 2010-07-16 at 11:07 -0500, Ian Bicking wrote: > >> And this doesn't help with Python 3: either we have byte values of >> SCRIPT_NAME and PATH_INFO in Python 3, or we have text v

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 4:33 AM, And Clover wrote: > > > On 07/14/2010 06:43 AM, Ian Bicking wrote: > > > There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, > and HTTP_COOKIE. > > > > (And of those, PATH_INFO is the only one that really mat

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Friday, July 16, 2010, And Clover wrote: > On 07/14/2010 06:43 AM, Ian Bicking wrote: > > > There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, > and HTTP_COOKIE. > > > (And of those, PATH_INFO is the only one that really matters, in that no-one > really uses non-ASCII script filenames,

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 9:43 PM, Chris McDonough wrote: > > Nah, not nearly that hard: > > > > path_info = > > > urllib.parse.unquote_to_bytes(environ['wsgi.raw_path_info']).decode('UTF-8') > > > > I don't see the problem? If you want to distinguish %2f from /, then > > you'll do it slightly dif

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 11:28 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > Nah, not nearly that hard: > > > > path_info = > urllib.parse.unquote_to_bytes(environ['wsgi.raw_path_info']).decode('UTF-8') > > > > I don't see the problem? If you want to distinguish %2f from /, then >

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Saturday, July 17, 2010, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 6:20 PM, Chris McDonough wrote: > > > >> What are the concrete problems you envision with text request headers, >> text (URL-quoted) path, and text response status and headers? > > Documentation is the main reason.  For exam

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Chris McDonough
On Fri, 2010-07-16 at 20:46 -0500, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 6:20 PM, Chris McDonough > wrote: > > What are the concrete problems you envision with text > request headers, > > text (URL-quoted) path, and text response status and > headers? >

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 8:46 PM, Ian Bicking wrote: > So... before jumping to conclusions, what's the hard part with using text? > Oh, the one thing that will be silly is cookies, but they are totally nuts already. They can be parsed equally well as bytes or latin1, and best only transcoded aft

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 6:20 PM, Chris McDonough wrote: > > What are the concrete problems you envision with text request headers, > > text (URL-quoted) path, and text response status and headers? > > Documentation is the main reason. For example, the documentation for > making sense of path_in

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Chris McDonough
On Sat, 2010-07-17 at 01:33 +0200, Armin Ronacher wrote: > Hi, > > On 7/17/10 1:20 AM, Chris McDonough wrote: > > Let me know if I'm missing something. > The only thing you miss is that the bytes type of Python 3 is badly > supported in the stdlib (not an issue if we reimplement everything in >

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 P.J. Eby wrote: > At 07:20 PM 7/16/2010 -0400, Chris McDonough wrote: >> I'd much rather say be able to say: >> >> """ >> The PATH_INFO environment variable is a ``bytes-with-benefits`` type. >> To decode it: >> >> - First, split it on slashes:: >> >>

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Armin Ronacher
Hi, On 7/17/10 1:20 AM, Chris McDonough wrote: > Let me know if I'm missing something. The only thing you miss is that the bytes type of Python 3 is badly supported in the stdlib (not an issue if we reimplement everything in our libraries, not an issue for me) and that the bytes type has no st

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread P.J. Eby
At 07:20 PM 7/16/2010 -0400, Chris McDonough wrote: I'd much rather say be able to say: """ The PATH_INFO environment variable is a ``bytes-with-benefits`` type. To decode it: - First, split it on slashes:: segments = PATH_INFO.split('/') - Then, de-encode each segment's urlencoded portio

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread P.J. Eby
At 05:42 PM 7/16/2010 -0400, Tres Seaver wrote: P.J. Eby wrote: > (Hm. Although actually, I suppose we *could* just borrow the time > machine and pretend that WSGI called for "byte-strings everywhere" > all along...) I like the idea of pushing responsibility for decoding stuff into the framewo

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread P.J. Eby
At 02:28 PM 7/16/2010 -0500, Ian Bicking wrote: On Fri, Jul 16, 2010 at 1:40 PM, P.J. Eby <p...@telecommunity.com> wrote: At 11:07 AM 7/16/2010 -0500, Ian Bicking wrote: And this doesn't help with Python 3: either we have byte values of SCRIPT_NAME and PATH_INFO i

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Chris McDonough
On Fri, 2010-07-16 at 17:11 -0500, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 5:08 PM, Chris McDonough > wrote: > On Fri, 2010-07-16 at 17:47 -0400, Tres Seaver wrote: > > > > In the past when we've gotten down to specifics, the only > holdup has been > >

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 5:06 PM, Ian Bicking wrote: > On Fri, Jul 16, 2010 at 4:47 PM, Tres Seaver wrote: > >> > Basically all the internal strings are textish, so we're left with: >> >> What do you mean by "internal"? Anything in the headers or the CGI >> environment is intrinsically "bytes-is

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 5:08 PM, Chris McDonough wrote: > On Fri, 2010-07-16 at 17:47 -0400, Tres Seaver wrote: > > > > In the past when we've gotten down to specifics, the only holdup has > been > > > SCRIPT_NAME/PATH_INFO, hence my suggestion to eliminate those. > > > > I think I favor PJE's su

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Chris McDonough
On Fri, 2010-07-16 at 17:47 -0400, Tres Seaver wrote: > > In the past when we've gotten down to specifics, the only holdup has been > > SCRIPT_NAME/PATH_INFO, hence my suggestion to eliminate those. > > I think I favor PJE's suggestion: let WSGI deal only in bytes. I'd prefer that WSGI 2 was de

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 4:47 PM, Tres Seaver wrote: > > Basically all the internal strings are textish, so we're left with: > > What do you mean by "internal"? Anything in the headers or the CGI > environment is intrinsically "bytes-ish" to me. Do you mean that you > want application programme

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ian Bicking wrote: >> IOW, the bytes/string discussion on Python-dev has kind of led me to >> realize that we might just as well make the *entire* stack bytes (incoming >> and outgoing headers *and* streams), and rewrite that bit in PEP 333 about >> u

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 P.J. Eby wrote: > (Hm. Although actually, I suppose we *could* just borrow the time > machine and pretend that WSGI called for "byte-strings everywhere" > all along...) I like the idea of pushing responsibility for decoding stuff into the framewor

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Gustavo Narea
Gustavo said: > - On ingress, if the charset is not specified in the request, it will > assume it's the one used by the other application, and thus it will > convert the request using the charset supported by the wrapped > application. That should actually be: "On ingress, if the charset in wsg

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 1:40 PM, P.J. Eby wrote: > At 11:07 AM 7/16/2010 -0500, Ian Bicking wrote: > >> And this doesn't help with Python 3: either we have byte values of >> SCRIPT_NAME and PATH_INFO in Python 3, or we have text values. I think >> bytes will be more awkward to port to than text

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Gustavo Narea
Hello, Ian said: > Having two ways of expressing the same information will lead to bugs > related to which data is canonical. If an application is using > SCRIPT_NAME/PATH_INFO and then updates those values in any way, and > wsgi.raw_script_name/wsgi.raw_path_info are present, then there will be

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Stephan Richter
On Friday, July 16, 2010, Ian Bicking wrote: > We could make everything bytes and be done with it, but it would make it > much harder to port Python 2 WSGI code to Python 3. I think this might be best having seen all of the discussion. One could easily write a compatibility middleware that makes

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread P.J. Eby
At 11:07 AM 7/16/2010 -0500, Ian Bicking wrote: And this doesn't help with Python 3: either we have byte values of SCRIPT_NAME and PATH_INFO in Python 3, or we have text values. I think bytes will be more awkward to port to than text, and inconsistent with other WSGI values. OTOH, it has th

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 12:28 PM, Chris McDonough wrote: > On Fri, 2010-07-16 at 11:07 -0500, Ian Bicking wrote: > > > And this doesn't help with Python 3: either we have byte values of > > SCRIPT_NAME and PATH_INFO in Python 3, or we have text values. I > > think bytes will be more awkward to p

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Chris McDonough
On Fri, 2010-07-16 at 11:07 -0500, Ian Bicking wrote: > And this doesn't help with Python 3: either we have byte values of > SCRIPT_NAME and PATH_INFO in Python 3, or we have text values. I > think bytes will be more awkward to port to than text, and > inconsistent with other WSGI values. If we

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Ian Bicking
On Fri, Jul 16, 2010 at 4:33 AM, And Clover wrote: > On 07/14/2010 06:43 AM, Ian Bicking wrote: > > There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, >> and HTTP_COOKIE. >> > > (And of those, PATH_INFO is the only one that really matters, in that > no-one really uses non-ASCII script fi

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread And Clover
On 07/16/2010 12:07 PM, Graham Dumpleton wrote: If you do that, one has to ask the question, given it is more convention than anything, why it isn't just a x-wsgiorg extension specification Yes, fine by me either way. I just want to be able to say "this application can use Unicode paths when

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread Graham Dumpleton
On Friday, July 16, 2010, And Clover wrote: > On 07/14/2010 06:43 AM, Ian Bicking wrote: > > > There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, > and HTTP_COOKIE. > > > (And of those, PATH_INFO is the only one that really matters, in that no-one > really uses non-ASCII script filenames,

Re: [Web-SIG] WSGI for Python 3

2010-07-16 Thread And Clover
On 07/14/2010 06:43 AM, Ian Bicking wrote: There's only a couple tricky keys: SCRIPT_NAME, PATH_INFO, and HTTP_COOKIE. (And of those, PATH_INFO is the only one that really matters, in that no-one really uses non-ASCII script filenames, and non-ASCII characters in Cookie/Set-Cookie are still

Re: [Web-SIG] WSGI for Python 3

2010-07-13 Thread Ian Bicking
On Wed, Jul 14, 2010 at 12:19 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > >> * I (re)propose we eliminate SCRIPT_NAME and PATH_INFO and replace them > >> exclusively with encoded versions (that represent the original request > >> URI). We use Latin1 encoding, but it should be ASC

Re: [Web-SIG] WSGI for Python 3

2010-07-13 Thread Graham Dumpleton
On 14 July 2010 15:18, Ian Bicking wrote: > On Wed, Jul 14, 2010 at 12:04 AM, Graham Dumpleton > wrote: >> >> On 14 July 2010 14:43, Ian Bicking wrote: >> > So... there's been some discussion of WSGI on Python 3 lately.  I'm not >> > feeling as pessimistic as some people, I feel like we were clo

Re: [Web-SIG] WSGI for Python 3

2010-07-13 Thread Graham Dumpleton
On 14 July 2010 15:04, Graham Dumpleton wrote: > On 14 July 2010 14:43, Ian Bicking wrote: >> So... there's been some discussion of WSGI on Python 3 lately.  I'm not >> feeling as pessimistic as some people, I feel like we were close but just >> didn't *quite* get there. > > What I took from the

Re: [Web-SIG] WSGI for Python 3

2010-07-13 Thread Ian Bicking
On Wed, Jul 14, 2010 at 12:04 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > On 14 July 2010 14:43, Ian Bicking wrote: > > So... there's been some discussion of WSGI on Python 3 lately. I'm not > > feeling as pessimistic as some people, I feel like we were close but just > > didn't

Re: [Web-SIG] WSGI for Python 3

2010-07-13 Thread Graham Dumpleton
On 14 July 2010 14:43, Ian Bicking wrote: > So... there's been some discussion of WSGI on Python 3 lately.  I'm not > feeling as pessimistic as some people, I feel like we were close but just > didn't *quite* get there. What I took from the discussion wasn't that one couldn't specify a WSGI inter

[Web-SIG] WSGI for Python 3

2010-07-13 Thread Ian Bicking
So... there's been some discussion of WSGI on Python 3 lately. I'm not feeling as pessimistic as some people, I feel like we were close but just didn't *quite* get there. Here's my thoughts: * Everyone agrees keys in the environ should be native strings * Bodies should stay bytes * Can we make a