mirror of
https://github.com/django/django.git
synced 2024-12-26 11:06:07 +00:00
[1.7.x] Fixed #22364 -- Sanitized getpass input in changepassword.
Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.
Backport of b5a9166f7e
from master
This commit is contained in:
parent
ddd25b280f
commit
b4681be154
@ -6,6 +6,7 @@ from optparse import make_option
|
|||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
from django.db import DEFAULT_DB_ALIAS
|
from django.db import DEFAULT_DB_ALIAS
|
||||||
|
from django.utils.encoding import force_str
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -18,7 +19,7 @@ class Command(BaseCommand):
|
|||||||
requires_system_checks = False
|
requires_system_checks = False
|
||||||
|
|
||||||
def _get_pass(self, prompt="Password: "):
|
def _get_pass(self, prompt="Password: "):
|
||||||
p = getpass.getpass(prompt=prompt)
|
p = getpass.getpass(prompt=force_str(prompt))
|
||||||
if not p:
|
if not p:
|
||||||
raise CommandError("aborted")
|
raise CommandError("aborted")
|
||||||
return p
|
return p
|
||||||
|
@ -64,5 +64,8 @@ Other bugfixes and changes
|
|||||||
environment variable wasn't set
|
environment variable wasn't set
|
||||||
(`#22256 <http://code.djangoproject.com/ticket/22256>`_).
|
(`#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
|
Additionally, Django's vendored version of six, :mod:`django.utils.six` has been
|
||||||
upgraded to the latest release (1.6.1).
|
upgraded to the latest release (1.6.1).
|
||||||
|
Loading…
Reference in New Issue
Block a user