mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
py3: _httplib_request: don't convert string to bytes
There is no need to encode hostname to bytes. UTF-8 characters must be encoded in different format in URL anyway and it causes only error in Py3. String must be unicode to support Py2. https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
232ceed5bb
commit
c0b5c6709d
@ -188,9 +188,7 @@ def _httplib_request(
|
||||
|
||||
Perform a HTTP(s) request.
|
||||
"""
|
||||
if isinstance(host, unicode):
|
||||
host = host.encode('utf-8')
|
||||
uri = '%s://%s%s' % (protocol, ipautil.format_netloc(host, port), path)
|
||||
uri = u'%s://%s%s' % (protocol, ipautil.format_netloc(host, port), path)
|
||||
root_logger.debug('request %s %s', method, uri)
|
||||
root_logger.debug('request body %r', request_body)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user