Merge lp:~jelmer/bzr/prompt-unicode into lp:bzr
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Vincent Ladeuil |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5925 |
Proposed branch: | lp:~jelmer/bzr/prompt-unicode |
Merge into: | lp:bzr |
Diff against target: |
244 lines (+37/-31) 10 files modified
bzrlib/builtins.py (+1/-1) bzrlib/lockdir.py (+1/-1) bzrlib/msgeditor.py (+1/-1) bzrlib/tests/per_uifactory/__init__.py (+2/-3) bzrlib/tests/test_script.py (+1/-1) bzrlib/tests/test_ui.py (+19/-19) bzrlib/transport/ssh.py (+2/-1) bzrlib/ui/__init__.py (+3/-3) bzrlib/ui/text.py (+3/-1) doc/en/release-notes/bzr-2.4.txt (+4/-0) |
To merge this branch: | bzr merge lp:~jelmer/bzr/prompt-unicode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Approve | ||
Review via email: mp+61123@code.launchpad.net |
Commit message
Require prompts to always be unicode.
Description of the change
Require prompts to always be unicode, as they're going to be re-encoded
using the terminal encoding.
This should prevent problems with prompts that happen to contain non-ascii
characters and are being encoded using the terminal encoding.
(e.g. bug 592083)
We already had a test to make sure that UIFactory.prompt() did the right thing in case
it was passed a unicode prompt with non-ascii characters.
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/16/2011 03:57 PM, Jelmer Vernooij wrote: /bugs.launchpad .net/bzr/ +bug/592083 /code.launchpad .net/~jelmer/ bzr/prompt- unicode/ +merge/ 61123
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr/prompt-unicode into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> Bug #592083 in Bazaar: "UnicodeDecodeError in get_password if user name is unicode"
> https:/
>
> For more details, see:
> https:/
>
> Require prompts to always be unicode, as they're going to be re-encoded
> using the terminal encoding.
>
> This should prevent problems with prompts that happen to contain non-ascii
> characters and are being encoded using the terminal encoding.
> (e.g. bug 592083)
>
> We already had a test to make sure that UIFactory.prompt() did the right thing in case
> it was passed a unicode prompt with non-ascii characters.
This doesn't actually fix the bug, it just moves it. So I'm not really
sure what the benefit is. To *get* the error, we are reading an 8-bit
username and leaving it as an 8-bit string, rather than decoding it to
Unicode.
I don't think requiring u"" format strings actually helps. (Maybe it
gets us closer to python3 compatibility?) As we would have still passed
u'Are you %(user)?' % ('\xe5\xb5',)
Which would have still failed with a Unicode error.
So I'm happy to fix the bug, but I don't think requiring Unicode objects
actually helps prevent bugs like this.
John
=:->
review:needsinfo
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org/
RL+IACgkQJdeBCY SNAAPrOQCfdgIdz 3AVVtbXfWMXtcl9 o8BA CAM3JD7OpoNfzBC aK
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk3
gNMAn1qhhCan3T2
=Jqc/
-----END PGP SIGNATURE-----