Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: about special characters Date: Sat, 30 Apr 2016 09:52:25 +1000 Lines: 36 Message-ID: References: <85zischt1i.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de oHcxwArEdCOcZXcmJvkPAwiFrX/OeX0bxiBG2KtKoThg== Cancel-Lock: sha1:pA0dvGRhlCpTTRzraMdhG1NqQAQ= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'filenames': 0.07; 'filename.': 0.09; 'filesystem': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:characters': 0.09; 'example:': 0.10; 'python': 0.10; 'assume': 0.11; '2.7': 0.13; 'output': 0.13; 'encoding': 0.15; '(there': 0.16; 'behaviour.': 0.16; 'feasible': 0.16; 'filenames.': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'directory.': 0.18; 'handles': 0.20; '(the': 0.22; 'complete,': 0.22; 'uses.': 0.22; 'trying': 0.22; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'error': 0.27; 'handling': 0.27; 'small,': 0.27; 'specifically': 0.28; 'actual': 0.28; 'device': 0.28; '"no': 0.29; 'code': 0.30; 'another': 0.32; 'run': 0.33; 'problem': 0.33; 'that!': 0.33; 'file': 0.34; 'text': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'files': 0.38; 'copying': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'complete': 0.63; 'skip:\xe2 10': 0.70; 'special': 0.73; '_o__)': 0.84; 'greek': 0.84; 'latin': 0.84; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <85zischt1i.fsf@benfinney.id.au> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:107871 Jianling Fan 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