Changeset - a553bc3a3d0e
[Not reviewed]
default
0 3 0
Mads Kiilerich - 6 years ago 2019-12-27 01:46:11
mads@kiilerich.com
Grafted from: 360bb4c5934e
py3: open files as binary or not, depending on how we want to use them

The difference will matter when bytes and str are different.
3 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/pidlock.py
Show inline comments
 
@@ -137,6 +137,6 @@ class DaemonLock(object):
 
        dir_, file_ = os.path.split(pidfile)
 
        if not os.path.isdir(dir_):
 
            os.makedirs(dir_)
 
        with open(self.pidfile, 'wb') as f:
 
        with open(self.pidfile, 'w') as f:
 
            f.write(lockname)
 
        self.held = True
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -51,7 +51,7 @@ class ArchivesTestCaseMixin(_BackendTest
 

	
 
        for x in xrange(5):
 
            node_path = '%d/file_%d.txt' % (x, x)
 
            assert open(os.path.join(outdir, 'repo/' + node_path)).read() == self.tip.get_node(node_path).content
 
            assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
 

	
 
    def test_archive_tbz2(self):
 
        path = tempfile.mkstemp(dir=TESTS_TMP_PATH, prefix='test_archive_tbz2-')[1]
 
@@ -64,7 +64,7 @@ class ArchivesTestCaseMixin(_BackendTest
 

	
 
        for x in xrange(5):
 
            node_path = '%d/file_%d.txt' % (x, x)
 
            assert open(os.path.join(outdir, 'repo/' + node_path)).read() == self.tip.get_node(node_path).content
 
            assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
 

	
 
    def test_archive_default_stream(self):
 
        tmppath = tempfile.mkstemp(dir=TESTS_TMP_PATH, prefix='test_archive_default_stream-')[1]
setup.py
Show inline comments
 
@@ -25,7 +25,7 @@ def _get_meta_var(name, data, callback_h
 

	
 
        return callback_handler(eval(matches.groups()[0]))
 

	
 
_meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'rb')
 
_meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'r')
 
_metadata = _meta.read()
 
_meta.close()
 

	
0 comments (0 inline, 0 general)