Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Data Entry Date: Wed, 13 Jan 2016 22:29:37 +1100 Lines: 14 Message-ID: References: <6ea58259-05f8-40b5-8c85-46a69668c8e6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de UoOkmIbYAU39D8hc5mejQQjiWwp7E/MsdN31IrQhJDNw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'instance.': 0.09; 'jan': 0.11; 'wed,': 0.15; '"%s",': 0.16; '"get': 0.16; '%s,': 0.16; '2016': 0.16; 'attribute,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'markup.': 0.16; 'multi-word': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Entry': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'data,': 0.27; '13,': 0.29; 'spaces': 0.29; 'quotes': 0.33; 'advice': 0.35; 'received:google.com': 0.35; 'but': 0.36; 'instead': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'why': 0.39; 'your': 0.60; "you'll": 0.61; 'subject:Data': 0.66; 'chrisa': 0.84; 'escaping': 0.84; 'otten': 0.84; 'to:none': 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:cc :content-type; bh=o1u16tDEmqHwQ8lulPuY7rFylmGVxVMud1cXsdWO0oM=; b=EPS/ZZaKEQFUhFSEOtBbRzgv78psaYYLK7sYNuCqWguuJ/13HQstyHQFShyffIZl6R vidPjqVtNdgcs3R0r7TKqq86Z0DdIT6YGU1avogpMf8S9uGDyJ+FoYIzFxRVbi/j7nPx DryFPSrsfPKIQ/iWrs+Xq+EUnoUusL9ZXwK5ZHyz7t+/9snyZbux3Zni1wLujLwXCovC gsw1KyXEagMXt1mVPPj54E4tFV3J2suGHFzgPHVZz3eMGD3ezrlCGz4rB8gZWMdIsjaf SYM2c4jwOpnDVvvjr3+jYfrrKiJ1I8qzd2HerTu87BT0EkLtA2+L4LK6MfuaKBE6yNFB MG8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=o1u16tDEmqHwQ8lulPuY7rFylmGVxVMud1cXsdWO0oM=; b=fKHtu5Cm+AmghP6xMc7vuAG9v5FTNVIfR6G8E32eSN1LcYj5h8nZcoRgISLbn1GDls vGCwnRQmDVcAhGN3GsgK4UO5U1hIHIwT30J3WDXR/Lu3bbC3CueFhbCNAwEkWT5j0ixG 1o6kq0wKw0UJWzEY28nyr8qDD2qvsRUvWMTgvIwjKgdU2wXFZHxmJwmeVGUiWRp/MiXR 3b1HBdKtDZnNR6VlR9K7yIzDkkarv6jo2zyc01tXfju6IPudpSMVaxZylK+m98savDBc 8bvqc5O7yUL9RtHqjsZLd1H15I2mWpW0zBRTwNNsWYPdbp72OPjLjufPRupKudCCj6K9 ACMA== X-Gm-Message-State: ALoCoQlOya5yFFWR7lp5W3IFFSe79kz0wcMmry65iIes/WV/7T+h/2VOrJWMaPllAy9rYjTkpISvVPBZoEaMVzKrH9rR/NDDZg== X-Received: by 10.107.40.76 with SMTP id o73mr61070330ioo.157.1452684577387; Wed, 13 Jan 2016 03:29:37 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101604 On Wed, Jan 13, 2016 at 10:21 PM, Peter Otten <__peter__@web.de> wrote: >> To set a multi-word value as an HTML attribute, you'll need to put >> quotes around it. You might be able to get away with using %r instead >> of %s, or even just "%s", > > That is bad advice that "works" until there is a value containing > quotes or other markup. > Which is why I said "get away with". If you know your data, you might know that it can have spaces but never quotes, for instance. But proper escaping is definitely the way to go. ChrisA