Skip to content

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Oct 8, 2024

Explanation: Fixes various URL path API behaviors to match the expected behavior from before the Swift URL implementation:

  • Drops trailing slashes from URL.fileSystemPath and URL.path
  • Strips trailing slashes in URL(filePath:) if a user supplies .notDirectory
  • Does not treat ~ paths as absolute in URL(filePath:), resolves the tilde and prevents a crash during initialization
  • Strips the leading slash of Windows drive letter paths on Windows
  • Prevents unexpected path extension API behavior when the path is a directory

Scope: Targeted changes to URL path APIs to maintain compatibility
Original PRs: #852, #867, #961, #964, #965
Risk: Low - Targeted scope, restores expected behavior
Testing: Local, swift-ci from swift, swift-foundation, and swift-corelibs-foundation, stable in main
Reviewers: @jmschonfeld @iCharlesHu

@jrflat
Copy link
Contributor Author

jrflat commented Oct 8, 2024

@swift-ci please test

@parkera
Copy link
Contributor

parkera commented Oct 14, 2024

We'll need these for the 6.0.2 branch too.

@jrflat
Copy link
Contributor Author

jrflat commented Oct 14, 2024

Cherry-picks for 6.0.2 here: #983

@jrflat jrflat merged commit 77f79ed into swiftlang:release/6.0 Oct 14, 2024
3 checks passed
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.

2 participants