[MERGE] UTF-8 encoding in binary diffs
Martin Pool
mbp at sourcefrog.net
Fri Jul 13 01:55:26 BST 2007
On 7/13/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> I'm fairly confident that Python is just going through
> 'sys.getfilesystemencoding()', so we can just grab that, and try a few
> path.encode(fs_enc). Note we should actually use osutils._fs_enc (only in a
> saner manner than accessing a private var), since it handles when sys.get...()
> returns None.
I think you're right.
> I have mixed feelings overall, though.
>
> I like having more unicode testing. And changing most tests to use Unicode
> names does stress more code overall.
>
> I'm not sure how it falls into "each test should test 1 and only 1 thing, so
> that failures are clear."
Here's what I propose:
1- We add a method or feature which says "this test requires a unicode
filesystem", skips otherwise, and call that from Johno's test, so we
can merge this fix.
2- We add another method which says "give me some suggested file
names", and then call that rather than just using arbitrary names in
tests that aren't testing any specific name-related behavior. This
might need some way for the caller to specify the kind of directory
structure they want... We can use that in new tests or update
existing ones to make use of it. That can by default just return
ascii names, and then we can add maybe a test option to see if
anything breaks when they change to unicode.
--
Martin
More information about the bazaar
mailing list