about special characters

Ben Finney ben+python at benfinney.id.au
Fri Apr 29 19:52:25 EDT 2016


Jianling Fan <fanjianling at 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).

-- 
 \       “Corporation, n. An ingenious device for obtaining individual |
  `\       profit without individual responsibility.” —Ambrose Bierce, |
_o__)                                   _The Devil's Dictionary_, 1906 |
Ben Finney




More information about the Python-list mailing list