Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Windows': 0.02; 'scripts': 0.03; 'strict': 0.07; 'bash': 0.09; 'filenames': 0.09; 'properly.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'windows': 0.15; 'accepts': 0.16; 'basename': 0.16; 'confuse': 0.16; 'newlines': 0.16; 'pathnames': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'scripts.': 0.16; 'slash': 0.16; 'subject:Unicode': 0.16; '(you': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'unix/linux': 0.24; 'script': 0.25; 'header:X-Complaints-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'that.': 0.31; 'ordinary': 0.31; 'file': 0.32; 'open': 0.33; 'display': 0.35; 'convert': 0.35; 'but': 0.35; "didn't": 0.36; 'possible': 0.36; 'example,': 0.37; 'handle': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'space': 0.40; 'even': 0.60; 'most': 0.60; 'skip:* 10': 0.61; 'more': 0.64; 'forward': 0.65; 'importantly,': 0.68; 'fact,': 0.69; '99.9%': 0.84; 'characters,': 0.84; 'only:': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Unicode Chars in Windows Path Date: Thu, 03 Apr 2014 15:09:53 +0200 Organization: None References: <533cc967$0$2909$c3e8da3$76491128@news.astraweb.com> <87fvluss86.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p57bdbc33.dip0.t-ipconnect.de User-Agent: KNode/4.11.5 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396533381 news.xs4all.nl 2839 [2001:888:2000:d::a6]:56476 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69584 Marko Rauhamaa wrote: > Chris Angelico : > >> Small clarification: The Windows *API* accepts both types of slash >> (you can open a file using forward slashes, for instance), but not all >> Windows *applications* are aware of this (generally only >> cross-platform ones take notice of this), and most Windows *users* >> prefer backslashes. So when you come to display a Windows path, you >> may want to convert to backslashes. But that's for display. > > Didn't know that. More importantly, I had thought forward slashes were > valid file basename characters, but Windows is surprisingly strict about > that: > > < > : " / \ | ? * NUL > > are not allowed in basenames. Unix/linux disallows only: > > / NUL > > In fact, proper dealing with punctuation in pathnames is one of the main > reasons to migrate to Python from bash. Even if it is often possible to > write bash scripts that handle arbitrary pathnames correctly, few script > writers are pedantic enough to do it properly. For example, newlines in > filenames are bound to confuse 99.9% of bash scripts. That doesn't bother me much as 99.8% of all bash scripts are already confused by ordinary space chars ;)