Patchwork [11/15] insane: Open file in binary mode

login
register
mail settings
Submitter Richard Purdie
Date May 7, 2013, 12:56 p.m.
Message ID <1367931368-21504-11-git-send-email-richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/49465/
State Accepted
Commit e1b5647d2c84579b65f54aa7ca07a41b1dd9470d
Headers show

Comments

Richard Purdie - May 7, 2013, 12:56 p.m.
We open the file we're writing to in binary mode so open the input stream with the
same mode so things match. This avoids errors with python3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/insane.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 271e9ff..c5d8ad9 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -578,7 +578,7 @@  def package_qa_check_license(workdir, d):
         if (not beginline) and (not endline):
             md5chksum = bb.utils.md5_file(srclicfile)
         else:
-            fi = open(srclicfile, 'r')
+            fi = open(srclicfile, 'rb')
             fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False)
             tmplicfile = fo.name;
             lineno = 0