summaryrefslogtreecommitdiff
path: root/exam/management/commands/dump_user_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'exam/management/commands/dump_user_data.py')
-rw-r--r--exam/management/commands/dump_user_data.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/exam/management/commands/dump_user_data.py b/exam/management/commands/dump_user_data.py
index 6e0ca2a..ec016bb 100644
--- a/exam/management/commands/dump_user_data.py
+++ b/exam/management/commands/dump_user_data.py
@@ -1,3 +1,5 @@
+import sys
+
# Django imports.
from django.core.management.base import BaseCommand
from django.template import Template, Context
@@ -81,7 +83,7 @@ def dump_user_data(unames, stdout):
data = get_user_data(user.username)
context = Context({'data': data})
result = data_template.render(context)
- stdout.write(result)
+ stdout.write(result.encode('ascii', 'xmlcharrefreplace'))
class Command(BaseCommand):
args = '<username1> ... <usernamen>'