Skip to content
Browse files

Fixed #21784: Correctly decode stdin input for migration defaults

  • Loading branch information...
1 parent 2a31d00 commit 7535e9f4a4f5317a0073a8fde0eacf17ce31bac0 @andrewgodwin andrewgodwin committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/migrations/
2 django/db/migrations/
@@ -97,7 +97,7 @@ def ask_not_null_addition(self, field_name, model_name):
print("Please enter the default value now, as valid Python")
print("The datetime module is available, so you can do e.g.")
while True:
- code = input(">>> ")
+ code = input(">>> ").decode(sys.stdin.encoding)
if not code:
print("Please enter some code, or 'exit' (with no quotes) to exit.")
elif code == "exit":

0 comments on commit 7535e9f

Please sign in to comment.
Something went wrong with that request. Please try again.