Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'ignored': 0.07; 'subject:file': 0.07; 'tom': 0.07; 'locale': 0.09; 'windows': 0.15; 'encodings': 0.16; 'happily': 0.16; 'prefixed': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'settings': 0.22; 'header:User- Agent:1': 0.23; 'unicode': 0.24; 'versions': 0.24; 'switch': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'character': 0.29; "doesn't": 0.30; 'andrew': 0.30; 'characters': 0.30; '(which': 0.31; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'file': 0.32; 'probably': 0.32; "we're": 0.32; 'device': 0.34; 'trouble': 0.34; 'but': 0.35; 'there': 0.35; 'largely': 0.36; 'url:support': 0.36; 'url:org': 0.36; 'url:microsoft': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'most': 0.60; 'tell': 0.60; 'first': 0.61; 'name': 0.63; 'such': 0.63; 'received:74.208': 0.68; 'url:%1': 0.72; 'received:74.208.4.194': 0.84; 'subject:Making': 0.84; 'unclear': 0.84 Date: Tue, 07 May 2013 21:45:08 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Making safe file names References: <51895D03.4000300@gmail.com> <518998FE.6030805@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:9eiQ5PbeWvW+xPTlF/a6fiKrJQ0qGt2W8Yi3xFtnX4c o0Sh9Hzfk9P2f88EqJjDpTlvGhavwV3Qqmn+wwr48fwKDaSfLU RaCc9HmVwqm6wXWOhs92gpApW9ioP5n1bdT0DjMKtsLV785eTq b6rDDHJu3jyLq1/HOf+sBTUdEgNtKpxT10/yE0bG+2E9Knskdv M17KoFHunjzB6+aji2AeSNGXN9LQv8tHzwuq4zb4r9L0wceZf/ 9RpfKrRRaLAeYtF1ToKllzs+iPQdoDhG+NpDfS035I8W+v8iSh n8yZSDU3V1bdEu08+U/cEjHyNAHGOQvkVqNG74dA/LX9zmFVw= = 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367977523 news.xs4all.nl 15887 [2001:888:2000:d::a6]:54302 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44931 On 05/07/2013 09:28 PM, Neil Hodgson wrote: > Andrew Berg: > >> This is not a Unicode issue since (modern) file systems will happily >> accept it. The issue is that certain characters (which are ASCII) are >> not allowed on some file systems: >> \ / : * ? "< > | @ and the NUL character >> The first 9 are not allowed on NTFS, the @ is not allowed on ext3cow, >> and NUL and / are not allowed on pretty much any file system. Locale >> settings and encodings aside, these 11 characters will need to be >> escaped. > > There's also the Windows device name hole. There may be trouble with > artists named 'COM4', 'CLOCK$', 'Con', or similar. > In MSDOS 2, there was a switch that would tell the OS to ignore such names unless they were prefixed by \DEV. But like the switchar switch, it was largely ignored by the ignorant, and probably doesn't exist in current versions of M$OS > http://support.microsoft.com/kb/74496 > http://en.wikipedia.org/wiki/Nul_%28band%29 > > Neil While we're looking for trouble, there's also case insensitivity. Unclear if the user cares, but tom and TOM are the same file in most configurations of NT. -- DaveA