Message78738
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 character, the same doesn't really apply to bytes in Python 3.0. This
is because iterating over bytes yields an int fdor each item.
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, but for
bytes returned as iterable, should fail.
Not sure how this plays out in wsgiref server yet as haven't looked.
Anyway, make the validator code:
@@ -426,6 +436,6 @@
# Technically a string is legal, which is why it's a really bad
# idea, because it may cause the response to be returned
# character-by-character
- assert_(not isinstance(iterator, str),
+ assert_(not isinstance(iterator, (str, bytes)),
"You should not return a string as your application iterator, "
"instead return a single-item list containing that string.")
quite a good thing to have. |
|
Date |
User |
Action |
Args |
2009-01-01 23:20:37 | grahamd | set | recipients:
+ grahamd, pje, hdima, pitrou |
2009-01-01 23:20:36 | grahamd | set | messageid: <1230852036.91.0.153383854132.issue4718@psf.upfronthosting.co.za> |
2009-01-01 23:20:36 | grahamd | link | issue4718 messages |
2009-01-01 23:20:35 | grahamd | create | |
|