浏览代码

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

Harsh Gupta 3 年之前
父节点
当前提交
7e8bea6dd1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      desktop/core/src/desktop/lib/thrift_util.py

+ 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):
   """