<br><br><div class="gmail_quote">On Tue, Jul 26, 2011 at 17:41, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jul 27, 2011 at 12:10 AM, Éric Araujo <<a href="mailto:merwok@netwok.org">merwok@netwok.org</a>> wrote:<br>
> Le 26/07/2011 15:30, Antoine Pitrou a écrit :<br>
>> Actually, you want %a for non-ASCII messages to be escaped.<br>
><br>
> Thanks for the reminder, I should use more %a instead of %r. In the<br>
> packaging code however, we can’t, given that we want to backport.<br>
><br>
>> (however, there's hardly any reason to worry about it when it comes to<br>
>> stdlib module names)<br>
><br>
> I lacked context to see that. If the code in question only ever handles<br>
> stdlib modules, then okay.<br>
<br>
</div>The other reason to use %r is to get the enclosing quotes in the<br>
displayed message. That reason applies even in cases like this where<br>
the escaping aspect isn't a concern.<br></blockquote><div><br></div><div>And then you make it {!r} so you can use str.format and you complete the tweak of the string formatting! =) Seriously, though, it wouldn't hurt to update it to use str.format(). </div>
</div>