Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'causing': 0.04; 'subject:Python': 0.06; 'failing': 0.07; 'alter': 0.09; 'anymore.': 0.09; 'line:': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; 'open()': 0.16; 'sorts': 0.16; 'subject:Unicode': 0.16; 'subject:issue': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'seems': 0.21; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'error': 0.23; 'unicode': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'skip:" 40': 0.26; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'host': 0.29; 'testing': 0.29; 'strongly': 0.30; 'work.': 0.31; 'code': 0.31; 'anyone': 0.31; 'subject:with': 0.35; 'except': 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; '2.6': 0.36; 'wrong': 0.37; 'skip:o 20': 0.38; 'problems': 0.38; 'pm,': 0.38; 'quote': 0.39; 'even': 0.60; 'ian': 0.60; 'solve': 0.60; 'from:no real name:2**0': 0.61; 'believe': 0.68; 'production': 0.68; '8bit%:92': 0.71; '8bit%:100': 0.72; 'obvious': 0.74; 'isu': 0.84; '2013': 0.98 X-Received: by 10.49.0.48 with SMTP id 16mr10723qeb.6.1365563772636; Tue, 09 Apr 2013 20:16:12 -0700 (PDT) Newsgroups: comp.lang.python Date: Tue, 9 Apr 2013 20:16:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.68.69.168; posting-account=hGu1uQoAAACZy7LiR653nG0NwqDrTyoS References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 94.68.69.168 MIME-Version: 1.0 Subject: Re: Unicode issue with Python v3.3 From: nagia.retsina@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 61 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365563775 news.xs4all.nl 2630 [2001:888:2000:d::a6]:42743 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43245 =CE=A4=CE=B7 =CE=A4=CE=B5=CF=84=CE=AC=CF=81=CF=84=CE=B7, 10 =CE=91=CF=80=CF= =81=CE=B9=CE=BB=CE=AF=CE=BF=CF=85 2013 12:34:25 =CF=80.=CE=BC. UTC+3, =CE= =BF =CF=87=CF=81=CE=AE=CF=83=CF=84=CE=B7=CF=82 Ian =CE=AD=CE=B3=CF=81=CE=B1= =CF=88=CE=B5: > On Tue, Apr 9, 2013 at 3:10 PM, =CE=9D=CE=AF=CE=BA=CE=BF=CF=82 =CE=93=CE= =BA=CF=8133=CE=BA wrote: >=20 > > Hello, iam still trying to alter the code form python 2.6 =3D> 3.3 >=20 > > >=20 > > Everyrging its setup except that unicode error that you can see if you = go to http://superhost.gr >=20 > > >=20 > > Can anyone help with this? >=20 > > I even tried to change print() with sys.stdout.buffer() but still i get= the same unicode issue. >=20 > > >=20 > > I don't know what to try anymore. >=20 >=20 >=20 > It seems to be failing on the line: >=20 >=20 >=20 > host =3D socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] >=20 >=20 >=20 > So the obvious question to ask is: what are the contents of >=20 > os.environ['REMOTE_ADDR'] when this line is reached? >=20 >=20 >=20 > And why are you still trying to solve these sorts of problems on your >=20 > production website? Do you not have a development or staging >=20 > environment? 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(). Thoese= are causing the unicode isu es much like as thes changes from: quote =3D random.choice( list( open( "/home/nikos/www/data/private/quotes.t= xt", ) ) ) quote =3D random.choice( list( open( "/home/nikos/www/data/private/quotes.t= xt", encoding=3D"utf-8" ) ) ) in order for the open() to work.