summaryrefslogtreecommitdiffstats
path: root/module/setup.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-14 14:17:08 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-14 14:17:08 +0100
commitb94182bf303903531944b4bfab744e574be1540c (patch)
tree42574198f7b34668844b1b4d4e8a13727ca3a984 /module/setup.py
parentmore fixes (diff)
downloadpyload-b94182bf303903531944b4bfab744e574be1540c.tar.xz
fix input encoding in setup
Diffstat (limited to 'module/setup.py')
-rw-r--r--module/setup.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/setup.py b/module/setup.py
index abb162e0f..243758ff4 100644
--- a/module/setup.py
+++ b/module/setup.py
@@ -37,6 +37,10 @@ class Setup():
def __init__(self, path, config):
self.path = path
self.config = config
+ self.stdin_encoding = sys.stdin.encoding
+ if self.stdin_encoding == "ascii":
+ self.stdin_encoding = 'utf_8'
+ print "Your terminal encoding was identified as ASCII. Forcing UTF-8."
def start(self):
langs = self.config.getMetaData("general", "language")["type"].split(";")
@@ -481,8 +485,8 @@ class Setup():
if p1 == p2:
return p1
else:
- print _("Passwords did not match.").decode("utf-8")
-
+ print _("Passwords did not match.")
+
while True:
try:
input = raw_input(qst + " %s: " % info)
@@ -490,7 +494,7 @@ class Setup():
print "\nSetup interrupted"
exit()
- input = input.decode(sys.stdin.encoding)
+ input = input.decode(self.stdin_encoding)
if input.strip() == "":
input = default