{ "ErrorDump": "the JSON object must be str, not 'bytes'", "StatusCode": "500" }

        response = clt.do_action_with_exception(request___)
## { "ErrorDump": "the JSON object must be str, not 'bytes'", "StatusCode": "500" }
# text = json.loads(response) win ok linux + .decode('utf-8') 加后 win 依然ok
text = json.loads(response.decode('utf-8')) stsDict = dict().fromkeys(['RequestId', 'uid', 'Expiration', 'SecurityToken', 'StatusCode'])
stsDict["RequestId"] = text["RequestId"]
stsDict["uid"] = uid
stsDict['Expiration'] = text["Credentials"]['Expiration']
stsDict['SecurityToken'] = text["Credentials"]['SecurityToken']
stsDict["StatusCode"] = "200"

  

												

the JSON object must be str, not 'bytes'的更多相关文章

  1. HTTPResponse object — JSON object must be str, not 'bytes'

    http://stackoverflow.com/questions/24069197/httpresponse-object-json-object-must-be-str-not-bytes HT ...

  2. python中读取json文件报错,TypeError:the Json object must be str, bytes or bytearray,not ‘TextIOWrapper’

    利用python中的json读取json文件时,因为错误使用了相应的方法导致报错:TypeError:the Json object must be str, bytes or bytearray,n ...

  3. python str与bytes之间的转换

    # bytes object b = b"example" # str object s = "example" # str to bytes bytes(s, ...

  4. Python2和3版本对str和bytes类型的处理

    python2中字符串分为2种类型: 字节类型:str,字节类型,通过decode()转化为unicode类型 unicode类型:unicode ,通过encode转化为str字节类型 字节类型 和 ...

  5. python(61):str 和 bytes 转换

    str 和 bytes 转换 b = b"example" # str object s = "example" # str to bytes bytes(s, ...

  6. Python中的str与bytes之间的转换的三种方法

    # bytes object b = b"example" # str object s = "example" # str to bytes sb = byt ...

  7. python3 str和bytes转换

    bytes object b = b"example" str object s = "example" #str to bytes bytes(s, enco ...

  8. Python之scrapy框架之post传输数据错误:TypeError: to_bytes must receive a unicode, str or bytes object, got int

    错误名:TypeError: to_bytes must receive a unicode, str or bytes object, got int 错误翻译:类型错误:to_bytes必须接收u ...

  9. 由time.tzname返回值引发的对str、bytes转换时编码问题实践

    Windows 10家庭中文版,Python 3.6.4, 下午复习了一下time模块,熟悉一下其中的各种时间格式的转换:时间戳浮点数.struct_tm.字符串,还算顺利. 可是,测试其中的time ...

随机推荐

  1. [转]maven编译时出现读取XXX时出错invalid LOC header (bad signature)

    maven编译时出现读取XXX时出错invalid LOC header (bad signature) 一.发现问题右击pom.xml,run as —> maven install,会看到c ...

  2. CF613A:Peter and Snow Blower

    用一个圆心在(x,y)的圆环覆盖一个n边形,顺或逆时针给出n边形所有顶点,求圆环最小面积. 卡了好久,各种傻逼错误.. 题目就是让我们固定一大一小两个边界圆,我们来看看这两个圆满足什么条件. 首先外面 ...

  3. 前端学习之-- DOM

    Dom == document 1:查找 1:直接查找 document.getElementById('i1') # 根据ID获取一个标签(获取单个元素) document.getElementsB ...

  4. 为什么utf8占用3个字节

    UNICODE是万能编码,包含了所有符号的编码,它规定了所有符号在计算机底层的二进制的表示顺序.有关Unicode为什么会出现就不叙述了,Unicode是针对所有计算机的使用者定义一套统一的编码规范, ...

  5. Delphi字符串加密/解密

    unit uEncrypt_Decrypt;   interface   uses SysUtils;   const XorKey: array[0..7] of Byte = ($B2, $09, ...

  6. zoj4028 LIS

    差分约束瞎搞一下,话说这个数据不知道怎么回事,我的图按道理而言最多只有4n条边,开5n还不够??必须6n?? 约束条件首先根据f函数可建立两点之间的约束,不妨设d[i]为i到0的距离,则对于f[i] ...

  7. FatMouse's Speed--hdu1160(dp+输出路径)

    Problem Description FatMouse believes that the fatter a mouse is, the faster it runs. To disprove th ...

  8. 洛谷—— P1133 教主的花园

    https://www.luogu.org/problem/show?pid=1133 题目描述 教主有着一个环形的花园,他想在花园周围均匀地种上n棵树,但是教主花园的土壤很特别,每个位置适合种的树都 ...

  9. Java多线程分析案例

    1. 多线程的创建方式 (1).继承 Thread类:但Thread本质上也是实现了Runnable 接口的一个实例,它代表一个线程的实例,并且,启动线程的唯一方法就是通过 Thread 类的 sta ...

  10. Entity framework自定义字段实现思路

    ublic class MyModel { public int MyModelID { get; set; } public string FixedProperty1 { get; set; } ...