Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android/Termux doesn't have flock, use lockf, SoftFileLock, or no lock? #349

Open
Leif-W opened this issue Jul 5, 2024 · 1 comment
Open

Comments

@Leif-W
Copy link

Leif-W commented Jul 5, 2024

Similar issue as listed on yt-dlp.

Android/Termux doesn't have flock.
Fallback to lockf or SoftFileLock?
Possibly fallback to no lock?

scdl shown in example uses filelock as a dependency, yt-dlp rolls their own.

filelock's _unix.py incorrectly assumes all Unices have flock, or that Android === Unix.

Note: command line for example only

scdl -l https://soundcloud.com/user/track
Soundcloud Downloader
Found a track
Downloading track
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/filelock/_unix.py", line 46, in _acquire
    fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
OSError: [Errno 38] Function not implemented

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/scdl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/scdl/scdl.py", line 304, in main
    download_url(client, **python_args)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/scdl/scdl.py", line 409, in download_url
    download_track(client, item, **kwargs)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/scdl/scdl.py", line 887, in download_track
    with lock:
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/filelock/_api.py", line 376, in __enter__
    self.acquire()
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/filelock/_api.py", line 332, in acquire
    self._acquire()
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/filelock/_unix.py", line 51, in _acquire
    raise NotImplementedError(msg) from exception
NotImplementedError: FileSystem does not appear to support flock; use SoftFileLock instead
@DJStompZone
Copy link

This error is driving me nuts

"Use softfilelock instead"
Ok yes but HOW??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants