annotating a binary file should raise an exception

Bug #305797 reported by Martin Albisetti
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

We currently annotate any file, regardless of them being binary or not.
I don't think there's any good reason to actually annotate a binary file, so bzr should raise an exception when trying to do so, and, of course, do something sensible on the UI about it.

Loggerhead would benefit from this so we don't try and annotate an ISO image through the web :)

Tags: annotate
Revision history for this message
John A Meinel (jameinel) wrote :

We have bzrlib.textfile.check_text_lines() that will raise BinaryFile if there are null bytes in the first 1024 bytes.

I realize we could use this as part of annotate, I'm not sure if Loggerhead would be able to use this more directly.

Revision history for this message
Martin Albisetti (beuno) wrote : Re: [Bug 305797] Re: annotating a binary file should raise an exception

> We have bzrlib.textfile.check_text_lines() that will raise BinaryFile if
> there are null bytes in the first 1024 bytes.

Would this read the whole file?
As in, does it scale well to big files?

--
Martin

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Jelmer Vernooij (jelmer)
tags: added: annotate
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
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.