0
0
Fork 0

[options] Rollback old behavior for configuratio files' encoding

Until agreed with some solution
main
Sergey M․ 2016-07-09 07:12:52 +07:00
parent 1f7258a367
commit 1251565ee0
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,11 @@ def parseOpts(overrideArguments=None):
except IOError: except IOError:
return default # silently skip if file is not present return default # silently skip if file is not present
try: try:
res = compat_shlex_split(optionf.read(), comments=True) # FIXME: https://github.com/rg3/youtube-dl/commit/dfe5fa49aed02cf36ba9f743b11b0903554b5e56
contents = optionf.read()
if sys.version_info < (3,):
contents = contents.decode(preferredencoding())
res = compat_shlex_split(contents, comments=True)
finally: finally:
optionf.close() optionf.close()
return res return res