summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-21 19:43:09 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-21 19:43:09 -0400
commit2b3d3d91e30715b44db2220216c8ee4f6a3ab6d6 (patch)
tree8c59e8568c20a1a40cc0e3ba198e1c8fe124ad0a
parent08a4b7328036c0d27c03418c9933e89465c7dec3 (diff)
downloadaskbot-2b3d3d91e30715b44db2220216c8ee4f6a3ab6d6.tar.gz
askbot-2b3d3d91e30715b44db2220216c8ee4f6a3ab6d6.tar.bz2
askbot-2b3d3d91e30715b44db2220216c8ee4f6a3ab6d6.zip
added utf8 encoding to stdout writes
-rw-r--r--askbot/management/__init__.py2
-rw-r--r--askbot/management/commands/dump_forum.py2
-rw-r--r--askbot/management/commands/merge_users.py4
-rw-r--r--askbot/startup_procedures.py11
4 files changed, 4 insertions, 15 deletions
diff --git a/askbot/management/__init__.py b/askbot/management/__init__.py
index 6dc50083..8decc48a 100644
--- a/askbot/management/__init__.py
+++ b/askbot/management/__init__.py
@@ -55,7 +55,7 @@ class NoArgsJob(NoArgsCommand):
afterwards there will be a short summary
"""
- sys.stdout.write(batch['title'])
+ sys.stdout.write(batch['title'].encode('utf-8'))
changed_count = 0
checked_count = 0
total_count = batch['query_set'].count()
diff --git a/askbot/management/commands/dump_forum.py b/askbot/management/commands/dump_forum.py
index cabc8ae8..0bead908 100644
--- a/askbot/management/commands/dump_forum.py
+++ b/askbot/management/commands/dump_forum.py
@@ -20,7 +20,7 @@ The extension ".json" will be added automatically."""
hint = options.get('dump_file', None),
extension = '.json'
)
- print "Saving file %s ..." % dump_file.name
+ print ("Saving file %s ..." % dump_file.name).encode('utf-8')
stdout_orig = sys.stdout
try:
sys.stdout = dump_file
diff --git a/askbot/management/commands/merge_users.py b/askbot/management/commands/merge_users.py
index 9eb76756..189b74bb 100644
--- a/askbot/management/commands/merge_users.py
+++ b/askbot/management/commands/merge_users.py
@@ -21,13 +21,13 @@ class MergeUsersBaseCommand(BaseCommand):
try:
self.process_field(rel.model, rel.field.name)
except Exception, error:
- self.stdout.write(u'Warning: %s\n' % error)
+ self.stdout.write((u'Warning: %s\n' % error).encode('utf-8'))
for rel in User._meta.get_all_related_many_to_many_objects():
try:
self.process_m2m_field(rel.model, rel.field.name)
except Exception, error:
- self.stdout.write(u'Warning: %s\n' % error)
+ self.stdout.write((u'Warning: %s\n' % error).encode('utf-8'))
self.process_custom_user_fields()
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index d91464f4..2c8b1eb4 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -218,16 +218,6 @@ def test_postgres():
else:
pass #everythin is ok
-def test_encoding():
- """prints warning if encoding error is not UTF-8"""
- if hasattr(sys.stdout, 'encoding'):
- if sys.stdout.encoding != 'UTF-8':
- askbot_warning(
- 'Your output encoding is not UTF-8, there may be '
- 'issues with the software when anything is printed '
- 'to the terminal or log files'
- )
-
def test_template_loader():
"""Sends a warning if you have an old style template
loader that used to send a warning"""
@@ -919,7 +909,6 @@ def run_startup_tests():
test_celery()
test_compressor()
test_custom_user_profile_tab()
- test_encoding()
test_group_messaging()
test_haystack()
test_jinja2()