Skip to content

Commit 12eaaca

Browse files
authored
Merge branch 'master' into dev/add-cache
2 parents f361d98 + 3f9f6a7 commit 12eaaca

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
REQUIREMENTS = [
2626
"fs>2.0",
2727
"webdavclient2",
28-
"python-dateutil",
2928
"cachetools"
29+
"webdavclient3",
30+
"python-dateutil"
31+
3032
]
3133

3234
setup(

webdavfs/opener.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ def open_fs(self, fs_url, parse_result, writeable, create, cwd):
1919
webdav_host, _, webdav_port = webdav_host.partition(':')
2020
if parse_result.protocol == 'webdav':
2121
webdav_scheme = 'http'
22-
webdav_port = 80
22+
default_webdav_port = 80
2323
else:
2424
webdav_scheme = 'https'
25-
webdav_port = 443
25+
default_webdav_port = 443
26+
27+
if webdav_port == "":
28+
webdav_port = default_webdav_port
29+
else:
30+
webdav_port = int(webdav_port)
2631

2732
return WebDAVFS(
2833
url='{}://{}:{}'.format(webdav_scheme, webdav_host, webdav_port),

webdavfs/webdavfs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import operator
1010
import logging
1111

12-
import webdav2.client as wc
13-
import webdav2.exceptions as we
14-
import webdav2.urn as wu
12+
import webdav3.client as wc
13+
import webdav3.exceptions as we
14+
import webdav3.urn as wu
1515

1616
from fs import errors
1717
from fs.base import FS
@@ -250,6 +250,9 @@ def getinfo(self, path, namespaces=None):
250250
else:
251251
try:
252252
info = self.client.info(_path.encode('utf-8'))
253+
# displayname is optional
254+
if info['name'] is None:
255+
info['name'] = _path.split("/")[-1]
253256
info_dict = self._create_info_dict(info)
254257
if self.client.is_dir(_path.encode('utf-8')):
255258
info_dict['basic']['is_dir'] = True

0 commit comments

Comments
 (0)