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

Comments

Projects
None yet
2 participants
@burnnat

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

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Dec 18, 2012

Member

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

Member

rodneyrehm commented Dec 18, 2012

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

@rodneyrehm

This comment has been minimized.

Show comment
Hide comment
@rodneyrehm

rodneyrehm Dec 27, 2012

Member

This has been fixed and released in v1.8.2.

Member

rodneyrehm commented Dec 27, 2012

This has been fixed and released in v1.8.2.

@rodneyrehm rodneyrehm closed this Dec 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment