File tree 2 files changed +17
-5
lines changed 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change
1
+ v5.7.1
2
+ ======
3
+
4
+ * #249: In ``simple.ResourceContainer.joinpath ``, honor
5
+ names split by ``posixpath.sep ``.
6
+
1
7
v5.7.0
2
8
======
3
9
Original file line number Diff line number Diff line change @@ -99,13 +99,19 @@ def iterdir(self):
99
99
def open (self , * args , ** kwargs ):
100
100
raise IsADirectoryError ()
101
101
102
- def joinpath (self , * names ):
103
- if not names :
102
+ @staticmethod
103
+ def _flatten (compound_names ):
104
+ for name in compound_names :
105
+ yield from name .split ('/' )
106
+
107
+ def joinpath (self , * descendants ):
108
+ if not descendants :
104
109
return self
105
- name , rest = names [0 ], names [1 :]
110
+ names = self ._flatten (descendants )
111
+ target = next (names )
106
112
return next (
107
- traversable for traversable in self .iterdir () if traversable .name == name
108
- ).joinpath (* rest )
113
+ traversable for traversable in self .iterdir () if traversable .name == target
114
+ ).joinpath (* names )
109
115
110
116
111
117
class TraversableReader (TraversableResources , SimpleReader ):
You can’t perform that action at this time.
0 commit comments