diff --git a/swift/common/bufferedhttp.py b/swift/common/bufferedhttp.py index 1294609133..61d436976d 100644 --- a/swift/common/bufferedhttp.py +++ b/swift/common/bufferedhttp.py @@ -26,7 +26,6 @@ BufferedHTTPResponse. make all calls through httplib. """ -from swift import gettext_ as _ from swift.common import constraints import logging import time @@ -203,15 +202,9 @@ def http_connect(ipaddr, port, device, partition, method, path, :returns: HTTPConnection object """ if isinstance(path, six.text_type): - try: - path = path.encode("utf-8") - except UnicodeError as e: - logging.exception(_('Error encoding to UTF-8: %s'), str(e)) + path = path.encode("utf-8") if isinstance(device, six.text_type): - try: - device = device.encode("utf-8") - except UnicodeError as e: - logging.exception(_('Error encoding to UTF-8: %s'), str(e)) + device = device.encode("utf-8") path = quote('/' + device + '/' + str(partition) + path) return http_connect_raw( ipaddr, port, method, path, headers, query_string, ssl)