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)
|
BAD_CFG = "invalid config; {}".format(SEE_LOG)
|
||||||
SBADCFG = " ({})".format(BAD_CFG)
|
SBADCFG = " ({})".format(BAD_CFG)
|
||||||
|
|
||||||
|
|
||||||
class AXS(object):
|
class AXS(object):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -41,8 +41,8 @@ from .util import (
|
||||||
MultipartParser,
|
MultipartParser,
|
||||||
Pebkac,
|
Pebkac,
|
||||||
UnrecvEOF,
|
UnrecvEOF,
|
||||||
alltrace,
|
|
||||||
absreal,
|
absreal,
|
||||||
|
alltrace,
|
||||||
atomic_move,
|
atomic_move,
|
||||||
exclude_dotfiles,
|
exclude_dotfiles,
|
||||||
fsenc,
|
fsenc,
|
||||||
|
|
|
@ -1228,12 +1228,15 @@ def ren_open(
|
||||||
except OSError as ex_:
|
except OSError as ex_:
|
||||||
ex = 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
|
asciified = True
|
||||||
bname, fname = [
|
zsl = []
|
||||||
zs.encode("ascii", "replace").decode("ascii").replace("?", "_")
|
for zs in (bname, fname):
|
||||||
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
|
continue
|
||||||
|
|
||||||
# ENOTSUP: zfs on ubuntu 20.04
|
# ENOTSUP: zfs on ubuntu 20.04
|
||||||
|
|
Loading…
Reference in a new issue