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)
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)
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)
sys.stderr.flush()
try:
metadatafile = open(metadatafilename, 'wb')
- pickle.dump(metadata,metadatafile)
+ pickle.dump(metadata, metadatafile, protocol=2)
metadatafile.close()
except SystemExit, e:
raise
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