diff --git a/copyparty/__main__.py b/copyparty/__main__.py index c02308bb..625764ca 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -186,7 +186,7 @@ def init_E(E: EnvParams) -> None: with open_binary("copyparty", "z.tar") as tgz: with tarfile.open(fileobj=tgz) as tf: - tf.extractall(tdn) + tf.extractall(tdn) # nosec (archive is safe) return tdn @@ -201,7 +201,7 @@ def init_E(E: EnvParams) -> None: E.mod = _unpack() if sys.platform == "win32": - bdir = os.environ.get("APPDATA") or os.environ.get("TEMP") + bdir = os.environ.get("APPDATA") or os.environ.get("TEMP") or "." E.cfg = os.path.normpath(bdir + "/copyparty") elif sys.platform == "darwin": E.cfg = os.path.expanduser("~/Library/Preferences/copyparty") diff --git a/copyparty/up2k.py b/copyparty/up2k.py index a291c647..604f057f 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -73,8 +73,8 @@ if True: # pylint: disable=using-constant-test if TYPE_CHECKING: from .svchub import SvcHub -zs = "avif,avifs,bmp,gif,heic,heics,heif,heifs,ico,j2p,j2k,jp2,jpeg,jpg,jpx,png,tga,tif,tiff,webp" -CV_EXTS = set(zs.split(",")) +zsg = "avif,avifs,bmp,gif,heic,heics,heif,heifs,ico,j2p,j2k,jp2,jpeg,jpg,jpx,png,tga,tif,tiff,webp" +CV_EXTS = set(zsg.split(",")) class Dbw(object): diff --git a/copyparty/util.py b/copyparty/util.py index aae2a0f6..b6fd6e92 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -296,11 +296,11 @@ REKOBO_LKEY = {k.lower(): v for k, v in REKOBO_KEY.items()} pybin = sys.executable or "" if EXE: pybin = "" - for p in "python3 python".split(): + for zsg in "python3 python".split(): try: - p = shutil.which(p) - if p: - pybin = p + zsg = shutil.which(zsg) + if zsg: + pybin = zsg break except: pass