[merge][#135241] better handling of internal errors in blackbox tests
bialix at ukr.net
Tue Sep 25 22:06:56 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Martin Pool пишет:
> This changes the way that TestCase.run_bzr handles internal errors.
> This highlights some unresolved problems in handling of unicode data.
> At commands can choose for their output to be sent in either strict,
> exact, or replace mode. exact mode means they always emit byte
> strings (like bzr cat) and this is not a problem. replace means that
> unrepresentable characters are replaced, and that's also fine. But if
> a strict-mode command needs to write data that won't fit in the user's
> encoding, it fails with a traceback. test_non_ascii contains many
> examples of these at present, and people hit them in practice from
> time to time. Needless to say we don't really want people getting
> Maybe it needs to be done case by case. Here are some options:
> * have no 'strict' command output: every command either emits bytes,
> or tolerates having unrepresentable characters replaced -- but maybe
> this is just pushing the problem down to the command? This may have
> the problem that the user will get a screenful of questionmarks, which
> is not much better than getting a traceback.
> * treat unicodeerror as a user error, and give a short and cleaner
> message, maybe showing the locale -- but the user is still blocked
> from whatever operation they were trying to do.
> * assume that people commonly have an ascii locale when they can
> actually tolerate utf-8, and go ahead and send that when we're not
> willing to do replacement?
I'd prefer to use variant 2: short and cleaner message for unicode errors.
(And may be long and complicated explanation somewhere is user doc. ;-)
But, please don't emit utf-8 stream on undefined encoding (ascii?) terminal.
It's not much better than "get a screenful of questionmarks".
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar