code: fixed deprecated octal calls for py3 compat.

This commit is contained in:
Marcin Kuzminski 2018-11-30 11:49:27 +01:00
parent 1ff28bbbfe
commit f3d3f479b4
8 changed files with 14 additions and 14 deletions

View file

@ -63,7 +63,7 @@ def maybe_create_history_store(event):
settings = event.app.registry.settings
history_dir = settings.get('channelstream.history.location', '')
if history_dir and not os.path.exists(history_dir):
os.makedirs(history_dir, 0750)
os.makedirs(history_dir, 0o750)
def includeme(config):

View file

@ -476,7 +476,7 @@ def _sanitize_cache_settings(settings):
# ensure we have our dir created
if not os.path.isdir(default_cache_dir):
os.makedirs(default_cache_dir, mode=0755)
os.makedirs(default_cache_dir, mode=0o755)
# exception store cache
_string_setting(

View file

@ -50,8 +50,8 @@ from rhodecode.lib.vcs.exceptions import (
log = logging.getLogger(__name__)
FILEMODE_DEFAULT = 0100644
FILEMODE_EXECUTABLE = 0100755
FILEMODE_DEFAULT = 0o100644
FILEMODE_EXECUTABLE = 0o100755
Reference = collections.namedtuple('Reference', ('type', 'name', 'commit_id'))
MergeResponse = collections.namedtuple(
@ -209,7 +209,7 @@ class BaseRepository(object):
def get_create_shadow_cache_pr_path(self, db_repo):
path = db_repo.cached_diffs_dir
if not os.path.exists(path):
os.makedirs(path, 0755)
os.makedirs(path, 0o755)
return path
@classmethod
@ -1046,7 +1046,7 @@ class BaseCommit(object):
('tags', ','.join(self.tags)),
]
meta = ["%s:%s" % (f_name, value) for f_name, value in metadata]
file_info.append(('.archival.txt', 0644, False, '\n'.join(meta)))
file_info.append(('.archival.txt', 0o644, False, '\n'.join(meta)))
connection.Hg.archive_repo(file_path, mtime, file_info, kind)

View file

@ -161,7 +161,7 @@ class GitRepository(BaseRepository):
GitRepository.check_url(src_url, self.config)
if create:
os.makedirs(self.path, mode=0755)
os.makedirs(self.path, mode=0o755)
if bare:
self._remote.init_bare()

View file

@ -355,7 +355,7 @@ class MercurialRepository(BaseRepository):
create = False
if create:
os.makedirs(self.path, mode=0755)
os.makedirs(self.path, mode=0o755)
self._remote.localrepository(create)

View file

@ -181,7 +181,7 @@ class RepoGroupModel(BaseModel):
self.check_exist_filesystem(group_name)
create_path = os.path.join(self.repos_path, group_name)
log.debug('creating new group in %s', create_path)
os.makedirs(create_path, mode=0755)
os.makedirs(create_path, mode=0o755)
log.debug('created group in %s', create_path)
def _rename_group(self, old, new):

View file

@ -538,7 +538,7 @@ TODO: To be written...
'sys.exit(1)',
]
f.write('\n'.join(script_lines))
os.chmod(hook_path, 0755)
os.chmod(hook_path, 0o755)
def test_local_push_does_not_execute_hook(self):
target_repo = self.get_empty_repo()
@ -1061,7 +1061,7 @@ class TestGitSpecificWithRepo(BackendTestMixin):
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'),
],
},

View file

@ -190,13 +190,13 @@ class TestNodeBasics:
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_file_node_is_not_symlink(self):