[issue4718] wsgiref package totally broken

2009-01-31 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I assume the buildbots were placated? -- nosy: +benjamin.peterson resolution: accepted - fixed status: pending - closed ___ Python tracker rep...@bugs.python.org

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It is committed now in py3k and the 3.0 maintenance branch. Thanks all for your participation! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Reopening, the patch actually produces failures when run with python -bb, that is there are comparisons between str and bytes. See the errors at the end of

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: People, does this patch look ok to you? Added file: http://bugs.python.org/file12573/wsgiref-bb.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2009-01-03 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: People, does this patch look ok to you? Oh, didn't know about -bb. The patch looks OK for me. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le samedi 03 janvier 2009 à 20:24 +, Dmitry Vasiliev a écrit : Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: People, does this patch look ok to you? Oh, didn't know about -bb. Well, it's meant to catch

[issue4718] wsgiref package totally broken

2009-01-03 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: There's another problem in that buildbot failure with the environment variable NO_PROXY. We'll see if it's still there after the patch. Strange error and it seems there is only part of the traceback. I've already seen

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Strange error and it seems there is only part of the traceback. I've already seen such partially displayed Python 3 traceback and error actually can be in very different place. If you can reproduce such a problem, please open a bug.

[issue4718] wsgiref package totally broken

2009-01-03 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: Strange error and it seems there is only part of the traceback. I've already seen such partially displayed Python 3 traceback and error actually can be in very different place. If you can reproduce such a problem,

[issue4718] wsgiref package totally broken

2009-01-03 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Attached patch for test_urllib, possible source of the NO_PROXY problem. Added file: http://bugs.python.org/file12577/no_proxy.patch ___ Python tracker rep...@bugs.python.org

[issue4718] wsgiref package totally broken

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Nice catch! I've committed the two patches and we'll see whether it makes the buildbots feel better. -- resolution: - accepted stage: patch review - committed/rejected status: open - pending ___

[issue4718] wsgiref package totally broken

2009-01-02 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Graham Dumpleton wrote: Thus have odd situation where with Python 3.0, one could technically return str as iterable, with rule that would apply would be that each str returned would then be converted to bytes by way of latin-1 conversion,

[issue4718] wsgiref package totally broken

2009-01-01 Thread Graham Dumpleton
Graham Dumpleton graham.dumple...@gmail.com added the comment: One interesting thing of note that has occurred to me looking at the patch is that although with Python 3.0 you technically could return a str as iterable from application, ie., because iteration over str returns str for each

[issue4718] wsgiref package totally broken

2008-12-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Philip, Graham, do you have any objections to the current patch? Otherwise I think I'm gonna commit it soon. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-27 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: The patch looks ok to me, although the tests against mutable byte-like types are probably useless. Hmm, it's strange because such tests was removed two versions ago (per discussion with Phillip). But at the time they

[issue4718] wsgiref package totally broken

2008-12-27 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: Hmm, it's strange because such tests was removed two versions ago (per discussion with Phillip). But at the time they really was needed. Not a big deal anyway, let's keep them and we'll see. I'm afraid I've lost

[issue4718] wsgiref package totally broken

2008-12-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Why do you say they were removed? I see code like assert isinstance(value, bytes). ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-27 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: Why do you say they were removed? I see code like assert isinstance(value, bytes). Support and tests for mutable bytearray and memoryview was removed. All subclasses of bytes must be immutable so isinstance() should be

[issue4718] wsgiref package totally broken

2008-12-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Ok, sorry for the misunderstanding. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___ ___

[issue4718] wsgiref package totally broken

2008-12-26 Thread Graham Dumpleton
Graham Dumpleton graham.dumple...@gmail.com added the comment: If making changes in wsgireg.validate, may be worthwhile also fixing up one area where it isn't strictly correct according to WSGI PEP. As per discussion:

[issue4718] wsgiref package totally broken

2008-12-26 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Graham Dumpleton wrote: the check for number of arguments supplied to wsgi.input.read() is wrong as it allows for an optional argument, when argument is supposed to mandatory. I think it's a good idea. I'll update the patch soon.

[issue4718] wsgiref package totally broken

2008-12-26 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Added check for wsgi.input.read() argument. Added file: http://bugs.python.org/file12454/wsgiref2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hi, The patch looks ok to me, although the tests against mutable byte-like types are probably useless. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-25 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Phillip J. Eby wrote: Graham: thanks for pointing that out; I completely forgot we already *had* the migration discussion on the Web-SIG! It just slipped my mind because I didn't have any 3.0 work on the horizon. Good to see we came to

[issue4718] wsgiref package totally broken

2008-12-25 Thread Dmitry Vasiliev
Changes by Dmitry Vasiliev d...@hlabs.spb.ru: Removed file: http://bugs.python.org/file12439/wsgiref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-25 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Attached updated version of the patch. Added file: http://bugs.python.org/file12447/wsgiref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-24 Thread Dmitry Vasiliev
Changes by Dmitry Vasiliev d...@hlabs.spb.ru: Removed file: http://bugs.python.org/file12423/wsgiref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-24 Thread Dmitry Vasiliev
Changes by Dmitry Vasiliev d...@hlabs.spb.ru: Removed file: http://bugs.python.org/file12429/wsgiref2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-24 Thread Dmitry Vasiliev
Changes by Dmitry Vasiliev d...@hlabs.spb.ru: Removed file: http://bugs.python.org/file12431/wsgiref_pep333.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-24 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Attached new WSGI 1.0+ version of the patch. Added file: http://bugs.python.org/file12439/wsgiref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-24 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: Graham: thanks for pointing that out; I completely forgot we already *had* the migration discussion on the Web-SIG! It just slipped my mind because I didn't have any 3.0 work on the horizon. Dmitry: A question about the new patch. Are

[issue4718] wsgiref package totally broken

2008-12-23 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: OK, I've attached PEP-333 compatible fixes for wsgiref. I think there is only one problem remains: - wsgiref expects io.BytesIO as input and output streams because of http.server module. I didn't find any restrictions on data returned by

[issue4718] wsgiref package totally broken

2008-12-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Please read the two paragraphs *after* the one you quoted. I don't see anything forbidding bytes objects in those two paragraphs. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718

[issue4718] wsgiref package totally broken

2008-12-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mardi 23 décembre 2008 à 11:15 +, Dmitry Vasiliev a écrit : Dmitry Vasiliev d...@hlabs.spb.ru added the comment: OK, I've attached PEP-333 compatible fixes for wsgiref. I may be mistaken, but it seems that your patch forces iso-8859-1

[issue4718] wsgiref package totally broken

2008-12-23 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: Le mardi 23 décembre 2008 à 11:15 +, Dmitry Vasiliev a écrit : OK, I've attached PEP-333 compatible fixes for wsgiref. I may be mistaken, but it seems that your patch forces iso-8859-1 encoding of http bodies.

[issue4718] wsgiref package totally broken

2008-12-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: No, just as PEP said str used as a container for binary data. This is clearly the wrong thing to do. The only (immutable) string-like object adequate for binary data in py3k is bytes, not str. I understand the desire to stick to the PEP, but

[issue4718] wsgiref package totally broken

2008-12-23 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: Antoine, you have three choices here: 1. Follow the PEP, 2. Take it to the Web-SIG and get the appropriate discussion, consensus, and PEP revision, or 3. Drop wsgiref from the current release of Py3K until #2 can be done. Which would

[issue4718] wsgiref package totally broken

2008-12-23 Thread Graham Dumpleton
Graham Dumpleton graham.dumple...@gmail.com added the comment: Note that the page: http://www.wsgi.org/wsgi/Amendments_1.0 contains clarifications for WSGI PEP in respect of Python 3.0. This list was previously come up with on WEB-SIG list. As another reference implementation for Python 3.0,

[issue4718] wsgiref package totally broken

2008-12-22 Thread Dmitry Vasiliev
New submission from Dmitry Vasiliev d...@hlabs.spb.ru: It seems the wsgiref package was copied from Python 2.* without any modifications. There are already 3 issues about that but they only describe a part of the problem so I decided to start a new one. The issues was:

[issue4718] wsgiref package totally broken

2008-12-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Phillip, do you have time to take a look at it? We really *must* fix wsgiref in py3k... -- nosy: +pitrou, pje priority: - critical ___ Python tracker rep...@bugs.python.org

[issue4718] wsgiref package totally broken

2008-12-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: FYI, instead of trying to do exhaustive type checking in _check_type(), you can just rely on duck typing and catch the TypeError: str(ba, utf-8) 'a' str(bytearray(ba), utf-8) 'a' str(memoryview(ba), utf-8) 'a' str(1, utf-8) Traceback (most

[issue4718] wsgiref package totally broken

2008-12-22 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: If you want to change to using bytes, you're going to have to take it to the Web-SIG and hash out a revision to PEP 333, which at the moment requires the use of strings, period. This has nothing to do with the desirability of bytes vs.

[issue4718] wsgiref package totally broken

2008-12-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If you want to change to using bytes, you're going to have to take it to the Web-SIG and hash out a revision to PEP 333, which at the moment requires the use of strings, period. What was called str in 2.x has become the bytes object in py3k.

[issue4718] wsgiref package totally broken

2008-12-22 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: FYI, instead of trying to do exhaustive type checking in _check_type(), you can just rely on duck typing and catch the TypeError: Good point! I'll update the patch soon. ___ Python

[issue4718] wsgiref package totally broken

2008-12-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- priority: critical - release blocker stage: - patch review versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4718 ___

[issue4718] wsgiref package totally broken

2008-12-22 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: Antoine Pitrou wrote: If you want to change to using bytes, you're going to have to take it to the Web-SIG and hash out a revision to PEP 333, which at the moment requires the use of strings, period. What was called str in 2.x has become

[issue4718] wsgiref package totally broken

2008-12-22 Thread Dmitry Vasiliev
Dmitry Vasiliev d...@hlabs.spb.ru added the comment: New version of the patch: - Now only Unicode strings are allowed as status and headers because allowing bytes leads to big changes in wsgiref.validate and wsgiref.handlers; -- versions: -Python 3.1 Added file:

[issue4718] wsgiref package totally broken

2008-12-22 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: At 03:37 PM 12/22/2008 +, Antoine Pitrou wrote: So, not accepting bytes in py3k is clearly a violation of the PEP! On the contrary. Please read the two paragraphs *after* the one you quoted. ___

[issue4718] wsgiref package totally broken

2008-12-22 Thread Phillip J. Eby
Phillip J. Eby p...@telecommunity.com added the comment: To be quite clear: this change requires discussion on the Web-SIG and an appropriate revision of the PEP. Ideally, the patch should include the necessary PEP revision. The Web-SIG discussion regarding a switch to bytes should also take