Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update check_query_length(), Unicode support #230

Merged
merged 6 commits into from
Sep 7, 2018

Conversation

valgur
Copy link
Member

@valgur valgur commented Sep 5, 2018

The server-side query string handling has changed a bit so we need to update the calculation logic in check_query_length(). Related to #228.

@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

Merging #230 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #230   +/-   ##
=======================================
  Coverage   95.67%   95.67%           
=======================================
  Files           3        3           
  Lines         555      555           
  Branches      118      118           
=======================================
  Hits          531      531           
  Misses         15       15           
  Partials        9        9
Impacted Files Coverage Δ
sentinelsat/sentinel.py 95.27% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e193d8...eb89e3e. Read the comment docs.

"~" is no longer URL-encoded in Python 3.7
DHUS expects non-ASCII characters to be encoded in latin-1.
Added proper Unicode support by explicitly setting our encoding to UTF-8
in the request header.

Added a unit test for this as well, but VCR.py does not properly support
Unicode characters in request bodies, so I disabled this for now.
@valgur valgur changed the title Update check_query_length() Update check_query_length(), Unicode support Sep 6, 2018
@valgur
Copy link
Member Author

valgur commented Sep 6, 2018

I also added Unicode support for search queries. The server parses query strings as Latin-1 by default, but can be made to accept UTF-8 by setting a specific header.
I know there is hardly ever a need for Unicode symbols in queries, but it does not hurt to have this support either.

@valgur
Copy link
Member Author

valgur commented Sep 6, 2018

The unit test for Unicode support is currently disabled due to a VCR.py bug. The test can be enabled again once kevin1024/vcrpy#386 gets pulled and included in a release.

Copy link
Contributor

@j08lue j08lue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@valgur valgur merged commit 91a9c03 into sentinelsat:master Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants