Эх сурвалжийг харах

[hiveserver2] Fix unpacking guid by using base64.b64decode for python3 (#2949)

Harsh Gupta 3 жил өмнө
parent
commit
7e8bea6dd1

+ 2 - 1
desktop/core/src/desktop/lib/thrift_util.py

@@ -605,7 +605,8 @@ def unpack_guid(guid):
   return "%016x:%016x" % struct.unpack(b"QQ", guid)
 
 def unpack_guid_base64(guid):
-  return "%016x:%016x" % struct.unpack(b"QQ", base64.decodestring(guid))
+  decoded_guid = base64.b64decode(guid) if sys.version_info[0] > 2 else base64.decodestring(guid)
+  return "%016x:%016x" % struct.unpack(b"QQ", decoded_guid)
 
 def simpler_string(thrift_obj):
   """