Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newsfeed.xs4all.nl!newsfeed4a.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.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; '(those': 0.09; '22,': 0.09; 'moreover,': 0.09; 'python:': 0.09; 'unrecognized': 0.09; 'cc:addr:python-list': 0.11; '__future__': 0.16; 'command:': 0.16; 'expects': 0.16; 'wrote:': 0.18; 'command': 0.22; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'instead.': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '(this': 0.29; 'character': 0.29; 'characters': 0.30; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'horizontal': 0.31; 'steven': 0.31; 'writes:': 0.31; 'file': 0.32; 'option': 0.32; 'skip:u 20': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'sure': 0.39; 'space': 0.40; 'remove': 0.60; 'such': 0.63; 'more': 0.64; 'skip:\xe2 10': 0.65; 'subject:Hello': 0.72; 'answer:': 0.84; 'are)': 0.84; 'home!': 0.84; 'it\xe2\x80\x99s': 0.84; 'subject:World': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=HPpBwF3hj4e7ni/pEhMrPz0wR39QT1HGgzo4IzImfuk=; b=CyomcT6gIIZQyWUIa+HeOeA5Gsvn1LwLe7M0V434y33nqkQRHTqbjDkxvNmVpTzNrs C856fvgpgiPXpcFXvoWOTsfFn1AHpg65b+d2AuhwvF6YzvQufkRhC+uMFPHH0zeOr1pB wJqPT6VT1CCM/MxLtvDFaVHSwxfAuBXk8eTgkcGQ2Y5bGC0bGPcr6KzLVogysSrW/+Zd 9QLT9PmowuE/hQzttv8ObLPDfFQWqh1JXnHydNB4wiPSy/VV/mRYYO8U+QztY2psbQKk cPET8/lUFHC4dfLq1FczC9hIae9q/A3CfUjIwp9XWtQFDexUhs5IKrZoTLCxg2WVniVn 0cOg== MIME-Version: 1.0 X-Received: by 10.112.85.11 with SMTP id d11mr22731655lbz.100.1419264239546; Mon, 22 Dec 2014 08:03:59 -0800 (PST) In-Reply-To: References: <54957226$0$12975$c3e8da3$5496439d@news.astraweb.com> <54971df7$0$30820$b1db1813$ba2d9d20@news.astraweb.com> <54974ed7$0$12986$c3e8da3$5496439d@news.astraweb.com> <0udf9a1m3n02rt06a5ib58mvifm7sdeg31@4ax.com> <54983747$0$12994$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 22 Dec 2014 17:03:59 +0100 Subject: Re: Hello World From: Chris Warrick To: Jussi Piitulainen Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 60 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1419264242 news.xs4all.nl 2857 [2001:888:2000:d::a6]:49367 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82783 On Mon, Dec 22, 2014 at 4:36 PM, Jussi Piitulainen wrote: > Steven D'Aprano writes: > >> Don't try this at home! >> >> # download_naked_pictures_of_jennifer_lawrence.py >> import os >> os.system("rm =E2=80=95=E2=80=95rf /") > > Not sure what that character is (those characters are) but it's not > (they aren't) the hyphen that rm expects in its options, so: > > >>> os.system("rm =E2=80=95=E2=80=95rf /") > rm: cannot remove `=E2=80=95=E2=80=95rf': No such file or directory > rm: cannot remove `/': Is a directory > 256 Let=E2=80=98s ask Python: (polyglot 2.6+/3.3+ code!) from __future__ import print_function import unicodedata command =3D u"rm =E2=80=95=E2=80=95rf /" for i in command: print(hex(ord(i)), unicodedata.name(i)) 0x72 LATIN SMALL LETTER R 0x6d LATIN SMALL LETTER M 0x20 SPACE 0x2015 HORIZONTAL BAR 0x2015 HORIZONTAL BAR 0x72 LATIN SMALL LETTER R 0x66 LATIN SMALL LETTER F 0x20 SPACE 0x2f SOLIDUS There=E2=80=99s your answer: it=E2=80=99s U+2015 HORIZONTAL BAR, twice. An= d `rm` wants U+002D HYPHEN-MINUS instead. Moreover, it wants only one HYPHEN-MINUS and not two: Linux: $ rm --rf / rm: unrecognized option '--rf' Try 'rm --help' for more information. BSD: $ rm --rf / rm: illegal option -- - usage: rm [-f | -i] [-dIPRrvWx] file ... unlink file That=E2=80=99s two-step =E2=80=9Cprotection=E2=80=9D. (This e-mail brought to you by Unicode.) --=20 Chris Warrick PGP: 5EAAEA16