* HTTP server correctly handles empty CONTENT_LENGTH. (Dave Borowitz)
+ * Don't error when creating GitFiles with the default mode. (Dave Borowitz)
+
FEATURES
* Use slots for core objects to save up on memory. (Jelmer Vernooij)
os.remove(tmpfile)
-def GitFile(filename, mode='r', bufsize=-1):
+def GitFile(filename, mode='rb', bufsize=-1):
"""Create a file object that obeys the git file locking protocol.
:return: a builtin file object or a _GitFile object
self.assertEquals('contents', f.read())
f.close()
+ def test_default_mode(self):
+ f = GitFile(self.path('foo'))
+ self.assertEquals('foo contents', f.read())
+ f.close()
+
def test_write(self):
foo = self.path('foo')
foo_lock = '%s.lock' % foo