##// END OF EJS Templates
py3: open files as binary or not, depending on how we want to use them...
Mads Kiilerich -
r7991:a553bc3a default
parent child Browse files
Show More
@@ -137,6 +137,6 b' class DaemonLock(object):'
137 137 dir_, file_ = os.path.split(pidfile)
138 138 if not os.path.isdir(dir_):
139 139 os.makedirs(dir_)
140 with open(self.pidfile, 'wb') as f:
140 with open(self.pidfile, 'w') as f:
141 141 f.write(lockname)
142 142 self.held = True
@@ -51,7 +51,7 b' class ArchivesTestCaseMixin(_BackendTest'
51 51
52 52 for x in xrange(5):
53 53 node_path = '%d/file_%d.txt' % (x, x)
54 assert open(os.path.join(outdir, 'repo/' + node_path)).read() == self.tip.get_node(node_path).content
54 assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
55 55
56 56 def test_archive_tbz2(self):
57 57 path = tempfile.mkstemp(dir=TESTS_TMP_PATH, prefix='test_archive_tbz2-')[1]
@@ -64,7 +64,7 b' class ArchivesTestCaseMixin(_BackendTest'
64 64
65 65 for x in xrange(5):
66 66 node_path = '%d/file_%d.txt' % (x, x)
67 assert open(os.path.join(outdir, 'repo/' + node_path)).read() == self.tip.get_node(node_path).content
67 assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
68 68
69 69 def test_archive_default_stream(self):
70 70 tmppath = tempfile.mkstemp(dir=TESTS_TMP_PATH, prefix='test_archive_default_stream-')[1]
@@ -25,7 +25,7 b' def _get_meta_var(name, data, callback_h'
25 25
26 26 return callback_handler(eval(matches.groups()[0]))
27 27
28 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'rb')
28 _meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r')
29 29 _metadata = _meta.read()
30 30 _meta.close()
31 31
General Comments 0
You need to be logged in to leave comments. Login now