File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change
1
+ v5.8.1
2
+ ======
3
+
4
+ * #253: In ``MultiplexedPath ``, restore expectation that
5
+ a compound path with a non-existent directory does not
6
+ raise an exception.
7
+
1
8
v5.8.0
2
9
======
3
10
Original file line number Diff line number Diff line change @@ -85,13 +85,10 @@ def is_file(self):
85
85
def joinpath (self , * descendants ):
86
86
try :
87
87
return super ().joinpath (* descendants )
88
- except abc .TraversalError as exc :
89
- # One of the paths didn't resolve.
90
- msg , target , names = exc .args
91
- if names : # pragma: nocover
92
- raise
93
- # It was the last; construct result with the first path.
94
- return self ._paths [0 ].joinpath (target )
88
+ except abc .TraversalError :
89
+ # One of the paths did not resolve (a directory does not exist).
90
+ # Just return something that will not exist.
91
+ return self ._paths [0 ].joinpath (* descendants )
95
92
96
93
def open (self , * args , ** kwargs ):
97
94
raise FileNotFoundError (f'{ self } is not a file' )
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ def test_join_path(self):
77
77
)
78
78
self .assertEqual (path .joinpath (), path )
79
79
80
+ def test_join_path_compound (self ):
81
+ path = MultiplexedPath (self .folder )
82
+ assert not path .joinpath ('imaginary/foo.py' ).exists ()
83
+
80
84
def test_repr (self ):
81
85
self .assertEqual (
82
86
repr (MultiplexedPath (self .folder )),
You can’t perform that action at this time.
0 commit comments