Pārlūkot izejas kodu

Don't open non-binary files as binary

* Don't pen the git config file, and the git ".lock" file as binary.

Change-Id: I7b3939658456f2fd0a0500443cdd8d1ee1a4459d
Chirayu Desai 11 gadi atpakaļ
vecāks
revīzija
303a82f33a
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1 1
      git_config.py
  2. 1 1
      project.py

+ 1 - 1
git_config.py

@@ -697,7 +697,7 @@ class Branch(object):
       self._Set('merge', self.merge)
 
     else:
-      fd = open(self._config.file, 'ab')
+      fd = open(self._config.file, 'a')
       try:
         fd.write('[branch "%s"]\n' % self.name)
         if self.remote:

+ 1 - 1
project.py

@@ -46,7 +46,7 @@ if not is_python3():
 def _lwrite(path, content):
   lock = '%s.lock' % path
 
-  fd = open(lock, 'wb')
+  fd = open(lock, 'w')
   try:
     fd.write(content)
   finally: