transformation name with spaces causes 400 error
@const-cloudinary is already working on this.
Since Jan 8, 2019.
Assessment
This issue has not been assessed yet.
Description
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}
- Dominant language
- Python
- Stars
- 262
- Forks
- 133
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudinary/pycloudinary
-
resources_by_asset_folder Not workingMay be free again @someshfengde claimed this 775 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
cloudinary/pycloudinary#386 · 3 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
cloudinary/pycloudinary#385 · 2 comments ·
-
cloudinary.api.resources_by_asset_folder ErrorMay be free again @atdcloud claimed this 1266 days ago, and no pull request is open. Openquestion
cloudinary/pycloudinary#349 · 1 reaction · 1 assignee ·
-
Feature: Bad Format exceptionMay be free again @const-cloudinary claimed this 2139 days ago, and no pull request is open. Open
cloudinary/pycloudinary#266 · 2 comments · 1 assignee ·
-
CloudinaryFileField doesn't show checkbox for clear the fieldMay be free again @YomesInc claimed this 2229 days ago, and no pull request is open. Open
cloudinary/pycloudinary#258 · 2 comments · 1 assignee ·
All issues in cloudinary/pycloudinary
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
peach-mitao/peach#693 ·
Maintainers usually reply within 1 day
-
FTP reads inside a transaction use a nonexistent staging pathPossibly taken @Harsh23Kashyap claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
fsspec/filesystem_spec#2463 ·
Maintainers usually reply within 1 day
-
comp/cli P2 tool/code-exec type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#155989 ·
Maintainers usually reply within 1 day
-
PipesFileMessageReader parses a partially written message line: tail_file yields a line before its newline arrivesPossibly taken @PCTEJA claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dagster-io/dagster#34442 ·
Maintainers usually reply within 1 day