Python 3.12: fix for urlunparse() not returning properly-prefixed file:/// URLs #66911
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes
salt:///
URL handling.Issue spotted when using
file.template
and Salt-SSH. This issue caused the relative portion of the URL to be truncated two characters in the front, which caused the template files affected not being found by the minion.Technically, a
file:path/to/file
URL is legal (although quite nonsensical), but since we know thiscreate()
function only gets paths that are absolute (or, rather, always relative to a specific root path), it's OK for us to do this. Even thereturn
line of the function betrays this by adding prefixsalt:///
.What issues does this PR fix or reference?
None known, so far it is original bug.
Previous Behavior
This used to work.
New Behavior
This does not work in 3007.1 anymore.
Merge requirements satisfied?
Sorry, I just want to fix this issue, I don't have time for these requirements. If someone else wants to adopt this change, good, please go ahead and steal the change — you are hereby authorized to do so, you don't even have to credit me (but it would be nice if I was). If not, Salt-SSH can stay broken and I can live with my patch locally forever. If you need a towncrier change log entry, please just push that to the branch.