Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'charset:iso-8859-7': 0.04; 'subject:Python': 0.06; 'binary': 0.07; 'string': 0.09; 'url:unicode': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'trying': 0.19; 'thu,': 0.19; 'mind.': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'start,': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'forces': 0.31; 'ones.': 0.31; 'figure': 0.32; 'text': 0.33; 'subject:from': 0.34; 'received:209.85': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; 'here:': 0.62; 'mar': 0.68; 'distinguish': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=T1JneywNE4OomHZJsT56USGOaryi36lKTO/jkmqTs/A=; b=bW6VvF4jNB7W5t1VZog4tZ8Acb5j2EHomV3IHjaBEROYxuaw3WCO1tMQLgDQ02imZJ jbZNaswV5e9Q40yu9n766xm27emT7MoFu7dw9mB9q0RcZ1sxwelQq3O6F02iaokHEcuE KAXY2iTY6X2E/v2UcEFf77aP9mzeRnLUd0I7wmC+xaJ3Pi4uwQjl9h36+KcYMtivHvHG 5cMY5ayiMN5QPXS4NZ/8kUhjNtJ06abN468kjWciRmfkwckU07L9SQfimtZCQLe3b1A0 MQaDqOvHpcTnmEHUKIi9QwrEIEBLWV8VzvfCU0Kzpf3+l7UrVZSyNKDiVRiEqp9Rn5dm GjCQ== MIME-Version: 1.0 X-Received: by 10.220.88.145 with SMTP id a17mr25193615vcm.66.1364424911898; Wed, 27 Mar 2013 15:55:11 -0700 (PDT) In-Reply-To: <73865aec-bee1-4aea-b8b4-28a4cad24473@googlegroups.com> References: <73865aec-bee1-4aea-b8b4-28a4cad24473@googlegroups.com> Date: Thu, 28 Mar 2013 09:55:11 +1100 Subject: Re: Altering 2 statements from Python 2.6 => 3.2 From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable 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: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364424914 news.xs4all.nl 6870 [2001:888:2000:d::a6]:49398 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42047 On Thu, Mar 28, 2013 at 7:18 AM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: > date =3D date.strftime('%A, %e %b %Y').decode('cp1253').encode('utf8') For a start, figure out what you're trying to do. I'm trying to get my head around this line and I'm not getting anywhere. Is 'date' an instance of datetime.date()? And whatever it is, why do you then immediately rebind it? And why decode an arbitrary string using an arbitrary encoding? And why.... never mind. Start here: http://www.joelonsoftware.com/articles/Unicode.html One of Python 3's big features is that it forces you to distinguish text strings from binary ones. ChrisA