/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/textfile.py

  • Committer: Aaron Bentley
  • Date: 2006-04-16 17:49:14 UTC
  • mto: This revision was merged to the branch mainline in revision 1673.
  • Revision ID: aaron.bentley@utoronto.ca-20060416174914-99d5dec4eafbb923
Whitespace fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006 by Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
"""Utilities for distinguishing binary files from text files"""
18
 
 
19
 
from itertools import chain
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
 
17
from itertools import chain 
20
18
 
21
19
from bzrlib.errors import BinaryFile
22
20
from bzrlib.iterablefile import IterableFile
46
44
    """Check whether the supplied path is a text, not binary file.
47
45
    Raise BinaryFile if a NUL occurs in the first 1024 bytes.
48
46
    """
49
 
    f = open(path, 'rb')
50
 
    try:
51
 
        text_file(f)
52
 
    finally:
53
 
        f.close()
 
47
    text_file(open(path, 'rb'))