Skip to content

Commit b671bc8

Browse files
committed
Manually construct url
urlunparse does not handle unicode properly
1 parent d28bc27 commit b671bc8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

prestodb/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
>> rows = list(query.execute())
3434
"""
3535

36-
from urllib.parse import urlunparse
3736
import logging
3837
import os
3938
from requests_kerberos.exceptions import KerberosExchangeError
@@ -288,8 +287,12 @@ def max_attempts(self, value):
288287

289288
def get_url(self, path):
290289
# type: Text -> Text
291-
destination = '{}:{}'.format(self._host, self._port)
292-
return urlunparse((self._http_scheme, destination, path, '', '', ''))
290+
return "{protocol}://{host}:{port}{path}".format(
291+
protocol=self._http_scheme,
292+
host=self._host,
293+
port=self._port,
294+
path=path
295+
)
293296

294297
@property
295298
def statement_url(self):

0 commit comments

Comments
 (0)