Bug 979399 - the command "bzr version" fails with traceback.
the command "bzr version" fails with traceback.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: bzr (Show other bugs)
19
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Toshio Ernie Kuratomi
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-28 08:36 EDT by Barry Fishman
Modified: 2013-07-18 01:48 EDT (History)
5 users (show)

See Also:
Fixed In Version: bzr-2.5.1-13.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-18 01:48:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
results from 'bzr version >try.log 2>&1' (2.39 KB, text/x-log)
2013-06-28 08:36 EDT, Barry Fishman
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1195783 None None None Never

  None (edit)
Description Barry Fishman 2013-06-28 08:36:29 EDT
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:
Comment 1 Toshio Ernie Kuratomi 2013-06-28 11:54:27 EDT
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.
Comment 2 Toshio Ernie Kuratomi 2013-06-28 21:44:41 EDT
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.
Comment 3 Toshio Ernie Kuratomi 2013-07-02 13:37:45 EDT
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.
Comment 4 Toshio Ernie Kuratomi 2013-07-04 11:36:35 EDT
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)
Comment 5 Toshio Ernie Kuratomi 2013-07-04 12:57:41 EDT
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.
Comment 6 Fedora Update System 2013-07-05 12:01:05 EDT
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
Comment 7 Fedora Update System 2013-07-06 21:39:58 EDT
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).
Comment 8 Fedora Update System 2013-07-18 01:48:37 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.