Skip to content

Commit eadc51e

Browse files
committed
Fix hostname decode
1 parent 70fab2c commit eadc51e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reportportal_client/logs/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ def filter(self, record):
139139
# urllib3 usage
140140
hostname = urlparse(self.endpoint).hostname
141141
if hostname:
142-
if hostname.decode() in self.format(record):
143-
return False
142+
if hasattr(hostname, 'decode') and callable(hostname.decode):
143+
if hostname.decode() in self.format(record):
144+
return False
145+
else:
146+
if str(hostname) in self.format(record):
147+
return False
144148
return True
145149

146150
def _get_rp_log_level(self, levelno):

0 commit comments

Comments
 (0)