Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Serhiy Storchaka
21.04.13 16:46, Chris Angelico написав(ла): Also, it's expecting bytes everywhere, and I can't find a simple way to declare an encoding and let self.wfile.write() accept str. Do I have to explicitly encode everything that I write, or is there a cleaner way? io.TextIOWrapper -- http://mail.pyt

Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Chris Angelico
On Mon, Apr 22, 2013 at 12:01 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> In the current version of the code, I use BaseHTTPServer as the main >> structure of the request handler. 2to3 translated this into >> http.server, which seems to be the nearest direct translation. But

Re: Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Roy Smith
In article , Chris Angelico wrote: > In the current version of the code, I use BaseHTTPServer as the main > structure of the request handler. 2to3 translated this into > http.server, which seems to be the nearest direct translation. But is > that the best way to go about making a simple HTTP ser

Porting 2.x to 3.3: BaseHTTPServer

2013-04-21 Thread Chris Angelico
I'm porting an old project to Python 3, with the intention of making one codebase that will still run on 2.6/2.7 as well as 3.2+ (or 3.3+, if 3.2 is in any way annoying). My first step was to run the code through 2to3, and the basics are already sorted out by that. Got one question though, and it's