aliyun / aliyun-oss-python-sdk

Aliyun OSS SDK for Python
MIT License
931 stars 363 forks source link

写assert result.resp.read() == b'{"Status":"OK"}'的人很闲吗? #386

Open vvky opened 4 months ago

vvky commented 4 months ago

object_callback.py里的这玩意真**莫名其妙

assert result.resp.read() == b'{"Status":"OK"}'

我回调服务器是用flask响应的标准json数据

{
    "Status": "OK"
}

从response里拿出来长这样:

b'{\n  "Status": "OK"\n}\n'

结果因为包含'\n'换行符卡在这处assert,你说你官方demo,整这玩意干啥?谁家http接口会响应一个没缩进没换行的source string??????

sswest commented 3 months ago

接口响应格式化后的json字符串才是少见吧🤣