diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-10 06:04:17 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-10 06:04:17 +0000 |
commit | 312fba349f442f4e31bcbe49bbf292d2603c71cd (patch) | |
tree | 888a5b419da9311e5715c956885804403c1c2211 | |
parent | 8ebc64df649d8eee10185ec5c7cf54428ee1d9ba (diff) | |
download | portage-312fba349f442f4e31bcbe49bbf292d2603c71cd.tar.gz portage-312fba349f442f4e31bcbe49bbf292d2603c71cd.tar.bz2 portage-312fba349f442f4e31bcbe49bbf292d2603c71cd.zip |
Use protocol=2 for pickle.dump() calls, so that pickles written by py3k will
be backward compatible.
svn path=/main/trunk/; revision=12821
-rw-r--r-- | pym/_emerge/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 4 | ||||
-rw-r--r-- | pym/portage/getbinpkg.py | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 4d1f4792f..88ec8bde3 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -4194,7 +4194,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping): secpass >= 2: try: f = portage.util.atomic_ofstream(self._cache_filename, mode='wb') - pickle.dump(self._cache_data, f, -1) + pickle.dump(self._cache_data, f, protocol=2) f.close() portage.util.apply_secpass_permissions( self._cache_filename, gid=portage.portage_gid, mode=0644) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 53ae54048..24997e280 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7541,7 +7541,7 @@ def commit_mtimedb(mydict=None, filename=None): d.update(mydict) try: f = atomic_ofstream(filename, mode='wb') - pickle.dump(d, f, -1) + pickle.dump(d, f, protocol=2) f.close() portage.util.apply_secpass_permissions(filename, uid=uid, gid=portage_gid, mode=0644) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 8ceff86e6..e3dc6a049 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -81,7 +81,7 @@ class PreservedLibsRegistry(object): return try: f = atomic_ofstream(self._filename, 'wb') - pickle.dump(self._data, f) + pickle.dump(self._data, f, protocol=2) f.close() except EnvironmentError, e: if e.errno != PermissionDenied.errno: @@ -1033,7 +1033,7 @@ class vardbapi(dbapi): del self._aux_cache["modified"] try: f = atomic_ofstream(self._aux_cache_filename, 'wb') - pickle.dump(self._aux_cache, f, -1) + pickle.dump(self._aux_cache, f, protocol=2) f.close() apply_secpass_permissions( self._aux_cache_filename, gid=portage_gid, mode=0644) diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index 02e5de277..29e2ff4f8 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -581,7 +581,7 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= sys.stderr.flush() try: metadatafile = open(metadatafilename, 'wb') - pickle.dump(metadata,metadatafile) + pickle.dump(metadata, metadatafile, protocol=2) metadatafile.close() except SystemExit, e: raise @@ -673,11 +673,11 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= if "modified" in metadata[baseurl] and metadata[baseurl]["modified"]: metadata[baseurl]["timestamp"] = int(time.time()) metadatafile = open(metadatafilename, 'wb') - pickle.dump(metadata,metadatafile) + pickle.dump(metadata, metadatafile, protocol=2) metadatafile.close() if makepickle: metadatafile = open(makepickle, 'wb') - pickle.dump(metadata[baseurl]["data"],metadatafile) + pickle.dump(metadata[baseurl]["data"], metadatafile, protocol=2) metadatafile.close() except SystemExit, e: raise |