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

Combining two pathes including step back lead to incorrect path #35

Closed
Antondomashnev opened this issue Aug 7, 2017 · 0 comments
Closed
Labels

Comments

@Antondomashnev
Copy link
Contributor

The core of the question is in Sourcery issue.

Example input:

p1 = Path(".")
p2 = Path("./../Foo")
p3 = p1 + p2

Expected output:

print(p3) -> "./../Foo"

Actual output:

print(p3) -> "./Foo"

I may be wrong in assumption, but I've tested in ruby with pathname and the + works as expected:

2.3.3 :001 > require 'pathname'
 => true 
2.3.3 :002 > p1 = Pathname.new(".")
 => #<Pathname:.> 
2.3.3 :003 > p2 = Pathname.new("./../ios-guest")
 => #<Pathname:./../ios-guest> 
2.3.3 :004 > p1.realpath
 => #<Pathname:/Users/antondomashnev/Work/Sourcery> 
2.3.3 :005 > p2.realpath
 => #<Pathname:/Users/antondomashnev/Work/ios-guest> 
2.3.3 :006 > p3 = p1 + p2
 => #<Pathname:../ios-guest> 
2.3.3 :007 > p3.realpath
 => #<Pathname:/Users/antondomashnev/Work/ios-guest> 
2.3.3 :008 > 
@kylef kylef added the bug label Aug 7, 2017
@Antondomashnev Antondomashnev changed the title Combining two pathes including step back question Combining two pathes including step back lead to incorrect path Aug 8, 2017
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