diff options
-rw-r--r-- | askbot/management/__init__.py | 2 | ||||
-rw-r--r-- | askbot/management/commands/dump_forum.py | 2 | ||||
-rw-r--r-- | askbot/management/commands/merge_users.py | 4 | ||||
-rw-r--r-- | askbot/startup_procedures.py | 11 |
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() |