[pacman-dev] [PATCH v2 5/8] Avoid problematic use of Python's StringIO.

Jeremy Heiner scalaprotractor at gmail.com
Mon Oct 14 18:38:12 EDT 2013


On Mon, Oct 14, 2013 at 4:48 PM, Martin Panter <vadmium+patch at gmail.com> wrote:
> 1. If you put the “u” prefix on the Chinese string,

Yes, but then it would be treated exactly the same as the 3rd entry.
The point of the one that says "error" (so I'm told, I can't read CJK)
is to show that in 2.7 even string literals with non-ascii chars
behave differently from instances of the unicode class.

> 2. Put the following __future__ line right at the top of the file,

That ... is ... awesome!

I swear I tried that out on an early version of my little script and
for some reason didn't see the effect and abandoned it. I even read
through the PEP and a few of the top google hits, but I misunderstood
it to mean that the effect was limited to the "u" and "b" prefixed
strings. Hindsight being 20/20 I can't remember how I could possibly
have come to that conclusion. Thank you for sending me back to try it
again.

I'll try this fix out in the full pactest and get a new patch ready.
Probably not tonight, but soon. I'll just resubmit this one patch -
the final (8/8) patch could probably benefit from a bit more time for
reflection.

Thanks, Martin, and enjoy your internet vacation!
Jeremy


More information about the pacman-dev mailing list