[MERGE][#139318] bzr send @ win32: ensure that command line to invoking Thunderbird is 8-bit string, not unicode (because subprocess does not understand non-ascii unicode)

Aaron Bentley aaron at aaronbentley.com
Tue Feb 26 13:50:13 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> This patch fixes problem with UnicodeEncodeError and subprocess module @
> win32.

According to my tests, both the encoded and unicode forms are allowed on
Linux.  So we can encode on all platforms, which should give your change
better test coverage.

Also, please include a test case.

bb:resubmit

> Actually I need this fix only for Thunderbird, default MapiClient is not
> affected
> by unicode bug. So if someone think that subject.encode(user_encdoing,
> 'replace')
> should be only in Thunderbird class, I'll move it there.

Actually, it looks like we need to encode all arguments that may be
provided, so I think the right place would be in
ExternalMailClient._compose, doing

cmdline = [a.encode(user_encoding, 'replace') for a in cmdline]

If you do it there, it's pretty hard to test, so I wouldn't require it.

Aaron


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHxBkV0F+nu1YWqI0RAvurAJsGCUrpY7AKpr10n+bG7s9UVsRvUACaAtpu
znkn/7WPdRqkp9IudcjsdvA=
=31hM
-----END PGP SIGNATURE-----



More information about the bazaar mailing list