Skip to content

Commit 0f989fb

Browse files
committed
add root marker if fs is hdfs
1 parent 8a54312 commit 0f989fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

upath/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def __init__(self, parsed_url, *args, **kwargs):
2121
url_kwargs = cls._get_kwargs_from_urls(urllib.parse.urlunparse(self._url))
2222
url_kwargs.update(kwargs)
2323
self._fs = cls(**url_kwargs)
24+
if self._url.scheme in ['hdfs']:
25+
self._fs.root_marker = '/'
26+
2427

2528
def argument_upath_self_to_filepath(self, func):
2629
'''if arguments are passed to the wrapped function, and if the first
@@ -103,7 +106,7 @@ def __new__(cls, *args, **kwargs):
103106

104107
class UniversalPath(Path, PureUniversalPath):
105108

106-
__slots__ = ('_url', '_kwargs')
109+
__slots__ = ('_url', '_kwargs', '_closed')
107110

108111
not_implemented = ['cwd', 'home', 'expanduser', 'group', 'is_mount',
109112
'is_symlink', 'is_socket', 'is_fifo', 'is_block_device',

0 commit comments

Comments
 (0)