diff options
Diffstat (limited to 'pym/portage/dbapi/vartree.py')
-rw-r--r-- | pym/portage/dbapi/vartree.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index b7cee710c..14c5360e2 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -58,7 +58,7 @@ class PreservedLibsRegistry(object): def load(self): """ Reload the registry data from file """ try: - self._data = pickle.load(open(self._filename, "r")) + self._data = pickle.load(open(self._filename, 'rb')) except (EOFError, IOError), e: if isinstance(e, EOFError) or e.errno == errno.ENOENT: self._data = {} @@ -75,7 +75,7 @@ class PreservedLibsRegistry(object): self._data == self._data_orig: return try: - f = atomic_ofstream(self._filename) + f = atomic_ofstream(self._filename, 'wb') pickle.dump(self._data, f) f.close() except EnvironmentError, e: @@ -1027,7 +1027,7 @@ class vardbapi(dbapi): del self._aux_cache["packages"][cpv] del self._aux_cache["modified"] try: - f = atomic_ofstream(self._aux_cache_filename) + f = atomic_ofstream(self._aux_cache_filename, 'wb') pickle.dump(self._aux_cache, f, -1) f.close() apply_secpass_permissions( @@ -1045,9 +1045,8 @@ class vardbapi(dbapi): def _aux_cache_init(self): aux_cache = None try: - f = open(self._aux_cache_filename) + f = open(self._aux_cache_filename, 'rb') mypickle = pickle.Unpickler(f) - mypickle.find_global = None aux_cache = mypickle.load() f.close() del f |