mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
android's got hella strict filename rules
This commit is contained in:
parent
afcd98b794
commit
474d5a155b
|
@ -57,6 +57,7 @@ SSEELOG = " ({})".format(SEE_LOG)
|
|||
BAD_CFG = "invalid config; {}".format(SEE_LOG)
|
||||
SBADCFG = " ({})".format(BAD_CFG)
|
||||
|
||||
|
||||
class AXS(object):
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -41,8 +41,8 @@ from .util import (
|
|||
MultipartParser,
|
||||
Pebkac,
|
||||
UnrecvEOF,
|
||||
alltrace,
|
||||
absreal,
|
||||
alltrace,
|
||||
atomic_move,
|
||||
exclude_dotfiles,
|
||||
fsenc,
|
||||
|
|
|
@ -1228,12 +1228,15 @@ def ren_open(
|
|||
except OSError as ex_:
|
||||
ex = ex_
|
||||
|
||||
if ex.errno == errno.EINVAL and not asciified:
|
||||
# EPERM: android13
|
||||
if ex.errno in (errno.EINVAL, errno.EPERM) and not asciified:
|
||||
asciified = True
|
||||
bname, fname = [
|
||||
zs.encode("ascii", "replace").decode("ascii").replace("?", "_")
|
||||
for zs in [bname, fname]
|
||||
]
|
||||
zsl = []
|
||||
for zs in (bname, fname):
|
||||
zs = zs.encode("ascii", "replace").decode("ascii")
|
||||
zs = re.sub(r"[^][a-zA-Z0-9(){}.,+=!-]", "_", zs)
|
||||
zsl.append(zs)
|
||||
bname, fname = zsl
|
||||
continue
|
||||
|
||||
# ENOTSUP: zfs on ubuntu 20.04
|
||||
|
|
Loading…
Reference in a new issue