transformation name with spaces causes 400 error
@const-cloudinary 已经在做这个了。
开始于 2019年1月8日。
评估
这个 Issue 还没有评估数据。
描述
Making a call to get transformations, some of them come back with spaces in the name like this:
{u'allowed_for_strict': False,
u'name': u'fl_progressive,t_primary/t_t_primary@2x jpg.t_primary@2x jpg.display@2x',
u'used': False},
Now trying to use that (ignoring issue #41 for now), generates a 400 server error:
In [10]: name = 'fl_progressive,t_primary/t_t_primary@2x jpg.t_primary@2x jpg.display@2x'
In [11]: cloudinary.api.transformation(name)
---------------------------------------------------------------------------
GeneralError Traceback (most recent call last)
<ipython-input-11-031ddf1dde0b> in <module>()
----> 1 cloudinary.api.transformation(name)
.../venv/lib/python2.7/site-packages/cloudinary/api.pyc in transformation(transformation, **options)
129 def transformation(transformation, **options):
130 uri = ["transformations", transformation_string(transformation)]
--> 131 return call_api("get", uri, only(options, "max_results"), **options)
132
133 def delete_transformation(transformation, **options):
.../venv/lib/python2.7/site-packages/cloudinary/api.pyc in call_api(method, uri, params, **options)
225 # Error is parsing json
226 e = sys.exc_info()[1]
--> 227 raise GeneralError("Error parsing server response (%d) - %s. Got - %s" % (response.code, body, e))
228
229 if "error" in result:
GeneralError: Error parsing server response (400) - . Got - No JSON object could be decoded
The fix it seems is to renencode the name using url encoding:
In [12]: name = 'fl_progressive,t_primary/t_t_primary@2x%20jpg.t_primary@2x%20jpg.display@2x'
In [13]: cloudinary.api.transformation(name)
Out[13]:
{u'allowed_for_strict': False,
u'derived': [],
u'info': [{u'flags': [u'progressive'], u'transformation': [u'primary']},
{u'transformation': [u't_primary@2x jpg', u'display@2x']}],
u'name': u'fl_progressive,t_primary/t_t_primary@2x jpg.t_primary@2x jpg.display@2x',
u'used': False}
- 主要语言
- Python
- 星标
- 262
- 派生
- 133
- 平均合并
- 3 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudinary/pycloudinary 的其他 Issue
-
resources_by_asset_folder Not working可能重新可做 @someshfengde 于 774 天前认领,目前没有进行中的 PR。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
cloudinary/pycloudinary#386 · 3 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 30/100
cloudinary/pycloudinary#385 · 2 条评论 ·
-
cloudinary.api.resources_by_asset_folder Error可能重新可做 @atdcloud 于 1266 天前认领,目前没有进行中的 PR。 未关闭question
cloudinary/pycloudinary#349 · 1 个 reaction · 已指派 1 人 ·
-
Feature: Bad Format exception可能重新可做 @const-cloudinary 于 2139 天前认领,目前没有进行中的 PR。 未关闭
cloudinary/pycloudinary#266 · 2 条评论 · 已指派 1 人 ·
-
CloudinaryFileField doesn't show checkbox for clear the field可能重新可做 @YomesInc 于 2229 天前认领,目前没有进行中的 PR。 未关闭
cloudinary/pycloudinary#258 · 2 条评论 · 已指派 1 人 ·
查看 cloudinary/pycloudinary 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
gorakhargosh/watchdog#1462 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
openwisp/openwisp-monitoring#889 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
OpenFreeEnergy/Lomap#180 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
roman-corgi/corgisim#327 ·
维护者通常 2 天内回复
-
agent:WSL bug code-review linux pri:medium sev:low tooling
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复