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

Keep a trailing slash in URL.joinpath #866

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

gmacon
Copy link
Contributor

@gmacon gmacon commented May 3, 2023

What do these changes do?

This fixes the regression in URL.joinpath that stopped it from preserving a trailing slash in the path components to be joined.

Are there changes in behavior for the user?

A statement like URL("http://example.com") / "foo/" will again preserve the trailing slash.

Related issue number

Fixes #862

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label May 3, 2023
@webknjaz webknjaz requested a review from mjpieters May 22, 2023 16:56
@webknjaz webknjaz added the bug label May 22, 2023
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #866 (bd789e0) into master (cfc634e) will decrease coverage by 0.65%.
The diff coverage is 100.00%.

❗ Current head bd789e0 differs from pull request most recent head c23432a. Consider uploading reports for the commit c23432a to get more accurate results

@@            Coverage Diff             @@
##           master     #866      +/-   ##
==========================================
- Coverage   99.74%   99.09%   -0.65%     
==========================================
  Files           4        4              
  Lines         772      775       +3     
  Branches      219      178      -41     
==========================================
- Hits          770      768       -2     
- Misses          2        4       +2     
- Partials        0        3       +3     
Flag Coverage Δ
unit 99.09% <100.00%> (-0.52%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
yarl/_url.py 99.67% <100.00%> (+<0.01%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@mjpieters mjpieters left a comment

Choose a reason for hiding this comment

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

Excellent, this looks great.

I've requested a small change that simplifies the _make_child() logic a little; once that's done this should be good to go.

yarl/_url.py Outdated Show resolved Hide resolved
yarl/_url.py Outdated Show resolved Hide resolved
tests/test_url.py Show resolved Hide resolved
@gmacon gmacon force-pushed the 862-joinpath-trailing-slash branch from bd789e0 to c23432a Compare June 7, 2023 14:05
@gmacon gmacon requested a review from mjpieters June 7, 2023 14:06
@mjpieters mjpieters merged commit 1f2cd22 into aio-libs:master Jun 7, 2023
@gmacon gmacon deleted the 862-joinpath-trailing-slash branch June 15, 2023 18:06
webknjaz added a commit that referenced this pull request Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Another regression in URL join behavior
3 participants