Skip to content

Fragment handling for unknown schemes #104

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

Closed
gazpachoking opened this issue May 12, 2013 · 7 comments · Fixed by #106
Closed

Fragment handling for unknown schemes #104

gazpachoking opened this issue May 12, 2013 · 7 comments · Fixed by #106
Labels
Bug Something doesn't work the way it should.

Comments

@gazpachoking
Copy link
Contributor

We use urldefrag and urlparse to deal with splitting fragments, and on python < 3.3 this doesn't work for URIs with unknown schemes, e.g. foo://bar#something

@gazpachoking
Copy link
Contributor Author

We could provide our own versions of urlparse and urldefrag, which, on python < 3.3 appended any unknown schemes to urlparse.uses_fragment beforehand.

@gazpachoking
Copy link
Contributor Author

Possibly also do this for urljoin and add the scheme to urlparse.uses_relative and urlparse.uses_netloc too. This would apply to python 3.3 as well.

@Julian
Copy link
Member

Julian commented May 12, 2013

Seems like the patch from http://bugs.python.org/issue9374 is probably what we want? Looks like it was backed out from being back ported to 2.7.

No?

@gazpachoking
Copy link
Contributor Author

Yeah, that patch would fix our issue. What are you thinking, monkeypatch urlparse?

@gazpachoking
Copy link
Contributor Author

(Well it would fix fragment issue. Combining relative uris with the base uri also works differently with unknown schemes, but I'm thinking maybe user is responsible for adding their scheme to uses_relative and uses_netloc if they need it to work like that.)

@Julian
Copy link
Member

Julian commented May 13, 2013

No need to monkey patch, just copy and paste to include it would work along with using the one we include rather than urlparse.

@gazpachoking
Copy link
Contributor Author

Oh hmm, why was I being silly? Yes, this makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something doesn't work the way it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants