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

Local cookie file erased after ENOSPC error #30082

Open
3 tasks
cmcginty opened this issue Oct 11, 2021 · 1 comment
Open
3 tasks

Local cookie file erased after ENOSPC error #30082

cmcginty opened this issue Oct 11, 2021 · 1 comment

Comments

@cmcginty
Copy link

Checklist

  • I'm reporting a broken site support issue
  • [ x] I've verified that I'm running youtube-dl version 2021.06.06
  • 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
  • [ x] I've searched the bugtracker for similar bug reports including closed ones
  • [ x] I've read bugs section in FAQ

Verbose log

Traceback (most recent call last): File "/usr/local/bin/yt-dlp", line 33, in
sys.exit(load_entry_point('yt-dlp==2021.10.10', 'console_scripts', 'yt-dlp')())
File "/usr/local/Cellar/yt-dlp/2021.10.10/libexec/lib/python3.10/site-packages/yt_dlp/init.py", line 779, in main
_real_main(argv)
File "/usr/local/Cellar/yt-dlp/2021.10.10/libexec/lib/python3.10/site-packages/yt_dlp/init.py", line 740, in _real_main
with YoutubeDL(ydl_opts) as ydl:
File "/usr/local/Cellar/yt-dlp/2021.10.10/libexec/lib/python3.10/site-packages/yt_dlp/Yo
utubeDL.py", line 782, in exit
self.cookiejar.save(ignore_discard=True, ignore_expires=True)
File "/usr/local/Cellar/yt-dlp/2021.10.10/libexec/lib/python3.10/site-packages/yt_dlp/ut
ils.py", line 2889, in save
with io.open(filename, 'w', encoding='utf-8') as f:
OSError: [Errno 28] No space left on device

Description

Run program using cookie file option. After disk space error exception, cookie file is erased.

@dirkf
Copy link
Contributor

dirkf commented Oct 11, 2021

Although you are reporting this issue with yt-dlp in the wrong tracker, the same heinous bug is present in yt-dl at l.2775 of the current utils.py.

Plainly running the command with more available space is one solution, but it would certainly be more polite to retain the supplied cookie file and not erase it each time it's opened.

As the log shows, the cookie file is opened with mode w which truncates the file; the update mode r+ could help but the code then has to seek to the start of the file and truncate it before closing.

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

Successfully merging a pull request may close this issue.

2 participants