Created attachment 766556 [details] results from 'bzr version >try.log 2>&1' Description of problem: On entering the command "bzr version", the command fails with a traceback message. My LANG setting is: en_US.UTF-8 Version-Release number of selected component (if applicable): bzr-2.5.1-12.fc19.x86_64 How reproducible: Always. Steps to Reproduce: 1. enter the command "bzr version" Actual results: See attachement Expected results: Version information is listed, with no errors Additional info:
Filed upstream. https://bugs.launchpad.net/bzr/+bug/1195783 I'll see if the change I mentioned in that bug will work and pass the test suite.
Ugh. The workaround makes a ton more selftests fail. I think it may be because of the way the selftests are setup (they're using a StringIO rather than a StreamWriter) but I'm not certain. This may take a while to fix.
Here's a hack we could try: try: self.wrapped_stream.write(to_write) except UnicodeError: to_write = unicode(to_write, encoding=self.encoding or 'ascii', errors='replace') self.wrapped_stream.write(to_write) This first tries the current method of simply passing the string to wrapped_stream.write() [which seems like it is wrong] and if that raises an exception then trying my code instead. If this makes the selftests pass, I'd be willing to apply this to our package. It's definitely a hack, though, as it's just papering over a broken unicode model somewhere between upstream's code and upstream's test cases.
This didn't work. I think that sometimes the following is happening: * locale is C (therefore only ascii can be printed to the terminal). * The text/ui.py function gets a unicode string with non-ascii characters * This gets passed to self.wrapped_stream.write which fails to write it because there's no way to translate non-ascii to ascii using a StreamWriter. * UnicodeError gets thrown. * We catch it - but then we cannot transform unicode into unicode so we get a traceback. Here's a new hack (now with 50% more "Eeewww" to workaround this type of input): try: self.wrapped_stream.write(to_write) except UnicodeError: if isinstance(to_write, unicode): to_write = to_write.decode(self.encoding or 'ascii', errors='replace') to_write = unicode(to_write, encoding=self.encoding or 'ascii', errors='replace') self.wrapped_stream_write(to_write)
bzr selftests summary before my change: FAILED (failures=10, errors=29, known_failure_count=62) 1093 tests skipped After my change: FAILED (failures=7, errors=25, known_failure_count=62) 1093 tests skipped (On a Fedora 17 system with /etc/fedora-release modified to include non-ascii characters) I'll go ahead and apply this to F19 (where Shröedinger's Cat is causing the issue to occur and F20.
bzr-2.5.1-13.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/bzr-2.5.1-13.fc19
Package bzr-2.5.1-13.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing bzr-2.5.1-13.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-12537/bzr-2.5.1-13.fc19 then log in and leave karma (feedback).
bzr-2.5.1-13.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.