From 76ca9f8145f367f83df19981da4dd934fdda471b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 18 Apr 2009 14:48:03 -0700 Subject: Make usage of open safer by setting binary mode and closing fds Signed-off-by: Shawn O. Pearce --- git_refs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git_refs.py') diff --git a/git_refs.py b/git_refs.py index 24760918..ac8ed0c1 100644 --- a/git_refs.py +++ b/git_refs.py @@ -101,7 +101,7 @@ class GitRefs(object): def _ReadPackedRefs(self): path = os.path.join(self._gitdir, 'packed-refs') try: - fd = open(path, 'r') + fd = open(path, 'rb') mtime = os.path.getmtime(path) except IOError: return @@ -138,7 +138,7 @@ class GitRefs(object): def _ReadLoose1(self, path, name): try: - fd = open(path, 'r') + fd = open(path, 'rb') mtime = os.path.getmtime(path) except OSError: return -- cgit v1.2.3-54-g00ecf