Skip to content

Conversation

@jvanasco
Copy link
Contributor

@jvanasco jvanasco commented May 9, 2019

Don't decode %23 to # when it appears in a URL

Fixes #91

  • tests-new: test_url.CanonicalizeUrlTest.test_preserve_nonfragment_hash
  • tests-pass: py27, py36
  • notes: adjustment to _safe_chars suggested by @Gallaecio

* issue scrapy#91
* description: don't decode `%23` to `#` when it appears in a url
* tests-new: test_url.CanonicalizeUrlTest.test_preserve_nonfragment_hash
* tests-pass: py27, py36
* notes: adjustment to _safe_chars suggested by @Gallaecio
@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #128 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
+ Coverage    95.3%   95.31%   +<.01%     
==========================================
  Files           7        7              
  Lines         469      470       +1     
  Branches       93       93              
==========================================
+ Hits          447      448       +1     
  Misses         15       15              
  Partials        7        7
Impacted Files Coverage Δ
w3lib/url.py 97.92% <100%> (+0.01%) ⬆️

@Gallaecio Gallaecio changed the title fix: preservation of url encoded hash signs. [MRG+1] fix: preservation of url encoded hash signs. May 10, 2019
@kmike
Copy link
Member

kmike commented Aug 8, 2019

Hey! I think canonicalize_url changes are good, but I'm not sure how it affects other functions - is it a right thing to do for safe_url_string, etc.? Could you please add tests for other affected functions as well?

@Gallaecio
Copy link
Member

@jvanasco Do you think you’ll have time to address @kmike’s feedback?

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.

canonicalize_url use of safe_url_string breaks when an encoded hash character is encountered

3 participants