Python 3 encoding question: Read a filename from stdin, subsequently open that filename

Dan Stromberg drsalists at gmail.com
Tue Nov 30 19:57:57 EST 2010


On Tue, Nov 30, 2010 at 7:19 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Mon, 29 Nov 2010 21:52:07 -0800 (PST)
> Yingjie Lan <lanyjie at yahoo.com> wrote:
>> --- On Tue, 11/30/10, Dan Stromberg <drsalists at gmail.com> wrote:
>> > In Python 3, I'm finding that I have encoding issues with
>> > characters
>> > with their high bit set.  Things are fine with strictly
>> > ASCII
>> > filenames.  With high-bit-set characters, even if I
>> > change stdin's
>> > encoding with:
>>
>> Co-ask. I have also had problems with file names in
>> Chinese characters with Python 3. I unzipped the
>> turtle demo files into the desktop folder (of
>> course, the word 'desktop' is in Chinese, it is
>> a windows XP system, localization is Chinese), then
>> all in a sudden some of the demos won't work
>> anymore. But if I move it to a folder whose
>> path contains only english characters, everything
>> comes back to normal.
>
> Can you try the latest 3.2alpha4 (*) and check if this is fixed?
> If not, then could you please open a bug on http://bugs.python.org ?
>
> (*) http://python.org/download/releases/3.2/
>
> Thank you
>
> Antoine.

I have the same problem using 3.2alpha4: the word man~ana (6
characters long) in a filename causes problems (I'm catching the
exception and skipping the file for now) despite using what I believe
is an 8-bit, all 256-bytes-are-characters encoding: iso-8859-1.  'not
sure if you wanted both of us to try this, or Yingjie alone though.



More information about the Python-list mailing list