# HG changeset patch # User domruf # Date 1456944651 -3600 # Node ID 2d92227f576da32e6a59d32445a103df66593ce3 # Parent 20bf8e618bc9ffc5d6f0149d9bd41108293ae459 tests: binary streams/files need to be opened in binary mode Without binary, the stream may be closed on EOF character http://stackoverflow.com/a/9069009/7029 . diff -r 20bf8e618bc9 -r 2d92227f576d kallithea/tests/vcs/test_archives.py --- a/kallithea/tests/vcs/test_archives.py Wed Mar 02 18:58:25 2016 +0100 +++ b/kallithea/tests/vcs/test_archives.py Wed Mar 02 19:50:51 2016 +0100 @@ -74,12 +74,12 @@ def test_archive_default_stream(self): tmppath = tempfile.mkstemp()[1] - with open(tmppath, 'w') as stream: + with open(tmppath, 'wb') as stream: self.tip.fill_archive(stream=stream) mystream = StringIO.StringIO() self.tip.fill_archive(stream=mystream) mystream.seek(0) - with open(tmppath, 'r') as f: + with open(tmppath, 'rb') as f: self.assertEqual(f.read(), mystream.read()) def test_archive_wrong_kind(self):