Skip to content

fix: use quote instead of quote_plus - #324

Open
vladimir-mencl-eresearch wants to merge 1 commit into
IdentityPython:masterfrom
REANNZ:use_quote
Open

fix: use quote instead of quote_plus#324
vladimir-mencl-eresearch wants to merge 1 commit into
IdentityPython:masterfrom
REANNZ:use_quote

Conversation

@vladimir-mencl-eresearch

Copy link
Copy Markdown

MDQ spec explicitly asks for spaces to be encoded as %20, not +

This is achieved by urllib.parse.quote - the only difference quote_plus brings is it would be encoding spaces as +:
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_plus

While entityIDs cannot really contain spaces (not permitted in an URI), this is all just a technicality, but quote is the correct function to use.

All Submissions:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what problem you are trying to solve with this PR?
  • Have you added information on what your changes do and why you chose this as your solution?
  • [N/A] Have you written new tests for your changes?
  • Does your submission pass tests?
  • This project follows PEP8 style guide. Have you run your code against the 'flake8' linter?
MDQ spec explicitly asks for spaces to be encoded as %20, not +

This is achieved by urllib.parse.quote - the only difference quote_plus
brings is it would be encoding spaces as '+':
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_plus

While entityIDs cannot really contain spaces (not permitted in an URI),
this is all just a technicality, but quote is the correct function to use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant