bzr sometimes writes undecodable bytes (like #404740) qbzr should not crash with such a situation.
Your fix seems fine for me.
Unfortunately your branch using rich-root format and therefore I can't merge it directly. Will apply your patch manually.
In future, please avoid to creating new branches in rich-root formats, until QBzr trunk migrate.
Thank you for merging. I have converted my all local repository to 2a format unwisely. I'll use a repo format same repo format as trunk next time.
Bug watches keep track of this bug in other bug trackers.
Your fix seems fine for me.