{{{
C:\project>manage.py changepassword bob
Changing password for user 'bob'
Traceback (most recent call last):
djangorecipe.manage.main('test_project.settings')
File "C:\project\vendor\djangorecipe\src\djangorecipe\manage.py", line
9, in main
management.execute_from_command_line(sys.argv)
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\core\management\__init__.py",
line 399, in execute_from_command_line
utility.execute()
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\core\management\__init__.py",
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\core\management\base.py",
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\core\management\base.py",
line 285, in execute
output = self.handle(*args, **options)
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\contrib\auth\management\commands\changepassword.py",
line 50, in handle
p1 = self._get_pass()
File
"C:\project\eggs\django-1.6.2-py2.7.egg\django\contrib\auth\management\commands\changepassword.py",
line 21, in _get_pass
p = getpass.getpass(prompt=prompt)
File "C:\Python27\lib\getpass.py", line 95, in win_getpass
msvcrt.putch(c)
TypeError: must be char, not unicode
}}}
Related to #19807, which had the same error in createsuperuser on Windows.
I have tested the same solution to force_str and it resolves the issue
(Pull Request is incoming). On other OSes, everything works fine.
This appears to be a regression was introduced in 1.5 and is still present
today. changepassword on Windows worked under 1.4. It definitely seems
relevant to include in the 1.7 release and potentially as a bug fix
release for 1.5 & 1.6. I found no other reports of this error, so there
does not seem to be a large affected population, but would be helpful to
me to have as part of any upcoming 1.6.x bug fix release (I do have a
workaround under 1.6 until then).
--
Ticket URL: <https://code.djangoproject.com/ticket/22364>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Issued [https://github.com/django/django/pull/2503 Pull Request 2503].
Verified fix in application on Windows 7. All tests passing using default
runtests.py.
--
Ticket URL: <https://code.djangoproject.com/ticket/22364#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22364#comment:2>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"b5a9166f7e0e21ae0f2cc8f218b422bc2c116fb0"]:
{{{
#!CommitTicketReference repository=""
revision="b5a9166f7e0e21ae0f2cc8f218b422bc2c116fb0"
Fixed #22364 -- Sanitized getpass input in changepassword.
Python 2 getpass on Windows does not accept unicode, even
when containing on ASCII characters. Related #190807.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22364#comment:3>
Comment (by Tim Graham <timograham@…>):
In [changeset:"b4681be154dd7194041e94f3eb6d7f24217b9a1b"]:
{{{
#!CommitTicketReference repository=""
revision="b4681be154dd7194041e94f3eb6d7f24217b9a1b"
[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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22364#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"129cb7e2228cf076104eb5de69e6063f1bf34dd9"]:
{{{
#!CommitTicketReference repository=""
revision="129cb7e2228cf076104eb5de69e6063f1bf34dd9"
[1.6.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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22364#comment:5>