Răsfoiți Sursa

HUE-5509 [notebook] Properly handle unicode characters in log output in jdbc connector

Adrian Yavorskyy 8 ani în urmă
părinte
comite
5045739c17
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      desktop/libs/notebook/src/notebook/connectors/jdbc.py

+ 2 - 2
desktop/libs/notebook/src/notebook/connectors/jdbc.py

@@ -20,7 +20,7 @@ import logging
 from django.utils.translation import ugettext as _
 
 from desktop.lib.exceptions_renderable import PopupException
-from desktop.lib.i18n import force_unicode
+from desktop.lib.i18n import force_unicode, smart_str
 from librdbms.jdbc import Jdbc, query_and_fetch
 
 from notebook.connectors.base import Api, QueryError, AuthenticationRequired
@@ -40,7 +40,7 @@ def query_error_handler(func):
     except AuthenticationRequired, e:
       raise e
     except Exception, e:
-      message = force_unicode(str(e))
+      message = force_unicode(smart_str(e))
       if 'error occurred while trying to connect to the Java server' in message:
         raise QueryError(_('%s: is the DB Proxy server running?') % message)
       else: