Changes to convert to unicode at the borders

The module docs and vault changes solve issues where tracebacks can
happen.  The galaxy changes are mostly refactoring to be more pythonic
with a small chance that a unicode traceback could have occurred there
without the changes.  The change in __init__.py when we actually call
the pager makes things more robust but could hide places where we had
bytes coming in already so I didn't want to change that without auditing
where the text was coming from.

Fixes #14178
This commit is contained in:
Toshio Kuratomi
2016-01-28 10:50:20 -08:00
parent e7a9031d61
commit fa9822df0f
4 changed files with 31 additions and 20 deletions

View File

@@ -459,7 +459,7 @@ class CLI(object):
os.environ['LESS'] = CLI.LESS_OPTS
try:
cmd = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=sys.stdout)
cmd.communicate(input=text.encode(sys.stdout.encoding))
cmd.communicate(input=to_bytes(text))
except IOError:
pass
except KeyboardInterrupt: