1 |
Author: zmedico |
2 |
Date: 2009-07-04 20:33:46 +0000 (Sat, 04 Jul 2009) |
3 |
New Revision: 13786 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dbapi/vartree.py |
7 |
Log: |
8 |
Make dblink.setfile() write environment.bz2 in binary mode. |
9 |
|
10 |
|
11 |
Modified: main/trunk/pym/portage/dbapi/vartree.py |
12 |
=================================================================== |
13 |
--- main/trunk/pym/portage/dbapi/vartree.py 2009-07-04 20:20:43 UTC (rev 13785) |
14 |
+++ main/trunk/pym/portage/dbapi/vartree.py 2009-07-04 20:33:46 UTC (rev 13786) |
15 |
@@ -4017,7 +4017,10 @@ |
16 |
return mydata |
17 |
|
18 |
def setfile(self,fname,data): |
19 |
- write_atomic(os.path.join(self.dbdir, fname), data) |
20 |
+ mode = 'w' |
21 |
+ if fname == 'environment.bz2' or not isinstance(data, basestring): |
22 |
+ mode = 'wb' |
23 |
+ write_atomic(os.path.join(self.dbdir, fname), data, mode=mode) |
24 |
|
25 |
def getelements(self,ename): |
26 |
if not os.path.exists(self.dbdir+"/"+ename): |