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分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudinary/pycloudinary のほかの issue
-
resources_by_asset_folder Not working再び着手できるかも @someshfengde が 774 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
cloudinary/pycloudinary#386 · コメント 3 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cloudinary/pycloudinary#385 · コメント 2 件 ·
-
cloudinary.api.resources_by_asset_folder Error再び着手できるかも @atdcloud が 1266 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンquestion
cloudinary/pycloudinary#349 · リアクション 1 件 · 担当者 1 名 ·
-
Feature: Bad Format exception再び着手できるかも @const-cloudinary が 2139 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
cloudinary/pycloudinary#266 · コメント 2 件 · 担当者 1 名 ·
-
CloudinaryFileField doesn't show checkbox for clear the field再び着手できるかも @YomesInc が 2229 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
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 日以内に返信