mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
[common] catch UnicodeEncodeError and instruct users to change the locale
This commit is contained in:
parent
6590bb33cd
commit
225f18d347
@ -1183,6 +1183,14 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
|||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
log.e('[error] oops, the current environment does not seem to support Unicode.')
|
||||||
|
log.e('please set it to a UTF-8-aware locale first,')
|
||||||
|
log.e('so as to save the video (with some Unicode characters) correctly.')
|
||||||
|
log.e('you can do it like this:')
|
||||||
|
log.e(' (Windows) % chcp 65001 ')
|
||||||
|
log.e(' (Linux) $ LC_CTYPE=en_US.UTF-8')
|
||||||
|
sys.exit(1)
|
||||||
except Exception:
|
except Exception:
|
||||||
if not traceback:
|
if not traceback:
|
||||||
log.e('[error] oops, something went wrong.')
|
log.e('[error] oops, something went wrong.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user