transformation name with spaces causes 400 error
@const-cloudinary đang làm issue này rồi.
Từ ngày 8/1/2019.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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}
- Ngôn ngữ chính
- Python
- Star
- 262
- Fork
- 133
- Merge trung bình
- 3 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudinary/pycloudinary
-
resources_by_asset_folder Not workingCó thể làm lại được @someshfengde đã nhận 774 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
cloudinary/pycloudinary#386 · 3 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
cloudinary/pycloudinary#385 · 2 bình luận ·
-
cloudinary.api.resources_by_asset_folder ErrorCó thể làm lại được @atdcloud đã nhận 1266 ngày trước và không có pull request nào đang mở. Đang mởquestion
cloudinary/pycloudinary#349 · 1 reaction · 1 người được giao ·
-
Feature: Bad Format exceptionCó thể làm lại được @const-cloudinary đã nhận 2139 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/pycloudinary#266 · 2 bình luận · 1 người được giao ·
-
CloudinaryFileField doesn't show checkbox for clear the fieldCó thể làm lại được @YomesInc đã nhận 2229 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/pycloudinary#258 · 2 bình luận · 1 người được giao ·
Tất cả issue của cloudinary/pycloudinary
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gorakhargosh/watchdog#1462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
openwisp/openwisp-monitoring#889 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenFreeEnergy/Lomap#180 ·
-
generate_observation_scenario_from_cpgs exposure time conversion when auto-gain set to 'yes'Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
roman-corgi/corgisim#327 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
agent:WSL bug code-review linux pri:medium sev:low tooling
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày