File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,8 +55,14 @@ def __init__(self, verbose=None):
5555 def _note (self , format , * args ):
5656 if self ._verbose :
5757 format = format % args
58- format = "%s: %s\n " % (
59- current_thread ().name , format )
58+ # Issue #4188: calling current_thread() can incur an infinite
59+ # recursion if it has to create a DummyThread on the fly.
60+ ident = _get_ident ()
61+ try :
62+ name = _active [ident ].name
63+ except KeyError :
64+ name = "<OS thread %d>" % ident
65+ format = "%s: %s\n " % (name , format )
6066 _sys .stderr .write (format )
6167
6268else :
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ Core and Builtins
2020Library
2121-------
2222
23+ - Issue #4188: Avoid creating dummy thread objects when logging operations
24+ from the threading module (with the internal verbose flag activated).
25+
2326- Issue #10711: Remove HTTP 0.9 support from http.client. The ``strict``
2427 parameter to HTTPConnection and friends is deprecated.
2528
You can’t perform that action at this time.
0 commit comments