insane: Open file in binary mode
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 May 2013 12:56:03 +0000 (13:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 May 2013 13:06:51 +0000 (14:06 +0100)
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.

(From OE-Core rev: 4f47b3a4726dd47e8a6db228fcaf25d1890e3e52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/insane.bbclass

index 41007f8..809aa45 100644 (file)
@@ -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