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

DM-28674: Allow # to mean fragment in schemeless URIs #469

Merged
merged 2 commits into from Feb 5, 2021
Merged

Conversation

timj
Copy link
Member

@timj timj commented Feb 4, 2021

No description provided.

Previously we always escaped # but for quantum graph subsetting
it makes sense to allow # generally for all URIs.

This change assumes that # in the directory part of the
filename should not be treated as fragments.
This will confuse URI handlers in some cases and it's safer
to disallow it.
@timj timj requested a review from natelust February 4, 2021 22:53
Copy link
Contributor

@natelust natelust left a comment

Choose a reason for hiding this comment

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

All looks fine, minor comment just as a side note, looks fine to go in as is.

head, tail = os.path.split(output)
output = os.path.join(head, tail.replace(".", "_"))
tail = tail.replace(".", "_")
tail = tail.replace("#", "HASH")
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably dont care about speed here (at the number of times this will be called its negligible), and what is more readable probably depends on who reads it, but FWIW, tail.replace(".", "_").replace("#", "HASH") is a bit faster (I personally find it easier to grok, but others might not). This is more a side comment and not an explicit request to change.

@timj timj merged commit 4589ee0 into master Feb 5, 2021
@timj timj deleted the tickets/DM-28674 branch February 5, 2021 16:28
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.

None yet

2 participants