This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients ezio.melotti, piro, ronaldoussoren, vstinner
Date 2010-07-23.15:01:23
SpamBayes Score 0.0036889273
Marked as misclassified No
Message-id <1279897285.8.0.589511001401.issue9167@psf.upfronthosting.co.za>
In-reply-to
Content
Daniele: never mind, you already said you are on OSX 10.4.

The current behavior is only a problem when the system default encoding as implied by LANG is different from the fileystem encoding.

How to fix this is an entirely different question: most (all?) unix tools just work with byte-strings and pass those through unmodified, this means that with something like:

   subprocess.Popen(['ls', snowman])

The snowman character should be encoded using the filesystem encoding, as that is the bytestring that the C APIs that ls calls expect.

Note that encoding using the preferred encoding would result in an exception, as the snowman character cannot be encoded in ASCII or even latin1.

A possible workaround is to use the CFStringGetSystemEncoding from CoreFoundation to get the system encoding when LANG=C (and probably guarded by to be activate only on OSX releases before 10.5).

Another workaround: upgrade from OSX 10.4 to at least OSX 10.5 ;-)
History
Date User Action Args
2010-07-23 15:01:25ronaldoussorensetrecipients: + ronaldoussoren, vstinner, piro, ezio.melotti
2010-07-23 15:01:25ronaldoussorensetmessageid: <1279897285.8.0.589511001401.issue9167@psf.upfronthosting.co.za>
2010-07-23 15:01:24ronaldoussorenlinkissue9167 messages
2010-07-23 15:01:23ronaldoussorencreate