This repository was archived by the owner on Jan 4, 2025. It is now read-only.
Fix for double encoding of the timestamp in the params#258
Merged
Bobspadger merged 1 commit intomasterfrom Mar 15, 2021
Merged
Conversation
…`.isoformat()` method returns it as a valid string and the `quote` just double encodes the values. Tests all still pass, and this has been verified by integration testing on the products endpoint. Version bump to 0.8.13
GriceTurrble
approved these changes
Mar 15, 2021
|
@Bobspadger, not sure if you already tested with other data types, but apparently the root cause is that both You fixed it for dates, but if |
GriceTurrble
pushed a commit
that referenced
this pull request
Jun 4, 2021
Currently, the `0.8.x` branch breaks string parameters by encoding them twice, first in the `clean_params_dict` function, and then in `calc_request_description`. Because of this, parameters prone to have characters that must be escaped, like `NextToken` and URLs, do not work correctly. #258 was an attempt to fix this issue, but only for timestamp fields. Strings are still broken. This solution is a backport of a commit (#65) that is already present in the `develop` branch, where the `calc_request_description` function is no longer responsible for escaping the received parameters. It also rollbacks #258, as `clean_date` must encode the received values now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #257
Stops the double encoding of the text string with the
clean_string()method as the.isoformat()on the datetime object returns valid string already.By calling the clean_string() method we got a double encoded timestamp that broke the Amazon MWS calls.
This is a confirmed working fix by testing against a couple of live endpoints, and confirmed the bug existed by getting the MWS errors back.
The code that breaks the calls appears to be in Develop branch as well - I've not investigated too hard as to why the different versions give different results as this was more an emergency fix to get a working version out onto pypi.
@GriceTurrble FYI but I'm going to merge this and push out to pypi ASAP