[Python-Dev] possible string formatting bug

Georg Brandl g.brandl at gmx.net
Mon Oct 8 17:40:40 CEST 2007


Eli Courtwright schrieb:
> Greetings,
> 
> I've found what might be a bug in Python's % string formatting
> operator.  Consider the following code:
> 
> "%%(%s)=%%s" % "hello"
> 
> On "Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC 3.4.4 (cygming
> special, gdc 0.12, using dmd 0.125)] on cygwin" this produces the string
> "%(hello)s=%s" which is what I'd expect.

There must be some confusion, because the above gives "%(hello)=%s"...
are you sure you tried the same format strings on both versions?

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list