String inputs should be clearly defined and validated in commit builder

Bug #663593 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

The commit builder code makes some effort to validate its inputs, but is not clear over whether strings should be bytes or unicode. It appears to expect either, but bug 614593 showed that it can let bytestrings through that lower level code then chokes on. Generally user input through bzr will be decoded to unicode already, but plugins and tests particularly may be using plain str, generally as ascii which is harmless. However, as it appears non-ascii bytestrings may go undetected and potentially break things, it should perhaps be stricter.

Martin Packman (gz)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 663593] [NEW] String inputs should be clearly defined and validated in commit builder

On Wed, Oct 20, 2010 at 12:14 PM, Martin [gz] <email address hidden> wrote:
> Public bug reported:
>
> The commit builder code makes some effort to validate its inputs, but is
> not clear over whether strings should be bytes or unicode. It appears to
> expect either, but bug 614593 showed that it can let bytestrings through
> that lower level code then chokes on. Generally user input through bzr
> will be decoded to unicode already, but plugins and tests particularly
> may be using plain str, generally as ascii which is harmless. However,
> as it appears non-ascii bytestrings may go undetected and potentially
> break things, it should perhaps be stricter.

Perhaps a default cast to unicode in the test layer will help -
controllable for the case where you want corrupt bytestrings ;)

-Rob

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.