diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2011-12-14 14:17:08 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2011-12-14 14:17:08 +0100 |
commit | b94182bf303903531944b4bfab744e574be1540c (patch) | |
tree | 42574198f7b34668844b1b4d4e8a13727ca3a984 | |
parent | more fixes (diff) | |
download | pyload-b94182bf303903531944b4bfab744e574be1540c.tar.xz |
fix input encoding in setup
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 3 | ||||
-rw-r--r-- | module/setup.py | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 14cb8a15e..11866bb16 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -111,7 +111,8 @@ class SimpleHoster(Hoster): def getFileInfo(self): self.logDebug("URL: %s" % self.pyfile.url) if hasattr(self, "TEMP_OFFLINE_PATTERN") and search(self.TEMP_OFFLINE_PATTERN, self.html): - self.tempOffline() + self.logInfo("Link %s is temporarily offline" % self.pyfile.url) + self.retry(5, 3600, "Temporarily offline") file_info = parseFileInfo(self, infomode = True) if file_info['status'] == 1: 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 |