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 http://knuth.luther.e

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
Brett Cannon wrote: > On Tue, Feb 3, 2009 at 15:50, Tres Seaver wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Brett Cannon wrote: > >> On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: > >>> I'm just getting ready to start the semester using my new book (Python > >>> Progr

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Brett Cannon
On Tue, Feb 3, 2009 at 15:50, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Brett Cannon wrote: >> On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: >>> I'm just getting ready to start the semester using my new book (Python >>> Programming in Context) and noticed that I

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'

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 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 python 3.0.

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
İsmail Dönmez wrote: > Hi, > > On Tue, Feb 3, 2009 at 21:56, Brett Cannon 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 the strings. Or even bett

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Benjamin Peterson
On Tue, Feb 3, 2009 at 2:08 PM, Brad Miller wrote: > Here's the iteration problem: > 'b\'>>> for line in page: > print(line) > Traceback (most recent call last): > File "", line 1, in > for line in page: > TypeError: 'addinfourl' object is not iterable > Why is this not iterable anymore? I

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread İsmail Dönmez
Hi, On Tue, Feb 3, 2009 at 21:56, Brett Cannon 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 the strings. Or even better, > provide some code for the sta

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Brett Cannon
On Tue, Feb 3, 2009 at 11:08, Brad Miller 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 python 3.0. ARGH to say the least. I like using urllib in the > intro class because