builtins: self.outf.write vs trace.note

Gordon Tyler gordon at doxxx.net
Fri Nov 13 23:33:47 GMT 2009


I've pushed the remaining changes up to lp:~doxxx/bzr/output-cleanup 
(https://code.edge.launchpad.net/~doxxx/bzr/output-cleanup). I've fixed 
all the tests that were broken by my changes except one which I can't 
figure out:

test_non_ascii is failing in test_mkdir with a very odd error message 
from the Python logging module.

10.680  run bzr: ['mkdir', u'r\xe4ksm\xf6rg\xe5s2']
10.680  bzr arguments: ['mkdir', u'r\xe4ksm\xf6rg\xe5s2']
10.681  encoding stdout as sys.stdout encoding 'ascii'
10.686  opening working tree 
'C:/users/owner/appdata/local/temp/testbzr-hfk35k.tmp/onAscii.test_mkdir(iso_8859_1)/work'
     INFO  added rA☼ksmA¶rgA¥s2
10.698  errors:
'Traceback (most recent call last):\n  File 
"C:\\Python26\\lib\\logging\\__init__.py", line 791, in emit\n 
stream.write(fs % msg.encode("UTF-8"))\nUnicodeDecodeError: \'ascii\' 
codec can\'t decode byte 0xc3 in position 7: ordinal not in range(128)\n'

In other words, the invoked bzr command is failing with a 
UnicodeDecodeError like so:

Traceback (most recent call last):
   File "C:\\Python26\\lib\\logging\\__init__.py", line 791, in emit
     stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: \'ascii\' codec can\'t decode byte 0xc3 in position 
7: ordinal not in range(128)

Any ideas?

Thanks,
Gordon




More information about the bazaar mailing list