Skip to content

Python 2.7.3? Try copyparty 1.8.7 #300

@webpro

Description

@webpro

Just in case this might help someone else: if Python 2.7.3 is available (have this on my old Netgear NAS), then copyparty 1.8.7 might work (it does for me):

❯ python copyparty-sfx-1.8.7.py                 

[SFX]    this is: copyparty 1.8.7
[SFX]  packed at: 2023-07-23, 15:57:36 UTC, 1690127856
[SFX] archive is: /root/copyparty-sfx-1.8.7.py
[SFX] python bin: /usr/bin/python
[SFX] python ver: CPython 2.7.3 (default, Jul  4 2012, 17:31:14) 
                  [GCC 4.3.2]

[SFX] found early
[SFX] jinja2: bundled
[SFX] pyftpd: bundled
[SFX] sfxdir: /tmp/pe-copyparty.0.19380.0

# checking ffmpeg
# checking ffprobe
copyparty v1.8.7 "argon" (2023-07-23)
  CPython v2.7.3 on Linux32  [GCC 4.3.2]
   sqlite v3.7.5*1 | jinja2 v2.11.3 | pyftpd v1.5.7

warning: setlocale en_US.UTF-8 failed,
  sorting and dates might get funky

The output/error I got with latest copyparty 1.18.6:

❯ python copyparty-sfx.py 

[SFX]    this is: copyparty 1.18.6
[SFX]  packed at: 2025-07-28, 23:29:12 UTC, 1753745352
[SFX] archive is: /root/copyparty-sfx.py
[SFX] python bin: /usr/bin/python
[SFX] python ver: CPython 2.7.3 (default, Jul  4 2012, 17:31:14) 
                  [GCC 4.3.2]

[SFX] jinja2: bundled
[SFX] pyftpd: bundled
[SFX] sfxdir: /tmp/pe-copyparty.0.19774.0

using fallback base64 codec due to AttributeError("type object 'str' has no attribute 'maketrans'",)
# checking ffmpeg
# checking ffprobe
copyparty v1.18.6 "logtail" (2025-07-28)
  CPython v2.7.3 on Linux32  [GCC 4.3.2]
   sqlite 3.7.5*1 | jinja 2.11.3 | pyftpd 1.5.10 | tftp 0.4.0

warning: setlocale en_US.UTF-8 failed,
  sorting and dates might get funky


no arguments provided; will use --qr -p80,443,3923 --ign-ebind

2025-07-29
23:05:43.236 root                  opening sessions-db /root/.config/copyparty/sessions.db
23:05:43.330 auth                  volumes and permissions:

"/"  /root
|    read:  everybody
|   write:  everybody
|    move:  --none--
|  delete:  --none--
|    dots:  --none--
|     get:  --none--
|   upGet:  --none--
|    html:  --none--
|  uadmin:  --none--

23:05:43.330 auth                  hint: enable searching and upload-undo with argument -e2dsa
23:05:43.330 auth                  hint: enable upload deduplication with --dedup (but see readme for consequences)
23:05:43.331 auth                  anyone can write to the current directory: /root

23:05:43.332 root                  max clients: 256
23:05:43.365 tcpsrv                listen on IPv6 [::] failed; trying IPv4 0.0.0.0...
tcpsrv.py:80 <__init__>: self._listen(ipa, port)
tcpsrv.py:325 <_listen>: raise Exception(e)
[Exception] port 80 is busy on interface ::
23:05:43.365 tcpsrv                could not listen on :::80: port 80 is busy on interface 0.0.0.0
23:05:43.366 tcpsrv                listen on IPv6 [::] failed; trying IPv4 0.0.0.0...
tcpsrv.py:80 <__init__>: self._listen(ipa, port)
tcpsrv.py:325 <_listen>: raise Exception(e)
[Exception] port 443 is busy on interface ::
23:05:43.367 tcpsrv                could not listen on :::443: port 443 is busy on interface 0.0.0.0
23:05:43.368 tcpsrv                
23:05:43.396 tcpsrv                available @  http://192.168.2.12:3923/  (0-eth0, external)
23:05:43.396 tcpsrv                available @  http://[::1]:3923/  (0-lo)
23:05:43.396 tcpsrv                available @  http://127.0.0.1:3923/  (0-lo)

23:05:43.519 optional-dependencies OK: sqlite, NG: pillow, vips, pillow-webp, ffmpeg, ffprobe, mutagen, argon2, pyzmq, pillow-heif, pillow-avif, see --deps (this is fine btw)
23:05:43.519 thumb                 decoder preference: (None available)
23:05:43.519 thumb                 need either Pillow, pyvips, or FFmpeg to create thumbnails; for example:
                                     python -m pip install --user Pillow
                                     python -m pip install --user pyvips
                                     apt install ffmpeg
23:05:43.519 thumb                 setting --no-acode because either FFmpeg or FFprobe is not available

[SFX] retcode Traceback (most recent call last):
  File "copyparty-sfx.py", line 277, in main
    run(tmp, j2, ftp)
  File "copyparty-sfx.py", line 217, in run
    run_i(ld)
  File "copyparty-sfx.py", line 229, in run_i
    p()
  File "/tmp/pe-copyparty.0.19774.0/copyparty/__main__.py", line 1882, in main
    SvcHub(al, dal, argv, "".join(printed)).run()
  File "/tmp/pe-copyparty.0.19774.0/copyparty/svchub.py", line 401, in __init__
    self.broker = Broker(self)
  File "/tmp/pe-copyparty.0.19774.0/copyparty/broker_thr.py", line 30, in __init__
    self.httpsrv = HttpSrv(self, None)
  File "/tmp/pe-copyparty.0.19774.0/copyparty/httpsrv.py", line 180, in __init__
    self.j2 = {x: env.get_template(x + ".html") for x in jn}
  File "/tmp/pe-copyparty.0.19774.0/copyparty/httpsrv.py", line 180, in <dictcomp>
    self.j2 = {x: env.get_template(x + ".html") for x in jn}
  File "/tmp/pe-copyparty.0.19774.0/j2/jinja2/environment.py", line 475, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/tmp/pe-copyparty.0.19774.0/j2/jinja2/environment.py", line 463, in _load_template
    template = self.loader.load(self, name, globals)
  File "/tmp/pe-copyparty.0.19774.0/j2/jinja2/loaders.py", line 58, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/tmp/pe-copyparty.0.19774.0/j2/jinja2/loaders.py", line 139, in get_source
    rv = self.load_func(template)
  File "/tmp/pe-copyparty.0.19774.0/copyparty/httpsrv.py", line 166, in <lambda>
    env.loader = jinja2.FunctionLoader(lambda f: load_jinja2_resource(self.E, f))
  File "/tmp/pe-copyparty.0.19774.0/copyparty/httpsrv.py", line 96, in load_jinja2_resource
    with load_resource(E, "web/" + name, "r") as f:
  File "/tmp/pe-copyparty.0.19774.0/copyparty/util.py", line 3992, in load_resource
    return open(os.path.join(E.mod, name), mode, encoding=enc)
TypeError: 'encoding' is an invalid keyword argument for this function

Didn't try other versions.

Maybe it'd be worth documenting compat issues a bit more. And/or maybe there's a cut-off version such as "copyparty requires sfx which is available in python x.x and later" (disclaimer: not into python myself).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions