diff --git a/kallithea/lib/vcs/backends/hg/changeset.py b/kallithea/lib/vcs/backends/hg/changeset.py --- a/kallithea/lib/vcs/backends/hg/changeset.py +++ b/kallithea/lib/vcs/backends/hg/changeset.py @@ -246,9 +246,9 @@ class MercurialChangeset(BaseChangeset): """ fctx = self._get_filectx(path) if 'x' in fctx.flags(): - return 0100755 + return 0o100755 else: - return 0100644 + return 0o100644 def get_file_content(self, path): """ diff --git a/kallithea/lib/vcs/nodes.py b/kallithea/lib/vcs/nodes.py --- a/kallithea/lib/vcs/nodes.py +++ b/kallithea/lib/vcs/nodes.py @@ -255,7 +255,7 @@ class FileNode(Node): super(FileNode, self).__init__(path, kind=NodeKind.FILE) self.changeset = changeset self._content = content - self._mode = mode or 0100644 + self._mode = mode or 0o100644 @LazyProperty def mode(self): diff --git a/kallithea/model/scm.py b/kallithea/model/scm.py --- a/kallithea/model/scm.py +++ b/kallithea/model/scm.py @@ -750,7 +750,7 @@ class ScmModel(object): with open(_hook_file, 'wb') as f: tmpl = tmpl.replace('_TMPL_', kallithea.__version__) f.write(tmpl) - os.chmod(_hook_file, 0755) + os.chmod(_hook_file, 0o755) except IOError as e: log.error('error writing %s: %s', _hook_file, e) else: diff --git a/kallithea/tests/vcs/test_git.py b/kallithea/tests/vcs/test_git.py --- a/kallithea/tests/vcs/test_git.py +++ b/kallithea/tests/vcs/test_git.py @@ -657,7 +657,7 @@ class TestGitSpecificWithRepo(_BackendTe 'added': [ FileNode('foobar/static/js/admin/base.js', content='base'), FileNode('foobar/static/admin', content='admin', - mode=0120000), # this is a link + mode=0o120000), # this is a link FileNode('foo', content='foo'), ], }, diff --git a/kallithea/tests/vcs/test_nodes.py b/kallithea/tests/vcs/test_nodes.py --- a/kallithea/tests/vcs/test_nodes.py +++ b/kallithea/tests/vcs/test_nodes.py @@ -144,13 +144,13 @@ class TestNodeBasic(object): assert not mode & stat.S_IXOTH def test_file_node_is_executable(self): - node = FileNode('foobar', 'empty... almost', mode=0100755) + node = FileNode('foobar', 'empty... almost', mode=0o100755) assert node.is_executable - node = FileNode('foobar', 'empty... almost', mode=0100500) + node = FileNode('foobar', 'empty... almost', mode=0o100500) assert node.is_executable - node = FileNode('foobar', 'empty... almost', mode=0100644) + node = FileNode('foobar', 'empty... almost', mode=0o100644) assert not node.is_executable def test_mimetype(self):