mirror of
https://github.com/beetbox/beets.git
synced 2025-12-11 02:53:58 +01:00
fix: use a _in_encoding(): instead _out_encoding():
This commit is contained in:
parent
172498fd33
commit
f18fe05e15
1 changed files with 10 additions and 1 deletions
|
|
@ -71,6 +71,15 @@ class UserError(Exception):
|
|||
|
||||
|
||||
# Encoding utilities.
|
||||
def _in_encoding():
|
||||
"""Get the encoding to use for *inputting* strings to the console.
|
||||
"""
|
||||
try:
|
||||
return sys.stdin.encoding or 'utf-8'
|
||||
except LookupError:
|
||||
# TODO: create user config
|
||||
return 'utf-8'
|
||||
|
||||
|
||||
def _out_encoding():
|
||||
"""Get the encoding to use for *outputting* strings to the console.
|
||||
|
|
@ -193,7 +202,7 @@ def input_(prompt=None):
|
|||
except EOFError:
|
||||
raise UserError(u'stdin stream ended while input required')
|
||||
|
||||
return resp.decode(_out_encoding(), 'ignore')
|
||||
return resp.decode(_in_encoding(), 'ignore')
|
||||
|
||||
|
||||
def input_options(options, require=False, prompt=None, fallback_prompt=None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue