Unicode issue with Python v3.3

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Apr 10 00:25:21 EDT 2013


On Tue, 09 Apr 2013 20:16:12 -0700, nagia.retsina wrote:

> Τη Τετάρτη, 10 Απριλίου 2013 12:34:25 π.μ. UTC+3, ο χρήστης Ian έγραψε:
>> On Tue, Apr 9, 2013 at 3:10 PM, Νίκος Γκρ33κ <nikos.gr33k at gmail.com>
>> wrote:
>> 
>> > Hello, iam still trying to alter the code form python 2.6 => 3.3
>> >
>> > Everyrging its setup except that unicode error that you can see if
>> > you go to http://superhost.gr
>> >
>> > Can anyone help with this?
>> 
>> > I even tried to change print() with sys.stdout.buffer() but still i
>> > get the same unicode issue.
>> >
>> > I don't know what to try anymore.
>> 
>> 
>> 
>> It seems to be failing on the line:
>> 
>> host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
>> 
>> So the obvious question to ask is: what are the contents of
>> 
>> os.environ['REMOTE_ADDR'] when this line is reached?
[...]

> No forget this line. this is not the problem. No i don't have  a testing
> enviroment, i altered all the code form 2.6 to 3.3 in the live
> enviromtnt.
> 
> i strongly believe there is somethign goind wrong with the prints().


Obviously you know what the problem is much better than the Python 
interpreter.

I suggest you open a bug report:

"Errors printing bytes are wrongly claimed to be socket errors"

and see what happens.

Or, you can listen to people who actually know what they are talking 
about, and look at the actual error, which has NOTHING to do with print.

What does os.environ['REMOTE_ADDR'] give? Until you answer that question, 
you won't make any progress.



-- 
Steven



More information about the Python-list mailing list