Re: [Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread Eric V. Smith
On 04/03/2014 11:49 AM, MRAB wrote: > On 2014-04-03 16:20, Eric V. Smith wrote: >> On 04/02/2014 04:08 PM, John Tyree wrote: >>> >>> Hi all, >>> >>> Is there any particularly reason for the following behavior on both >>> 2.7.6 and 3.4.0 ? >>> >>> >>> "{:\x00<5}".format(2) >>> '2' >>>

Re: [Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread Eric V. Smith
On 04/03/2014 11:37 AM, R. David Murray wrote: > On Thu, 03 Apr 2014 11:20:20 -0400, "Eric V. Smith" > wrote: >> On 04/02/2014 04:08 PM, John Tyree wrote: >>> >>> Hi all, >>> >>> Is there any particularly reason for the following behavior on both >>> 2.7.6 and 3.4.0 ? >>> >>> >>> "{:\x00<5}".

Re: [Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread MRAB
On 2014-04-03 16:20, Eric V. Smith wrote: On 04/02/2014 04:08 PM, John Tyree wrote: Hi all, Is there any particularly reason for the following behavior on both 2.7.6 and 3.4.0 ? >>> "{:\x00<5}".format(2) '2' >>> "{:\x20<5}".format(2) '2' >>> "{:\x01<5}".fo

Re: [Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread R. David Murray
On Thu, 03 Apr 2014 11:20:20 -0400, "Eric V. Smith" wrote: > On 04/02/2014 04:08 PM, John Tyree wrote: > > > > Hi all, > > > > Is there any particularly reason for the following behavior on both > > 2.7.6 and 3.4.0 ? > > > > >>> "{:\x00<5}".format(2) > > '2' > > >>> > > "{:\

Re: [Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread Eric V. Smith
On 04/02/2014 04:08 PM, John Tyree wrote: > > Hi all, > > Is there any particularly reason for the following behavior on both > 2.7.6 and 3.4.0 ? > > >>> "{:\x00<5}".format(2) > '2' > >>> > "{:\x20<5}".format(2) >

[Python-Dev] Incorrect behavior in str.format() method when padding with '\x00'

2014-04-03 Thread John Tyree
Hi all, Is there any particularly reason for the following behavior on both 2.7.6 and 3.4.0 ? >>> "{:\x00<5}".format(2) > '2' > >>> > "{:\x20<5}".format(2) > > '2' > >>> > "{:\x01<5}".format(2) > > '2\x01\x01\x01\x01' > >>> "{:\x00<5}".format(2) == > "{:\x20<5}".format(2) > > True > The