Altering 2 statements from Python 2.6 => 3.2

Chris Angelico rosuav at
Wed Mar 27 23:55:11 CET 2013

On Thu, Mar 28, 2013 at 7:18 AM, Νίκος Γκρ33κ <nikos.gr33k at> wrote:
> date = 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 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:

One of Python 3's big features is that it forces you to distinguish
text strings from binary ones.


More information about the Python-list mailing list