Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.030 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'argument': 0.05; 'subject:file': 0.07; 'suggest': 0.14; '"/"': 0.16; 'character.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inclined': 0.16; 'simple.': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; 'ordinary': 0.31; 'allows': 0.31; 'url:python': 0.33; "i'd": 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'become': 0.64; 'special': 0.74; 'subject:Making': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=v6g2qBvVdShzgvLG0EfJ6LYlBYPWVVfe9Xk72kttaXg=; b=fPxyZmojAjBnxY48sfXuUlIIm3z6Ohg1NIU6ETI56peRBOBOUH9AyiIvEP7mJqjslO UvqAPBBcPWJRj7fz+2HN9I0n/0sbaAlkBeQbuWa9FbC9GnxjkU7VgZ8JddCJiuwwoNMU QNubYdc5/yfYClsj883qS+ikFTJ+f3Y/AUa9NdXwDBv8kmHygOJu5i2h/FUFjlOIsCNE +7KwalFS6ADbrw5quNkVlrDwQw7tYVOwrWMA/2+qvkReOKJum9qe2JHuSMn4UorQXXKS fmqAEKQGLmWuFfxAIkuQkD6wEFPPvKlZ+1Y7hVkoA2073hKLW46fGDWsSLKfUEjZg+L+ jpbA== MIME-Version: 1.0 X-Received: by 10.58.50.7 with SMTP id y7mr2779823ven.24.1367967863107; Tue, 07 May 2013 16:04:23 -0700 (PDT) In-Reply-To: References: <51895D03.4000300@gmail.com> Date: Wed, 8 May 2013 09:04:23 +1000 Subject: Re: Making safe file names From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367967872 news.xs4all.nl 15897 [2001:888:2000:d::a6]:54627 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44914 On Wed, May 8, 2013 at 8:18 AM, F=E1bio Santos w= rote: > I suggest Base64. b64encode > (http://docs.python.org/2/library/base64.html#base64.b64encode) and > b64decode take an argument which allows you to eliminate the pesky "/" > character. It's reversible and simple. But it doesn't look anything like the original. I'd be inclined to go for something like quoted-printable or URL-encoding; special characters become much longer, but ordinary characters (mostly) stay as themselves. ChrisA