[oe-commits] [bitbake] 01/05: fetch2: fix pickle issues while switching from master to krogoth

git at git.openembedded.org git at git.openembedded.org
Fri Jul 29 08:55:27 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit cc67800f279fb211ee3bb4ea7009fdbb82973b02
Author: Maxin B. John <maxin.john at intel.com>
AuthorDate: Fri Jul 29 11:23:35 2016 +0300

    fetch2: fix pickle issues while switching from master to krogoth
    
    While switching from master to krogoth build with a common download directory,
    got a large number of warnings like the one listed below:
    
    WARNING: freetype-2.6.3-r0 do_fetch: Couldn't load checksums from
    donestamp /home/maxin/downloads/freetype-2.6.3.tar.bz2.done: ValueError
    (msg: unsupported pickle protocol: 4)
    
    These warnings are caused by the difference in pickle module
    implementation in python3(master) and python2(krogoth). Python2 supports
    3 different protocols (0, 1, 2) and pickle.HIGHEST_PROTOCOL is 2 where as
    Python3 supports 5 different protocols (0, 1, 2, 3, 4) and
    pickle.HIGHEST_PROTOCOL is obviously 4.
    
    My suggestion is to use 2 since it is backward compatible with python2
    (all the supported distros for krogoth provides python2 which supports
    pickle protocol version 2)
    
    Signed-off-by: Maxin B. John <maxin.john at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 3eabba1..9054b2e 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -664,7 +664,7 @@ def verify_donestamp(ud, d, origud=None):
         # as an upgrade path from the previous done stamp file format.
         if checksums != precomputed_checksums:
             with open(ud.donestamp, "wb") as cachefile:
-                p = pickle.Pickler(cachefile, pickle.HIGHEST_PROTOCOL)
+                p = pickle.Pickler(cachefile, 2)
                 p.dump(checksums)
         return True
     except ChecksumError as e:
@@ -698,7 +698,7 @@ def update_stamp(ud, d):
             checksums = verify_checksum(ud, d)
             # Store the checksums for later re-verification against the recipe
             with open(ud.donestamp, "wb") as cachefile:
-                p = pickle.Pickler(cachefile, pickle.HIGHEST_PROTOCOL)
+                p = pickle.Pickler(cachefile, 2)
                 p.dump(checksums)
         except ChecksumError as e:
             # Checksums failed to verify, trigger re-download and remove the

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list