Merge lp://staging/~parthm/bzr/518609-version-info-unicodedecodeerror into lp://staging/bzr

Proposed by Parth Malwankar
Status: Rejected
Rejected by: Robert Collins
Proposed branch: lp://staging/~parthm/bzr/518609-version-info-unicodedecodeerror
Merge into: lp://staging/bzr
Diff against target: 68 lines (+11/-4)
3 files modified
NEWS (+4/-0)
bzrlib/rio.py (+1/-1)
bzrlib/tests/test_version_info.py (+6/-3)
To merge this branch: bzr merge lp://staging/~parthm/bzr/518609-version-info-unicodedecodeerror
Reviewer Review Type Date Requested Status
Robert Collins (community) Needs Fixing
Review via email: mp+22801@code.staging.launchpad.net

Description of the change

=== Fixes Bug #518609 ===
This fixes unicode handling of 'version-info --include-history'. UnicodeDecodeError exception is not thrown. This was discussed on the mailing list[1].

Stanza.write now uses to_file.write(self.to_unicode()) rather than to_file.writelines(self.to_lines()).

The tests are updated for this. As cStringIO object cannot handle unicode, the impacted tests use StringIO (imported as UnicodeStringIO) to allow writing of unicode. To allow UnicodeStringIO to behave like a file (write unicode, read str), the buffer is encoded as utf-8 on read before being passed to the caller.

Manual testing was done to ensure that unicode messages are shown correctly. E.g.:
< message: (Luk?? Lalinsk?) Add a global write lock for cmd_uncommit (related to #172649)
---
> message: (Lukáš Lalinský) Add a global write lock for cmd_uncommit (related to #172649)

[1] http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/67403

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

This really is the wrong approach I think. See the list discussion.

review: Needs Fixing

Unmerged revisions

5131. By Parth Malwankar

updated NEWS

5130. By Parth Malwankar

merged in trunk

5129. By Parth Malwankar

#518609. version-info --include histroy handes unicode.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.