octal notation 0700 -> 0o700
Use octal notation that python3 understands. Works >=python2.6 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
0844d27f9f
commit
55da31c84b
@ -49,7 +49,7 @@ class CustomConfigParser(SafeConfigParser):
|
||||
def getmetadatadir(self):
|
||||
metadatadir = os.path.expanduser(self.getdefault("general", "metadata", "~/.offlineimap"))
|
||||
if not os.path.exists(metadatadir):
|
||||
os.mkdir(metadatadir, 0700)
|
||||
os.mkdir(metadatadir, 0o700)
|
||||
return metadatadir
|
||||
|
||||
def getlocaleval(self):
|
||||
|
@ -216,7 +216,7 @@ class SyncableAccount(Account):
|
||||
self.ui.registerthread(self)
|
||||
accountmetadata = self.getaccountmeta()
|
||||
if not os.path.exists(accountmetadata):
|
||||
os.mkdir(accountmetadata, 0700)
|
||||
os.mkdir(accountmetadata, 0o700)
|
||||
|
||||
self.remoterepos = Repository(self, 'remote')
|
||||
self.localrepos = Repository(self, 'local')
|
||||
|
@ -256,7 +256,7 @@ class MaildirFolder(BaseFolder):
|
||||
# open file and write it out
|
||||
try:
|
||||
fd = os.open(os.path.join(tmpdir, messagename),
|
||||
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0666)
|
||||
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666)
|
||||
except OSError as e:
|
||||
if e.errno == 17:
|
||||
#FILE EXISTS ALREADY
|
||||
|
@ -35,13 +35,13 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
|
||||
self._accountname = self.account.getname()
|
||||
self.uiddir = os.path.join(self.config.getmetadatadir(), 'Repository-' + self.name)
|
||||
if not os.path.exists(self.uiddir):
|
||||
os.mkdir(self.uiddir, 0700)
|
||||
os.mkdir(self.uiddir, 0o700)
|
||||
self.mapdir = os.path.join(self.uiddir, 'UIDMapping')
|
||||
if not os.path.exists(self.mapdir):
|
||||
os.mkdir(self.mapdir, 0700)
|
||||
os.mkdir(self.mapdir, 0o700)
|
||||
self.uiddir = os.path.join(self.uiddir, 'FolderValidity')
|
||||
if not os.path.exists(self.uiddir):
|
||||
os.mkdir(self.uiddir, 0700)
|
||||
os.mkdir(self.uiddir, 0o700)
|
||||
|
||||
self.nametrans = lambda foldername: foldername
|
||||
self.folderfilter = lambda foldername: 1
|
||||
|
@ -41,7 +41,7 @@ class LocalStatusRepository(BaseRepository):
|
||||
% (backend, account.name))
|
||||
|
||||
if not os.path.exists(self.root):
|
||||
os.mkdir(self.root, 0700)
|
||||
os.mkdir(self.root, 0o700)
|
||||
|
||||
# self._folders is a list of LocalStatusFolders()
|
||||
self._folders = None
|
||||
|
@ -37,7 +37,7 @@ class MaildirRepository(BaseRepository):
|
||||
|
||||
# Create the top-level folder if it doesn't exist
|
||||
if not os.path.isdir(self.root):
|
||||
os.mkdir(self.root, 0700)
|
||||
os.mkdir(self.root, 0o700)
|
||||
|
||||
def _append_folder_atimes(self, foldername):
|
||||
"""Store the atimes of a folder's new|cur in self.folder_atimes"""
|
||||
@ -97,7 +97,7 @@ class MaildirRepository(BaseRepository):
|
||||
# sub-folders may be created before higher-up ones.
|
||||
self.debug("makefolder: calling makedirs '%s'" % full_path)
|
||||
try:
|
||||
os.makedirs(full_path, 0700)
|
||||
os.makedirs(full_path, 0o700)
|
||||
except OSError as e:
|
||||
if e.errno == 17 and os.path.isdir(full_path):
|
||||
self.debug("makefolder: '%s' already a directory" % foldername)
|
||||
@ -105,7 +105,7 @@ class MaildirRepository(BaseRepository):
|
||||
raise
|
||||
for subdir in ['cur', 'new', 'tmp']:
|
||||
try:
|
||||
os.mkdir(os.path.join(full_path, subdir), 0700)
|
||||
os.mkdir(os.path.join(full_path, subdir), 0o700)
|
||||
except OSError as e:
|
||||
if e.errno == 17 and os.path.isdir(full_path):
|
||||
self.debug("makefolder: '%s' already has subdir %s" %
|
||||
|
Loading…
Reference in New Issue
Block a user