Bazaar-NG traffic #2

Magnus Therning magnus at therning.org
Tue Oct 11 17:37:50 BST 2005


On Tue, Oct 11, 2005 at 05:46:43PM +0200, Joel Rosdahl wrote:
>Magnus Therning <magnus at therning.org> writes:
[..]
>If you're trying to test my note about the mixed list of Unicode and
>byte strings, then: no. :-)
>
>Try this program:
>
>===[cut here]=========================================================
>import os
>import shutil
>
>os.mkdir("test")
>os.chdir("test")
>open("r\xe5ka", "w")
>open(u"r\xe4v", "w")
>print os.listdir(u".")
>os.chdir("..")
>shutil.rmtree("test")
>===[cut here]=========================================================
>
>In a UTF-8 environment, the above program will print this:
>
>    ['r\xe5ka', u'r\xe4v']
>
>In an ISO-8859-1 environment, the program will print this:
>
>    [u'r\xe5ka', u'r\xe4v']

Ah, gotcha. Added `print os.listdir(".")` to further clarify things for
myself as well :-)

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Programmer - A red-eyed, mumbling mammal capable of conversing with
inanimate objects.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051011/4b55104f/attachment.pgp 


More information about the bazaar mailing list