munkiimport: When encoding text to be printed, use UTF-8 explictly instead of the current stdout encoding, which could be ASCII. Matches earlier munkiimport behavior.

This commit is contained in:
Greg Neagle
2016-06-02 13:55:57 -07:00
parent 75e0722e8f
commit ed70d8b816
+4 -4
View File
@@ -108,7 +108,7 @@ def make_dmg(pkgpath):
output = proc.stdout.readline()
if not output and (proc.poll() != None):
break
print output.rstrip('\n').encode(sys.stdout.encoding)
print output.rstrip('\n').encode('UTF-8')
sys.stdout.flush()
retcode = proc.poll()
if retcode:
@@ -676,7 +676,7 @@ def make_catalogs():
if not output and (proc.poll() != None):
break
if VERBOSE:
print output.rstrip('\n').encode(sys.stdout.encoding)
print output.rstrip('\n').encode('UTF-8')
errors = proc.stderr.read()
if errors:
@@ -957,7 +957,7 @@ def main():
for (name, key) in fields:
print '%21s: %s' % (
name, matchingpkginfo.get(key, '').encode(
sys.stdout.encoding))
'UTF-8'))
print
if exactmatch:
answer = raw_input('Import this item anyway? [y/n] ')
@@ -1005,7 +1005,7 @@ def main():
if kind == 'bool':
default = str(pkginfo.get(key, False))
else:
default = pkginfo.get(key, '').encode(sys.stdout.encoding)
default = pkginfo.get(key, '').encode('UTF-8')
pkginfo[key] = raw_input_with_default(prompt, default)
if kind == 'bool':
value = pkginfo[key].lower().strip()