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
-
難度 1/5 1 小時以內 新手友好度 72/100
btclib-org/btclib-node#2505 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
open-webui/open-webui#34462 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 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 小時 新手友好度 72/100
IETF-Hackathon/pqc-certificates#351 ·
維護者通常 2 天內回覆