mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 08:35:32 +00:00
[cleanup] Fix misc bugs (#8968)
Closes #8816 Authored by: bashonly, seproDev, pukkandan, Grub4k
This commit is contained in:
@ -1424,7 +1424,8 @@ def write_string(s, out=None, encoding=None):
|
||||
s = re.sub(r'([\r\n]+)', r' \1', s)
|
||||
|
||||
enc, buffer = None, out
|
||||
if 'b' in getattr(out, 'mode', ''):
|
||||
# `mode` might be `None` (Ref: https://github.com/yt-dlp/yt-dlp/issues/8816)
|
||||
if 'b' in (getattr(out, 'mode', None) or ''):
|
||||
enc = encoding or preferredencoding()
|
||||
elif hasattr(out, 'buffer'):
|
||||
buffer = out.buffer
|
||||
|
Reference in New Issue
Block a user