Skip to content

Commit

Permalink
Fixed #22364 -- Sanitized getpass input in changepassword.
Browse files Browse the repository at this point in the history
Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.
  • Loading branch information
johnpaulett authored and timgraham committed Apr 10, 2014
1 parent ea5a984 commit b5a9166
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/contrib/auth/management/commands/changepassword.py
Expand Up @@ -6,6 +6,7 @@
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.utils.encoding import force_str


class Command(BaseCommand):
Expand All @@ -18,7 +19,7 @@ class Command(BaseCommand):
requires_system_checks = False

def _get_pass(self, prompt="Password: "):
p = getpass.getpass(prompt=prompt)
p = getpass.getpass(prompt=force_str(prompt))
if not p:
raise CommandError("aborted")
return p
Expand Down
3 changes: 3 additions & 0 deletions docs/releases/1.6.3.txt
Expand Up @@ -64,5 +64,8 @@ Other bugfixes and changes
environment variable wasn't set
(`#22256 <http://code.djangoproject.com/ticket/22256>`_).

* Fixed :djadmin:`changepassword` on Windows
(`#22364 <https://code.djangoproject.com/ticket/22364>`_).

Additionally, Django's vendored version of six, :mod:`django.utils.six` has been
upgraded to the latest release (1.6.1).

0 comments on commit b5a9166

Please sign in to comment.