[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-19 Thread Florent Xicluna
Changes by Florent Xicluna : -- assignee: docs@python -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file35299/plistlib_read_refs.patch ___ Python tracker ___ ___ Python-bugs-l

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And here is a patch with test. -- stage: test needed -> patch review Added file: http://bugs.python.org/file35300/plistlib_read_refs_2.patch ___ Python tracker __

[issue21540] PEP 8 should recommend "is not" and "not in"

2014-05-19 Thread Florent Xicluna
New submission from Florent Xicluna: Python accepts both syntaxes: if not item in some_list and not item is None: return item and if item not in some_list and item is not None: return item In the first form, you identify 5 operators: "not", "in", "and", "not" and "in"

[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-19 Thread Charles-François Natali
Charles-François Natali added the comment: As said in a previous comment, we don't want to have EINTR handling code everywhere. The right way to do this is to handle it at the syscall level. -- ___ Python tracker _

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this patch should fix the issue. But tests needed. -- keywords: +patch stage: -> test needed type: -> behavior Added file: http://bugs.python.org/file35299/plistlib_read_refs.patch ___ Python tracker

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file35295/History.plist.7z ___ Python tracker ___ ___ Python-bugs-list mail

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file35295/History.plist.7z ___ Python tracker ___ ___ Python-bugs-list mailin

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread John Lehr
John Lehr added the comment: Ned, I understand. I did get permission to post that history, and as I feared, the sanitized History.plist I'm attaching now doesn't have the loading issue that the first did. Possibly a URL character is throwing the exception? Can you suggest where I can put a pri

[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-19 Thread tholzer
tholzer added the comment: Here is a reproducible test case: import threading import signal import os import httplib def killer(): while 1: os.kill(os.getpid(), signal.SIGINT) def go(): signal.signal(signal.SIGINT, lambda x,y: None) thread = threading.Thread(target=killer)

[issue21539] pathlib's Path.mkdir() should allow for "mkdir -p" functionality

2014-05-19 Thread Jim Garrison
New submission from Jim Garrison: As of Python 3.2, `os.makedirs()` takes `exist_ok` as a keyword argument. If set to true, the function does not raise an error if the directory already exists. This makes the function's behavior similar to `mkdir -p` on the UNIX commandline. (See https://do

[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-19 Thread tholzer
Changes by tholzer : Added file: http://bugs.python.org/file35297/httplib_2.7.3_eintr_patch.py ___ Python tracker ___ ___ Python-bugs-list mai

[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-19 Thread tholzer
tholzer added the comment: We encountered the same problem, this is in the context of using PyQt (specifically QProcess) or twisted. They both rely on SIGCHLD for their notification framework. I've attached a httplib EINTR patch for 2.6.4 & 2.7.3. -- nosy: +tholzer Added file: http://

[issue21477] Idle: improve idle_test.htest

2014-05-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 33a39dfc239e by Terry Jan Reedy in branch '2.7': Issue #21477: idle htests - lower case function names, other cleanups. http://hg.python.org/cpython/rev/33a39dfc239e New changeset 7c70198ec48e by Terry Jan Reedy in branch '3.4': Issue #21477: idle h

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Trip, see msg140290, which was ignored. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue21531] Sending a zero-length UDP packet to asyncore invokes handle_close()

2014-05-19 Thread Tony Gedge
Tony Gedge added the comment: If it's true that asyncore doesn't support UDP, I'd suggest at least a statement to this effect in the documentation. As far as I can see, there's nothing to suggest it won't work with UDP. -- ___ Python tracker

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Ned Deily
Ned Deily added the comment: John, a quick look at the file shows that it contains browsing history information that might be personally identifiable. I don't think that is appropriate to store on a public web site like this one so I've deleted the file. Is there some way to provide a simple

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Ned Deily
Changes by Ned Deily : Removed file: http://bugs.python.org/file35295/History.plist.7z ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Ned Deily
Changes by Ned Deily : -- components: +Library (Lib) nosy: +ronaldoussoren, serhiy.storchaka -ned.deily type: crash -> versions: +Python 3.5 ___ Python tracker ___ _

[issue1191964] asynchronous Subprocess

2014-05-19 Thread Josiah Carlson
Josiah Carlson added the comment: First off, thank you everyone who has reviewed and commented so far. I very much appreciate your input and efforts. Does anyone have questions, comments, or concerns about the patch? If no one mentions anything in the next week or so, I'll ping the email threa

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread John Lehr
John Lehr added the comment: I have shared the file for which I have permission, but neither of two History.plists in my possession will load, both with the same traceback. Thank you. On Mon, May 19, 2014 at 4:18 PM, Ned Deily wrote: > > Ned Deily added the comment: > > Can you attach a zippe

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread Ned Deily
Ned Deily added the comment: Can you attach a zipped version of the failing plist or at least identify what data in it is causing the exception? Presumably that plist is user-specific, i.e. contains browser history. -- nosy: +ned.deily ___ Python t

[issue20620] Update the min()/max() docs for the new default argument

2014-05-19 Thread Berker Peksag
Changes by Berker Peksag : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue21386] ipaddress.IPv4Address.is_global not implemented

2014-05-19 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue21509] json.load fails to read UTF-8 file with (BOM) Byte Order Marks

2014-05-19 Thread Santoso Wijaya
Santoso Wijaya added the comment: I think you should use codecs.BOM_UTF8 rather than using hardcoded string "\xef\xbb\xbf" directly. And why special casing UTF-8 while we're at it? What about other encodings and their BOMs? -- nosy: +santa4nt ___ P

[issue10510] distutils upload/register should use CRLF in HTTP requests

2014-05-19 Thread Éric Araujo
Éric Araujo added the comment: Patch looks good, will apply. Thanks. -- stage: needs patch -> commit review versions: +Python 3.5 -Python 3.3 ___ Python tracker ___

[issue21538] plistlib unable to load iOS7 Safari History.plist

2014-05-19 Thread John Lehr
New submission from John Lehr: plistlib has key error when attempting to load the iOS7 var/mobile/Applications/com.apple.mobilesafari/Library/Safari/History.plist. No detected issues with other iOS7 plists. In [8]: with open('cases/vitale_test_iphone/unback/AppDomain-com.apple.mobilesafari/

[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-19 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue21535] test_license_exists_at_url fails with 3.4.1, wrong/unexpected http error code

2014-05-19 Thread Ned Deily
Ned Deily added the comment: The license file page for 3.4.1 now exists. -- nosy: +ned.deily stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue21535] test_license_exists_at_url fails with 3.4.1, wrong/unexpected http error code

2014-05-19 Thread Ned Deily
Changes by Ned Deily : -- resolution: -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue20620] Update the min()/max() docs for the new default argument

2014-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the patch. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue20620] Update the min()/max() docs for the new default argument

2014-05-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset b60258f4499c by Raymond Hettinger in branch '3.4': Issue 20620: Update the min()/max() docs for the new default argument. http://hg.python.org/cpython/rev/b60258f4499c -- nosy: +python-dev ___ Python trac

[issue14776] Add SystemTap static markers

2014-05-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: I still wish there was a patch that combined both dtrace and systemtap support, und used as much code sharing between them as feasible. I'd be +1 on such a patch, and -0 on two separate patches that achieve the same functionality, but on different code paths.

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Trip Volpe
Trip Volpe added the comment: I found this issue just the other day while researching why we were getting false gaps in our test coverage reports (using Ned's coverage module, natch!). I agree that this seems like a fairly minor nuisance, but it's a nuisance that anybody who has tests and meas

[issue14776] Add SystemTap static markers

2014-05-19 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: I would like to point out that if this patch gets accepted, maybe issue #13405 (updated, I keep an up to date version in my mercurial repo) should too. -- ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Ned Batchelder
Ned Batchelder added the comment: Raymond, thanks for keeping us honest! I am still hoping to convince people that this is a good idea. I think Guido's +1 (https://mail.python.org/pipermail/python-dev/2012-December/123099.html) should help in that regard. Part of your reason for today's reje

[issue21536] extension built with a shared python cannot be loaded with a static python

2014-05-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think you are right. It would IMO be useful to research a few comparable systems. E.g. Apache modules don't link a shared library, but still refer to apr_ functions as undefined symbols - but then, there isn't an APR shared library in the first place (at le

[issue21484] More clarity needed about difference between "x += e" and "x = x + e"

2014-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I agree with Josh. If anything this belongs in a wiki entry, faq page, or stack overflow question. -- nosy: +rhettinger resolution: -> rejected status: open -> closed ___ Python tracker

[issue2506] Add mechanism to disable optimizations

2014-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: There has been no activity on this for several year. Marking as rejected for the reasons originally listed. -- resolution: -> rejected status: open -> closed ___ Python tracker

[issue21507] memory used by frozenset created from set differs from that of frozenset created from other iterable

2014-05-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue21507] memory used by frozenset created from set differs from that of frozenset created from other iterable

2014-05-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue21537] functools.lru_cache does not cache exceptions

2014-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Is this on purpose? The short answer is yes. It is a can of worms and there isn't much of a payoff. -- nosy: +rhettinger resolution: -> not a bug status: open -> closed ___ Python tracker

[issue21536] extension built with a shared python cannot be loaded with a static python

2014-05-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, it's not a -L flag but a -l flag. Removing the "-lpython3.5m" flag from the linker line works fine under Linux, and allows the resulting extension to be loaded with both a shared libary Python and a statically-linked Python. -- _

[issue14710] pkgutil.get_loader is broken

2014-05-19 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue21537] functools.lru_cache does not cache exceptions

2014-05-19 Thread Stephen Paul Chappell
New submission from Stephen Paul Chappell: While examining the implementation for lru_cache, it came to my attention that the wrappers ignore the possibility of exceptions. Is this on purpose? If the cache is designed to reduce the overhead of running certain functions, it seems like lru_cache

[issue21529] JSON module: reading arbitrary process memory

2014-05-19 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Fixed also in 3.2 (b9913eb96643), 3.3 (4f15bd1ab28f), 3.4 (7b95540ced5c) and 3.5 (3a414c709f1f). -- ___ Python tracker ___ ___

[issue21530] Integer overflow in strop

2014-05-19 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21536] extension built with a shared python cannot be loaded with a static python

2014-05-19 Thread Antoine Pitrou
New submission from Antoine Pitrou: When a C extension is built (using distutils) with a shared library Python, it cannot be loaded with an otherwise identical statically linked Python. The other way round works fine. Trivial example using the _ssl module: >>> import sys >>> sys.path.insert(0,

[issue21529] JSON module: reading arbitrary process memory

2014-05-19 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21535] test_license_exists_at_url fails with 3.4.1, wrong/unexpected http error code

2014-05-19 Thread Berker Peksag
Berker Peksag added the comment: This is probably related to issue 21534. -- nosy: +berker.peksag, larry ___ Python tracker ___ ___ Py

[issue7856] cannot decode from or encode to big5 \xf9\xd8

2014-05-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: Inndy, you might also be talking about big5-2003, from http://www.csie.ntu.edu.tw/~r92030/project/big5/ Python currently does not support big5-2003, but a contribution of such an encoding would surely be welcome. -- _

[issue14710] pkgutil.get_loader is broken

2014-05-19 Thread Brett Cannon
Brett Cannon added the comment: I'll take a look the next time I have some Python time (in a week or two) and make sure this gets dealt with. -- assignee: -> brett.cannon ___ Python tracker __

[issue21532] 2.7.7rc1 msi is lacking libpython27.a

2014-05-19 Thread Steve Dower
Steve Dower added the comment: I installed mingw32-binutils and it seems to work fine. 2.7.7 will have the file again. -- ___ Python tracker ___

[issue7856] cannot decode from or encode to big5 \xf9\xd8

2014-05-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm still looking for an official source of that. >>> u"\u88cf".encode("big5hkscs") '\xf9\xd8' works fine (and always has been working fine), and the character clearly is in big5hkscs. According to http://en.wikipedia.org/wiki/Big5 F9D8 is "Reserved for us

[issue21532] 2.7.7rc1 msi is lacking libpython27.a

2014-05-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think any version should do. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue21531] Sending a zero-length UDP packet to asyncore invokes handle_close()

2014-05-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: That doesn't surprise me as asyncore does not natively support UDP protocol in the first place. -- nosy: +giampaolo.rodola ___ Python tracker __

[issue21531] Sending a zero-length UDP packet to asyncore invokes handle_close()

2014-05-19 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue14776] Add SystemTap static markers

2014-05-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21532] 2.7.7rc1 msi is lacking libpython27.a

2014-05-19 Thread Steve Dower
Steve Dower added the comment: Thanks for catching this. Do I need a specific version of Cygwin or will the latest version suffice? -- ___ Python tracker ___ ___

[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-05-19 Thread Eric V. Smith
Eric V. Smith added the comment: For int, the spec is: [[fill]align][sign][#][0][width][,][.precision][type] So, for "06d", "0" is matched as the literal 0, "6" is matched as width, and "d" is matched as type. For "\x00<6d", "\x00" is matched as fill, "<" as align, "6" as width, and "d" as ty

[issue14776] Add SystemTap static markers

2014-05-19 Thread Bohuslav "Slavek" Kabrda
Bohuslav "Slavek" Kabrda added the comment: As usual, I forgot to hg add the new files before running hg diff, so the newly created files didn't get added to the patch. Attaching a fixed version that hopefully has everything. AFAICS all the scripts that Fedora has are 1:1 copy of documentation

[issue21535] test_license_exists_at_url fails with 3.4.1, wrong/unexpected http error code

2014-05-19 Thread Matthias Klose
New submission from Matthias Klose: == FAIL: test_license_exists_at_url (test.test_site.ImportSideEffectTests) -- Traceback (most recent call last): File "/scr

[issue19217] Calling assertEquals for moderately long list takes too long

2014-05-19 Thread Ankur Ankan
Changes by Ankur Ankan : -- nosy: +Ankur.Ankan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue19217] Calling assertEquals for moderately long list takes too long

2014-05-19 Thread Ankur Ankan
Changes by Ankur Ankan : -- nosy: +ankurankan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue14776] Add SystemTap static markers

2014-05-19 Thread Dave Malcolm
Dave Malcolm added the comment: On Mon, 2014-05-19 at 14:15 +, Dave Malcolm wrote: > Dave Malcolm added the comment: > > On Mon, 2014-05-19 at 11:10 +, Bohuslav "Slavek" Kabrda wrote: > > Bohuslav "Slavek" Kabrda added the comment: > > > > Hi, > > I'd like to take this over after Dave M

[issue14776] Add SystemTap static markers

2014-05-19 Thread Dave Malcolm
Dave Malcolm added the comment: On Mon, 2014-05-19 at 11:10 +, Bohuslav "Slavek" Kabrda wrote: > Bohuslav "Slavek" Kabrda added the comment: > > Hi, > I'd like to take this over after Dave Malcolm. I don't see any issues that > haven't been resolved, so my question is: What else can I do to

[issue21534] 404 on documentation download links

2014-05-19 Thread Zachary Ware
New submission from Zachary Ware: docs@ has received several reports from people unable to download documentation from docs.python.org/[23]/download.html since the release of 3.4.1rc1 and 2.7.7rc1. -- assignee: docs@python components: Documentation messages: 218792 nosy: benjamin.peter

[issue21528] Fix a number of typos in the documentation

2014-05-19 Thread Georg Brandl
Georg Brandl added the comment: Looks all good to me. -- nosy: +georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue7856] cannot decode from or encode to big5 \xf9\xd8

2014-05-19 Thread Inndy
Inndy added the comment: I'm Taiwanese, F9D8 in big5 should be mapped to E8A38F in UTF-8. -- nosy: +Inndy ___ Python tracker ___ ___ Py

[issue14710] pkgutil.get_loader is broken

2014-05-19 Thread Pavel Aslanov
Pavel Aslanov added the comment: This function is broken again in version 3.4 The way it should look is: Python 2.7.6 (default, Feb 26 2014, 12:07:17) [GCC 4.8.2 20140206 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pkgutil >>> pkguti

[issue14776] Add SystemTap static markers

2014-05-19 Thread Bohuslav "Slavek" Kabrda
Bohuslav "Slavek" Kabrda added the comment: Hi, I'd like to take this over after Dave Malcolm. I don't see any issues that haven't been resolved, so my question is: What else can I do to make this patch acceptable? I'm attaching a rebased version of this patch that applies to current default b

[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7

2014-05-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 19.05.2014 12:24, Christian Heimes wrote: > > How about you take my back port from > https://bitbucket.org/tiran/backports.pbkdf2/ and remove all Python 3.x > related code? :) I spent a lot of time to make the code as fast as possible. Could you perhap

[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7

2014-05-19 Thread Christian Heimes
Christian Heimes added the comment: Sorry that I join the party rather late. How about you take my back port from https://bitbucket.org/tiran/backports.pbkdf2/ and remove all Python 3.x related code? :) I spent a lot of time to make the code as fast as possible. -- __

[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7

2014-05-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Some comments: * Python 2.7 ships with OpenSSL 0.9.8 on Windows, so the Python version will always get used on that platform, so it needs to be fast. * The iterations loop should use xrange instead of range * The .encode('ascii') in _long_to_bin() is n

[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-05-19 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21533] built-in types dict docs - construct dict from iterable, not iterator

2014-05-19 Thread Wolfgang Maier
New submission from Wolfgang Maier: The docs for Python3.4 havethis to say about the arguments to the dict constructor: class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg) Return a new dictionary initialized from an optional positional argument and a possibly em

[issue19979] Missing nested scope vars in class scope (bis)

2014-05-19 Thread Armin Rigo
Armin Rigo added the comment: Terry: I meant exactly what I wrote, and not some unrelated examples: def f(): n = 1 class A: n = n doesn't work, but the same two lines ("n = 1"; "class A: n = n") work if written at module level instead of in a function. --

[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-05-19 Thread STINNER Victor
STINNER Victor added the comment: I don't understand why it works with "<", "=" or ">": >>> "{0:\x00<6d}".format(123) '123\x00\x00\x00' But not without: >>> "{0:\x006d}".format(123) Traceback (most recent call last): File "", line 1, in ValueError: Invalid format specifier Compare it to: