[patch] encodings again
John A Meinel
john at arbash-meinel.com
Mon Dec 26 22:11:15 GMT 2005
Alexander Belchenko wrote:
> John A Meinel пишет:
>> Do you have a branch where you make these changes, or do you just
>> prefer to post them as patches?
>
> I prefer to submit patches because I have the problems to publish my
> bzr.dev branches due to big size of repository.
>
>> Anyway, have you looked into writing tests, or making the changes that
>> Robert suggested? I might take some time to look into this.
>
> I try to write some tests but face up with problem in test subsytem
> itself. I attach new test for log command (place them into
> bzrlib/tests/blackbox/). But this test fails because of problems in
> .run_bzr_captured() method. Problem with non-ascii letters and mutter.
>
> Here traceback:
>
> Traceback (most recent call last):
> File "D:\user\python\bzr\bzr.dev\bzrlib\tests\blackbox\test_log.py",
> line 55, in test_stdout_encoding
> stdout, stderr = self.run_bzr_captured(["--no-plugins", "log"])
> File "D:\user\python\bzr\bzr.dev\bzrlib\tests\__init__.py", line 411,
> in run_bzr_captured
> self.log('output:\n%s', out)
> File "D:\user\python\bzr\bzr.dev\bzrlib\tests\__init__.py", line 359,
> in log
> mutter(*args)
> File "D:\user\python\bzr\bzr.dev\bzrlib\trace.py", line 97, in mutter
> _trace_file.write(out)
> File "C:\Python24\lib\codecs.py", line 178, in write
> data, consumed = self.encode(object, self.errors)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position
> 181: ordinal not in range(128)
>
>
> It seems that mutter should never fail as you write in your "Encodings
> woes" mail lately.
>
> Any hints?
>
> Alexander
The problem is that run_bzr expects the arguments to be encoded, but
before it gets there, TestCase calls mutter(), which expects arguments
to *not* be encoded.
That is what started that thread. I can think of a few fixes. I'm mostly
offline for the next week (right now I'm sitting in a hotel parking lot,
sneaking internet access because the coffee house is closed for Christmas).
Anyway, if I get some time, I'll probably clean up some of the encoding
issues. So we'll have a run_bzr which doesn't try to decode its arguments.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051226/5b150fed/attachment.pgp
More information about the bazaar
mailing list