On Thu, Oct 16, 2014 at 11:31 PM, Albert-Jan Roskam <fo...@yahoo.com> wrote: > Most things were indeed easy to solve. But this one surprised me. With Python > 2.6, I need to outcomment the 'lambda' line. The error is what I get in > Python 2.6. It does not matter if I do u"\n".join(het_logboek[i:]). I don't > use latin-1 anywhere in my program. I need to convert unicode to bytes in > Python 2.6, or else it chokes in the smart quote. >
Hmm, that looks like a configuration difference between the two, rather than a major breaking difference. It'll depend on the console settings; if you're running 2.6 from cron, but 2.7 from the console (or the other way around), you'll see stuff like this break. It's also possible that a bug was discovered, of course, but what exactly the bug is, I can't say. The error you're seeing is perfectly correct: you have Unicode character U+2018 (a curly quote) in your stream, and the print statement is trying to send that to a Latin-1 output, and that's not going to work. The question is, why is your console believed to be set to Latin-1? And if encoding UTF-8 works, then there's something very VERY wrong. (Unless by "works" you just mean "doesn't throw an error", and the UTF-8 bytes are being interpreted as Latin-1 bytes.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list