put_bytes should raise a specific exception when given unicode

Bug #106898 reported by Andrew Bennetts
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Vincent Ladeuil

Bug Description

At the moment, transport.put_bytes raises either AssertionError or UnicodeEncodeError when given unicode strings rather than bytes. We should choose a more appropriate error (perhaps TypeError? Or define a new one?), and fix all the transports to raise it rather anything else in this case. (see test_put_bytes_unicode in test_transport_implementations).

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

TypeError would be ok.

Changed in bzr:
status: New → Incomplete
Revision history for this message
Samuel Bronson (naesten) wrote :

Why is this incomplete?

Revision history for this message
Martin Pool (mbp) wrote :

It was probably incomplete because of a Launchpad midair collision or something.

Changed in bzr:
status: Incomplete → Confirmed
importance: Undecided → Low
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.7b1
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
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.