Merge lp:~ryorke/bzr/140563-optparse-barfs-on-unicode into lp:bzr
Status: | Merged |
---|---|
Approved by: | Martin Packman |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5529 |
Proposed branch: | lp:~ryorke/bzr/140563-optparse-barfs-on-unicode |
Merge into: | lp:bzr |
Diff against target: |
52 lines (+20/-1) 3 files modified
bzrlib/commands.py (+7/-1) bzrlib/tests/blackbox/test_exceptions.py (+11/-0) doc/en/release-notes/bzr-2.3.txt (+2/-0) |
To merge this branch: | bzr merge lp:~ryorke/bzr/140563-optparse-barfs-on-unicode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Approve | ||
Review via email: mp+39222@code.launchpad.net |
Commit message
Trap UnicodeError from optparse parsing.
Description of the change
This change is for bug 140563.
optparse can't handle non-ASCII option names. This commit doesn't try to fix
that, but, as suggested in the bug discussion, reports an error that might
give the user a better idea of what the problem is.
A test has been added to blackbox.
right place, though running this test with different encodings doesn't really
make sense.
There's a patch that puportedly fixes optparse; see
http://
I don't know how Python development works, but I can't imagine it'll be
backported to older versions (<2.7), so we may be stuck with this for a while.
Nitpick, I'd like a comment by that try/except explaining the optparse problem we're working around and linking the upstream bug.
I get different behaviour on windows. Rather than throwing, it mangles the bytes. This breaks your test, and then the whole run as the fix for bug 633216 hasn't landed.
Suggests you could perhaps give optparse bytes on the nix path, then decode what you get back instead?