diff options
| author | Martin Basti <mbasti@redhat.com> | 2017-01-10 18:21:13 +0100 |
|---|---|---|
| committer | Martin Basti <mbasti@redhat.com> | 2017-01-24 13:25:47 +0100 |
| commit | c0b5c6709d9e3a51117994fc8b605ba54e6263d7 (patch) | |
| tree | 86b783527bdd929197b4ef102dfe176e204927f3 /ipapython | |
| parent | 232ceed5bbfb0afa45078d8e95b84dabe4d7cafd (diff) | |
| download | freeipa-c0b5c6709d9e3a51117994fc8b605ba54e6263d7.tar.gz freeipa-c0b5c6709d9e3a51117994fc8b605ba54e6263d7.tar.xz freeipa-c0b5c6709d9e3a51117994fc8b605ba54e6263d7.zip | |
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>
Diffstat (limited to 'ipapython')
| -rw-r--r-- | ipapython/dogtag.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ipapython/dogtag.py b/ipapython/dogtag.py index eb1f73eee..37e7a5892 100644 --- a/ipapython/dogtag.py +++ b/ipapython/dogtag.py @@ -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) |
