summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-04 20:33:46 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-04 20:33:46 +0000
commit3461525778122bc4190107c5be4bbe2d09ca9e5c (patch)
treee717972abafacaa28d793ff52ca4d81041971ce6
parent277479ba4bea43e497cbe58ff87bef16eff55ed8 (diff)
downloadportage-3461525778122bc4190107c5be4bbe2d09ca9e5c.tar.gz
portage-3461525778122bc4190107c5be4bbe2d09ca9e5c.tar.bz2
portage-3461525778122bc4190107c5be4bbe2d09ca9e5c.zip
Make dblink.setfile() write environment.bz2 in binary mode.
svn path=/main/trunk/; revision=13786
-rw-r--r--pym/portage/dbapi/vartree.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 5b6f54a6a..a5b39e317 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -4017,7 +4017,10 @@ class dblink(object):
return mydata
def setfile(self,fname,data):
- write_atomic(os.path.join(self.dbdir, fname), data)
+ mode = 'w'
+ if fname == 'environment.bz2' or not isinstance(data, basestring):
+ mode = 'wb'
+ write_atomic(os.path.join(self.dbdir, fname), data, mode=mode)
def getelements(self,ename):
if not os.path.exists(self.dbdir+"/"+ename):