Re: [Python-Dev] teaching the new urllib

2009-02-04 Thread python-3000
On Tue, Feb 03, 2009 at 06:50:44PM -0500, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The encoding information *is* available in the response headers, e.g.: - -- % - $ wget -S --spider

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Benjamin Peterson
On Tue, Feb 3, 2009 at 2:08 PM, Brad Miller millb...@luther.edu wrote: Here's the iteration problem: 'b\'!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN\\n\'' for line in page: print(line) Traceback (most recent call last): File pyshell#10, line 1, in module for line in

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
İsmail Dönmez ism...@namtrac.org wrote: Hi, On Tue, Feb 3, 2009 at 21:56, Brett Cannon br...@python.org wrote: Probably the biggest issue will be having to explain string encoding. Obviously you can gloss over it or provide students with a simple library that just automatically converts

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brett Cannon wrote: On Tue, Feb 3, 2009 at 11:08, Brad Miller millb...@luther.edu wrote: I'm just getting ready to start the semester using my new book (Python Programming in Context) and noticed that I somehow missed all the changes to urllib in

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Daniel (ajax) Diniz
Tres Seaver wrote: Brett Cannon wrote: No because you are getting back the repr for the bytes object. Str does not know what the encoding is for the bytes so it has no way of performing the decoding. The encoding information *is* available in the response headers, e.g.: [snip] That's the

[Python-Dev] teaching the new urllib

2009-02-03 Thread Brad Miller
I'm just getting ready to start the semester using my new book (Python Programming in Context) and noticed that I somehow missed all the changes to urllib in python 3.0. ARGH to say the least. I like using urllib in the intro class because we can get data from places that are more

[Python-Dev] teaching the new urllib

2009-02-03 Thread Brad Miller
I'm just getting ready to start the semester using my new book (Python Programming in Context) and noticed that I somehow missed all the changes to urllib in python 3.0. ARGH to say the least. I like using urllib in the intro class because we can get data from places that are more

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Brett Cannon
On Tue, Feb 3, 2009 at 15:50, Tres Seaver tsea...@palladion.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brett Cannon wrote: On Tue, Feb 3, 2009 at 11:08, Brad Miller millb...@luther.edu wrote: I'm just getting ready to start the semester using my new book (Python Programming in

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
Brett Cannon br...@python.org wrote: On Tue, Feb 3, 2009 at 15:50, Tres Seaver tsea...@palladion.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brett Cannon wrote: On Tue, Feb 3, 2009 at 11:08, Brad Miller millb...@luther.edu wrote: I'm just getting ready to start the