mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
dodge cpython bug
This commit is contained in:
parent
e897df3b34
commit
4418508513
|
@ -111,7 +111,27 @@ class VFS(object):
|
||||||
if rem:
|
if rem:
|
||||||
rp += "/" + rem
|
rp += "/" + rem
|
||||||
|
|
||||||
return fsdec(os.path.realpath(fsenc(rp)))
|
try:
|
||||||
|
return fsdec(os.path.realpath(fsenc(rp)))
|
||||||
|
except:
|
||||||
|
if not WINDOWS:
|
||||||
|
raise
|
||||||
|
|
||||||
|
# cpython bug introduced in 3.8, still exists in 3.9.1;
|
||||||
|
# some win7sp1 and win10:20H2 boxes cannot realpath a
|
||||||
|
# networked drive letter such as b"n:" or b"n:\\"
|
||||||
|
#
|
||||||
|
# requirements to trigger:
|
||||||
|
# * bytestring (not unicode str)
|
||||||
|
# * just the drive letter (subfolders are ok)
|
||||||
|
# * networked drive (regular disks and vmhgfs are ok)
|
||||||
|
# * on an enterprise network (idk, cannot repro with samba)
|
||||||
|
#
|
||||||
|
# hits the following exceptions in succession:
|
||||||
|
# * access denied at L601: "path = _getfinalpathname(path)"
|
||||||
|
# * "cant concat str to bytes" at L621: "return path + tail"
|
||||||
|
#
|
||||||
|
return os.path.realpath(rp)
|
||||||
|
|
||||||
def ls(self, rem, uname, scandir, lstat=False):
|
def ls(self, rem, uname, scandir, lstat=False):
|
||||||
"""return user-readable [fsdir,real,virt] items at vpath"""
|
"""return user-readable [fsdir,real,virt] items at vpath"""
|
||||||
|
|
Loading…
Reference in a new issue