Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.05; 'encoding': 0.05; 'encoded': 0.07; 'ascii': 0.09; 'subject:2.7': 0.09; 'blindly': 0.16; 'failure.': 0.16; 'str,': 0.16; 'subject:unicode': 0.16; 'unicode,': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'error': 0.23; 'unicode': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'object.': 0.31; 'safely': 0.31; 'subject:time': 0.33; 'subject: (': 0.35; "can't": 0.35; 'received:google.com': 0.35; 'subject:one': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'happen': 0.63; 'subject:more': 0.64; '20,': 0.68; 'silent': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=A8HNgdiwGqJhVXkYo7BtF1C+nugceTyly1GI0U3CTyw=; b=A2Xe/Uz+vsqWi2HELSwE71wqfgniptkjw+A8uowGVX4AahfPjbXzHmDlgiTbTQwWIz tZknAc9ZcQxW/zOZD/0o+K40IIOQAJLbbb6tRzQOZfCTQ24HO+nbUc21I55/eSvwv2RG azpFJnyODCm+HeQb9AcZCHS0/HRgtyOZtaAGhyhyZoeU75JEVY5JLsf+T/SKTp1PPYzN Ku9Vb1eLgVpJteg1qDwF0WwY5d+ZD4CCdXCDiejhn2/Bv15k8O8AE+SipZCPCTYqTkQK yQi1KPfjFL7q5pgqKOo6Gj+GdWoZDBjuW2CBFLkkYXuPNVN7Id45FjyrjMiv5Tu4zqD1 0fyw== X-Received: by 10.70.102.234 with SMTP id fr10mr10047292pdb.145.1416506839953; Thu, 20 Nov 2014 10:07:19 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1416505379.268157.193439717.66E319D4@webmail.messagingengine.com> References: <1416491999.209592.193345213.3A6FF9A4@webmail.messagingengine.com> <1416505379.268157.193439717.66E319D4@webmail.messagingengine.com> From: Ian Kelly Date: Thu, 20 Nov 2014 11:06:39 -0700 Subject: Re: python 2.7 and unicode (one more time) To: Python Content-Type: text/plain; charset=UTF-8 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416506849 news.xs4all.nl 2955 [2001:888:2000:d::a6]:53230 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3684 X-Received-Body-CRC: 3780648700 Xref: csiph.com comp.lang.python:81101 On Thu, Nov 20, 2014 at 10:42 AM, wrote: > and it means you can't safely > blindly use %s with an unknown object. You can't safely do this anyway. Whether it's %s with a str and a unicode, or %s with a unicode and a str, *something* is going to have to be implicitly encoded or decoded, and if ascii doesn't happen to be the correct encoding then the result will be either an error or a silent failure.