On 05/26/2011 06:43 PM, Martin [gz] wrote:
> Good change. Really bzrlib.errors could do with a uniform idiom for including wrapped errors as a number of exception classes want to do it.
>
> + orig_error = ': %r' % (orig_error,)
>
> This is fine in Python 2.5 and later where the repr generally includes the details you care about, in 2.4 most exceptions just have object.__repr__ which is less useful. The nice thing about %r over %s is it avoids the bug with localised error messages with non-ascii characters.
Ah, but this is landing in bzr-2.4 so we don't care :).
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/26/2011 06:43 PM, Martin [gz] wrote:
> Good change. Really bzrlib.errors could do with a uniform idiom for including wrapped errors as a number of exception classes want to do it.
>
> + orig_error = ': %r' % (orig_error,)
>
> This is fine in Python 2.5 and later where the repr generally includes the details you care about, in 2.4 most exceptions just have object.__repr__ which is less useful. The nice thing about %r over %s is it avoids the bug with localised error messages with non-ascii characters.
Ah, but this is landing in bzr-2.4 so we don't care :).
John
=:->
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org/
erFgACgkQJdeBCY SNAAPbuQCdENg6T +ioPdY4uPO+ Yylw1hqQ fc2p02BW792a0kn 22
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAk3
n0QAn1NhS2ODw5R
=lY4M
-----END PGP SIGNATURE-----