Rev 2923: Fix bug #153493, use O_BINARY when reading files. in http://bzr.arbash-meinel.com/branches/bzr/0.92-dev/binary_read_153493

John Arbash Meinel john at arbash-meinel.com
Mon Oct 22 16:55:42 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.92-dev/binary_read_153493

------------------------------------------------------------
revno: 2923
revision-id:john at arbash-meinel.com-20071022155447-ev3m0pvsmeel6nge
parent: pqm at pqm.ubuntu.com-20071022014712-mpln8namgmsywr75
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: binary_read_153493
timestamp: Mon 2007-10-22 10:54:47 -0500
message:
  Fix bug #153493, use O_BINARY when reading files.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-10-19 18:43:47 +0000
+++ b/NEWS	2007-10-22 15:54:47 +0000
@@ -85,6 +85,9 @@
 
   BUG FIXES:
 
+   * Make sure to use ``O_BINARY`` when opening files to check their
+     sha1sum. (Alexander Belchenko, John Arbash Meinel, #153493)
+
    * Fix a problem with Win32 handling of the executable bit.
      (John Arbash Meinel, #149113)
 

=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2007-10-08 05:09:59 +0000
+++ b/bzrlib/osutils.py	2007-10-22 15:54:47 +0000
@@ -593,7 +593,7 @@
 def sha_file_by_name(fname):
     """Calculate the SHA1 of a file by reading the full text"""
     s = sha.new()
-    f = os.open(fname, os.O_RDONLY)
+    f = os.open(fname, os.O_RDONLY | O_BINARY)
     try:
         while True:
             b = os.read(f, 1<<16)



More information about the bazaar-commits mailing list