Problem using relativeTo() with strict descendants #57

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

2 participants

@burnnat

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
Medialize member

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

@rodneyrehm
Medialize member

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