mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 21:50:44 +00:00
发 1.9.0 时代码已经推到两个平台了,但建发行版那一步直接崩:
AttributeError: 'NoneType' object has no attribute 'get'
根因:Gitee 的 GET /releases/tags/{tag} 在「标签存在、但还没有
发行版」时返回的是 **HTTP 200 + JSON 字面量 null**(不是 404)。
于是 json.loads() 得到 None,再取 ["id"] 就炸了。
实测那条接口对 v1.9.0 就是 200 + null 这个响应。
改成容忍 None —— 取不到 id 就走「新建发行版」那条路。
(另外记一笔:这次提交我本来想用 git commit -m 加多行中文,
PowerShell 把引号搞乱了,git 报 Invalid path '/null'。
多行中文提交信息一律用 git commit -F 文件,别用 -m。)
18 lines
802 B
Plaintext
18 lines
802 B
Plaintext
修发布脚本崩在 Gitee 那一步:返回 null 时没有兜住
|
|
|
|
发 1.9.0 时代码已经推到两个平台了,但建发行版那一步直接崩:
|
|
|
|
AttributeError: 'NoneType' object has no attribute 'get'
|
|
|
|
根因:Gitee 的 GET /releases/tags/{tag} 在「标签存在、但还没有
|
|
发行版」时返回的是 **HTTP 200 + JSON 字面量 null**(不是 404)。
|
|
于是 json.loads() 得到 None,再取 ["id"] 就炸了。
|
|
|
|
实测那条接口对 v1.9.0 就是 200 + null 这个响应。
|
|
|
|
改成容忍 None —— 取不到 id 就走「新建发行版」那条路。
|
|
|
|
(另外记一笔:这次提交我本来想用 git commit -m 加多行中文,
|
|
PowerShell 把引号搞乱了,git 报 Invalid path '/null'。
|
|
多行中文提交信息一律用 git commit -F 文件,别用 -m。)
|