aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>2019-05-07 23:36:39 +0200
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-05-07 22:36:39 +0100
commitca87eebb22d202c33f3317cbf85059cadc64fa9f (patch)
treefd4407525a7e3da55050901a4500d03314006c08 /Lib/logging
parentbpo-36838: Suggest 'make venv' when missing Doc/ tools. (GH-13173) (diff)
downloadcpython-ca87eebb22d202c33f3317cbf85059cadc64fa9f.tar.gz
cpython-ca87eebb22d202c33f3317cbf85059cadc64fa9f.tar.bz2
cpython-ca87eebb22d202c33f3317cbf85059cadc64fa9f.zip
bpo-36015: Handle StreamHandler representaton of stream with an integer name (GH-11908)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 07a0c0c4ae9..16812ec8d55 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1111,6 +1111,8 @@ class StreamHandler(Handler):
def __repr__(self):
level = getLevelName(self.level)
name = getattr(self.stream, 'name', '')
+ # bpo-36015: name can be an int
+ name = str(name)
if name:
name += ' '
return '<%s %s(%s)>' % (self.__class__.__name__, name, level)