Fixed #21784: Correctly decode stdin input for migration defaults

This commit is contained in:
Andrew Godwin 2014-01-16 19:03:39 +00:00 committed by Anssi Kääriäinen
parent 78c8f84dd8
commit 625c8d2461
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ class InteractiveMigrationQuestioner(MigrationQuestioner):
print("Please enter the default value now, as valid Python") print("Please enter the default value now, as valid Python")
print("The datetime module is available, so you can do e.g. datetime.date.today()") print("The datetime module is available, so you can do e.g. datetime.date.today()")
while True: while True:
code = input(">>> ") code = input(">>> ").decode(sys.stdin.encoding)
if not code: if not code:
print("Please enter some code, or 'exit' (with no quotes) to exit.") print("Please enter some code, or 'exit' (with no quotes) to exit.")
elif code == "exit": elif code == "exit":