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

Problem using relativeTo() with strict descendants #57

Closed
burnnat opened this issue Dec 18, 2012 · 2 comments
Closed

Problem using relativeTo() with strict descendants #57

burnnat opened this issue Dec 18, 2012 · 2 comments
Labels

Comments

@burnnat
Copy link

burnnat commented Dec 18, 2012

For some reason, it looks to me like relativeTo() returns unexpected results when the first URI is a strict descendant of the second. For example, I would have expected this to work:

>>> new URI('/base/path/with/subdir/inner.html').relativeTo('/base/path/top.html').toString()
"./with/subdir/inner.html"

Instead, I get this result which seems wrong to me:

>>> new URI('/base/path/with/subdir/inner.html').relativeTo('/base/path/top.html').toString()
"./inner.html"

Reversing them, however, works as expected:

>>> new URI('/base/path/top.html').relativeTo('/base/path/with/subdir/inner.html').toString()
"../../top.html"

Is this a bug, or am I misusing the method in some way? Is this something relativeTo() should be expected to support?

@rodneyrehm
Copy link
Member

This looks like a bug. I'll investigate (around christmas)

@rodneyrehm
Copy link
Member

This has been fixed and released in v1.8.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants