opensubscriber
   Find in this group all groups
 
Unknown more information…

w : web-sig@python.org 7 January 2011 • 2:19PM -0500

Re: [Web-SIG] Declaring PEP 3333 accepted (was: PEP 444 != WSGI 2.0)
by Alice Bevan–McGregor

REPLY TO AUTHOR
 
REPLY TO GROUP




On 2011-01-06 22:00:17 -0800, Graham Dumpleton said:
> -    environ = {k: wsgi_string(v) for k,v in os.environ.items()}
> +    environ = {k: wsgi_string(v) for k,v in list(os.environ.items())}

2to3 takes the conservative route of assuming your application treats
dict.items() as a list in all cases; this is not nessicarily true (of
course), but it is safe, and interestingly, backwards compatible.

> -                    raise exc_info[0], exc_info[1], exc_info[2]
> +                    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])

The exception raising syntax has changed; you can not re-raise an
exception using tuple notation any more.  The new syntax is far
clearer, but I'm unsure of back-compatibility or even if it is possible
to emulate it completely as a polygot (2.x and 3.x w/ same code).

- Alice.


_______________________________________________
Web-SIG mailing list
Web-SIG@pyth...
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/subscriber%40opensubscriber.com

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.