Permalink
Browse files

Py3k: Octal (0777 -> 0o777)

  • Loading branch information...
1 parent 1981689 commit 1080b1bf1c2c7c53ab017f3a3f89d58d09b7ff5f @bfroehle committed Sep 27, 2012
@@ -181,7 +181,7 @@ def _ipython_dir_changed(self, name, old, new):
sys.path.remove(old)
sys.path.append(os.path.abspath(new))
if not os.path.isdir(new):
- os.makedirs(new, mode=0777)
+ os.makedirs(new, mode=0o777)
readme = os.path.join(new, 'README')
if not os.path.exists(readme):
path = os.path.join(get_ipython_package_dir(), u'config', u'profile')
@@ -75,7 +75,7 @@ def ipython_extension_dir(self):
def _on_ipython_dir_changed(self):
if not os.path.isdir(self.ipython_extension_dir):
- os.makedirs(self.ipython_extension_dir, mode = 0777)
+ os.makedirs(self.ipython_extension_dir, mode = 0o777)
def load_extension(self, module_str):
"""Load an IPython extension by its module name.
@@ -138,7 +138,7 @@ def install_extension(self, url, filename=None):
"""
# Ensure the extension directory exists
if not os.path.isdir(self.ipython_extension_dir):
- os.makedirs(self.ipython_extension_dir, mode = 0777)
+ os.makedirs(self.ipython_extension_dir, mode = 0o777)
if os.path.isfile(url):
src_filename = os.path.basename(url)
@@ -501,7 +501,7 @@ def get_ipython(self):
def _ipython_dir_changed(self, name, new):
if not os.path.isdir(new):
- os.makedirs(new, mode = 0777)
+ os.makedirs(new, mode = 0o777)
def set_autoindent(self,value=None):
"""Set the autoindent flag, checking for readline support.
@@ -110,10 +110,10 @@ def _security_dir_changed(self, name, old, new):
def check_security_dir(self):
if not os.path.isdir(self.security_dir):
- os.mkdir(self.security_dir, 0700)
+ os.mkdir(self.security_dir, 0o700)
else:
try:
- os.chmod(self.security_dir, 0700)
+ os.chmod(self.security_dir, 0o700)
except OSError:
self.log.warn("Could not set security dir permissions to private.")
@@ -122,10 +122,10 @@ def _pid_dir_changed(self, name, old, new):
def check_pid_dir(self):
if not os.path.isdir(self.pid_dir):
- os.mkdir(self.pid_dir, 0700)
+ os.mkdir(self.pid_dir, 0o700)
else:
try:
- os.chmod(self.pid_dir, 0700)
+ os.chmod(self.pid_dir, 0o700)
except OSError:
self.log.warn("Could not set pid dir permissions to private.")
@@ -860,10 +860,10 @@ def renames(self, new):
# --- Create/delete operations on directories
- def mkdir(self, mode=0777):
+ def mkdir(self, mode=0o777):
os.mkdir(self, mode)
- def makedirs(self, mode=0777):
+ def makedirs(self, mode=0o777):
os.makedirs(self, mode)
def rmdir(self):
@@ -879,7 +879,7 @@ def touch(self):
""" Set the access/modified times of this file to the current time.
Create the file if it does not exist.
"""
- fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0666)
+ fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0o666)
os.close(fd)
os.utime(self, None)

0 comments on commit 1080b1b

Please sign in to comment.