[tor-commits] [arm/release] fix: Unicode init needs to be before curses
atagar at torproject.org
atagar at torproject.org
Sun Jul 17 06:08:20 UTC 2011
commit d8ebaa88886c0aeb421623416990bd3058b175f9
Author: Damian Johnson <atagar at torproject.org>
Date: Sat May 21 13:36:19 2011 -0700
fix: Unicode init needs to be before curses
The locale needs to be set before initializing curses for unicode characters
to be rendered.
---
src/cli/controller.py | 6 ------
src/starter.py | 7 +++++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/cli/controller.py b/src/cli/controller.py
index 8222da8..d9895e6 100644
--- a/src/cli/controller.py
+++ b/src/cli/controller.py
@@ -4,7 +4,6 @@ user input to the proper panels.
"""
import time
-import locale
import curses
import threading
@@ -460,11 +459,6 @@ def drawTorMonitor(stdscr, startTime):
try: curses.curs_set(0)
except curses.error: pass
- # If using our LANG variable for rendering multi-byte characters lets us
- # get unicode support then then use it.
- if uiTools.isUnicodeAvailable():
- locale.setlocale(locale.LC_ALL, "")
-
# logs the initialization time
msg = "arm started (initialization took %0.3f seconds)" % (time.time() - startTime)
log.log(CONFIG["log.startTime"], msg)
diff --git a/src/starter.py b/src/starter.py
index 84abbca..9268351 100644
--- a/src/starter.py
+++ b/src/starter.py
@@ -10,6 +10,7 @@ import os
import sys
import time
import getopt
+import locale
import socket
import platform
@@ -397,5 +398,11 @@ if __name__ == '__main__':
procName.renameProcess("arm\0%s" % "\0".join(sys.argv[1:]))
except: pass
+ # If using our LANG variable for rendering multi-byte characters lets us
+ # get unicode support then then use it. This needs to be done before
+ # initializing curses.
+ if util.uiTools.isUnicodeAvailable():
+ locale.setlocale(locale.LC_ALL, "")
+
cli.controller.startTorMonitor(time.time() - initTime)
More information about the tor-commits
mailing list