[Regression] flock - Function not implemented
See original GitHub issueChecklist
- I’m reporting a bug unrelated to a specific site
- I’ve verified that I’m running yt-dlp version 2022.02.04. (update instructions)
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
Description
Commit https://github.com/yt-dlp/yt-dlp/commit/a3125791c7a5cdf2c8c025b99788bf686edd1a8a introduced a regression which leads to the following error while trying to download a file (reverting the commit, fixes the error):
ERROR: unable to open for writing: [Errno 38] Function not implemented Traceback (most recent call last): File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/http.py”, line 265, in download ctx.stream, ctx.tmpfilename = self.sanitize_open( File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/common.py”, line 218, in sanitize_open return sanitize_open(filename, open_mode) File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py”, line 668, in sanitize_open stream = locked_file(filename, open_mode, block=False).open() File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py”, line 2195, in open return self.enter() File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py”, line 2170, in enter _lock_file(self.f, exclusive, self.block) File “/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py”, line 2142, in _lock_file fcntl.flock(f, OSError: [Errno 38] Function not implemented
Verbose log
[debug] Command-line config: ['-v', 'https://www.youtube.com/watch?v=bccSG7rI5F0']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.02.04 [c1653e9ef] (source)
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Git HEAD: a3125791c
[debug] Python version 3.10.2 (CPython 64bit) - Linux-4.14.180-lineageos-g9695abe891c8-aarch64-with-libc
[debug] exe versions: ffmpeg 5.0 (setts), ffprobe 5.0, rtmpdump 2.4
[debug] Optional libraries: sqlite
[debug] Proxy map: {}
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=bccSG7rI5F0
[youtube] bccSG7rI5F0: Downloading webpage
[youtube] bccSG7rI5F0: Downloading android player API JSON
[debug] Loading youtube-nsig.0cd11746 from cache
[debug] [youtube] Decrypted nsig B-TNMNwJ0TMEokdnA => K2hTyrg5-eUUKQ
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] bccSG7rI5F0: Downloading 1 format(s): 303+251
[debug] Invoking downloader on "https://rr2---sn-h0jeenle.googlevideo.com/videoplayback?expire=1644261767&ei=Jx0BYrXCC8Kox_APq5yckAY&ip=62.178.198.204&id=o-AOum5L255zgczDCpdnolNF_e72dfYd3RqjnmD9_Fl9HT&itag=303&source=youtube&requiressl=yes&mh=ck&mm=31%2C26&mn=sn-h0jeenle%2Csn-4g5lznes&ms=au%2Conr&mv=m&mvi=2&pl=18&initcwndbps=1877500&vprv=1&mime=video%2Fwebm&gir=yes&clen=61314981&dur=153.236&lmt=1643957222109845&mt=1644239831&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=5535434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPl-6m45m6jnj7FlcpYeCzj0J7eFx6qdOPfim0HC7tlFAiBz5uvAjvL4P0dLenU4jQRRigioxql4qeJD3dbvqgMbDA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgDm2iAM_E6GxLWz9NOQGIn6F4Fi0pXjUSru7kI_SGjIACICOs4uX_Sk7CbAhbVMstmZ6-fhc274YYRaSLro3GEkm0"
ERROR: unable to open for writing: [Errno 38] Function not implemented
Traceback (most recent call last):
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/http.py", line 265, in download
ctx.stream, ctx.tmpfilename = self.sanitize_open(
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/common.py", line 218, in sanitize_open
return sanitize_open(filename, open_mode)
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 668, in sanitize_open
stream = locked_file(filename, open_mode, block=False).open()
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2195, in open
return self.__enter__()
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2170, in __enter__
_lock_file(self.f, exclusive, self.block)
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2142, in _lock_file
fcntl.flock(f,
OSError: [Errno 38] Function not implemented
[debug] Invoking downloader on "https://rr2---sn-h0jeenle.googlevideo.com/videoplayback?expire=1644261767&ei=Jx0BYrXCC8Kox_APq5yckAY&ip=62.178.198.204&id=o-AOum5L255zgczDCpdnolNF_e72dfYd3RqjnmD9_Fl9HT&itag=251&source=youtube&requiressl=yes&mh=ck&mm=31%2C26&mn=sn-h0jeenle%2Csn-4g5lznes&ms=au%2Conr&mv=m&mvi=2&pl=18&initcwndbps=1877500&vprv=1&mime=audio%2Fwebm&gir=yes&clen=2276567&dur=153.261&lmt=1643949611340832&mt=1644239831&fvip=2&keepalive=yes&fexp=24001373%2C24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIgEUfttxFrtKHzw3Ad63pGGwoJidX2SBjrkFFchbZTJXUCIQCz4InrzcbL0Rj880Ng1KoJiwYloH6iyHpcdwJ6CxkHtA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgDm2iAM_E6GxLWz9NOQGIn6F4Fi0pXjUSru7kI_SGjIACICOs4uX_Sk7CbAhbVMstmZ6-fhc274YYRaSLro3GEkm0"
ERROR: unable to open for writing: [Errno 38] Function not implemented
Traceback (most recent call last):
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/http.py", line 265, in download
ctx.stream, ctx.tmpfilename = self.sanitize_open(
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/downloader/common.py", line 218, in sanitize_open
return sanitize_open(filename, open_mode)
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 668, in sanitize_open
stream = locked_file(filename, open_mode, block=False).open()
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2195, in open
return self.__enter__()
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2170, in __enter__
_lock_file(self.f, exclusive, self.block)
File "/data/data/com.termux/files/home/git/yt-dlp/yt_dlp/utils.py", line 2142, in _lock_file
fcntl.flock(f,
OSError: [Errno 38] Function not implemented
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
I was somewhat concerned about this. But
--download-archive
feature already requires locks as I understand, and there has never been any issue reports about it. So I assumed it is safe. Could you check if download-archive works in your setup? (using release branch). If it does, it is indeed a regression by #1066. If not, the commit just exposed an already existing issue and we need to rethink how to handle this situationEither way, thanks for reporting this before the code went into release
https://github.com/yt-dlp/yt-dlp/pull/2714 fixes the regression