Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107873

Re: about special characters

From MRAB <python@mrabarnett.plus.com>
Newsgroups comp.lang.python
Subject Re: about special characters
Date 2016-04-30 01:32 +0100
Message-ID <mailman.237.1461976370.32212.python-list@python.org> (permalink)
References <CAJ7mry+o=PRGtM46HPGdNVqaowy3tmheJKu38nRy4y_QEjqV-w@mail.gmail.com> <85zischt1i.fsf@benfinney.id.au> <77665750-2d18-c0a0-1777-40139a5132c3@mrabarnett.plus.com>

Show all headers | View raw


On 2016-04-30 00:52, Ben Finney wrote:
> Jianling Fan <fanjianling@gmail.com> writes:
>
>> I am trying to use python 27 copying some of my folders and files to
>> another directory.
>
> (There has never been a Python 27. I assume Python 2.7 is what you meant.)
>
>> My code works good for other files but I have some problem to copy
>> files that have some special characters in the filename. like
>> filenames contain Greek "δ" or latin "š".
>
> You may already know that Python 2 handles international text a lot less
> consistently than Python 3.
>
> Is it at all feasible for you to use Python 3 instead? Text handling is
> specifically a big advantage of Python 3.
>
>> it always gave a error that "No such file or directory:"
>
> Please give a complete, small example:
>
> * The actual filenames.
>
> * The exact filesystem encoding that filesystem uses. Be sure to verify that!
>
> * A very small, but complete, Python program which exhibits the
>   behaviour. We will need to be able to run the same program.
>
> * The complete error output (the full traceback).
>
It might be a Unicode problem, i.e. trying to work with bytestrings
(str) instead of Unicode strings (unicode) and using the wrong encoding.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: about special characters MRAB <python@mrabarnett.plus.com> - 2016-04-30 01:32 +0100

csiph-web