From 7973c0199fbbff9430e918e62db248e3d773e33f Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 18 Oct 2012 18:31:29 +0300 Subject: [PATCH] bmap: fix the image file open mode Open the image file in R/O binary mode instead of the default R/O mode. Change-Id: Ibc8b69fdf0b920c716e7cc9c23017747206e5500 Signed-off-by: Artem Bityutskiy --- mic/imager/raw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mic/imager/raw.py b/mic/imager/raw.py index d543cb2..1cce552 100644 --- a/mic/imager/raw.py +++ b/mic/imager/raw.py @@ -621,7 +621,7 @@ class RawImageCreator(BaseImageCreator): image_size = os.path.getsize(image) - with open(bmap_file, "w") as f_bmap, open(image) as f_image: + with open(bmap_file, "w") as f_bmap, open(image, "rb") as f_image: # Get the block size of the host file-system for the image file # by calling the FIGETBSZ ioctl (number 2). block_size = unpack('I', ioctl(f_image, 2, pack('I', 0)))[0] -- 2.7.4