~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-22 15:54:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2923.
  • Revision ID: john@arbash-meinel.com-20071022155447-ev3m0pvsmeel6nge
Fix bug #153493, use O_BINARY when reading files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
def sha_file_by_name(fname):
594
594
    """Calculate the SHA1 of a file by reading the full text"""
595
595
    s = sha.new()
596
 
    f = os.open(fname, os.O_RDONLY)
 
596
    f = os.open(fname, os.O_RDONLY | O_BINARY)
597
597
    try:
598
598
        while True:
599
599
            b = os.read(f, 1<<16)