##// END OF EJS Templates
Py3k: Octal (0777 -> 0o777)
Bradley M. Froehle -
Show More
@@ -181,7 +181,7 b' class BaseIPythonApplication(Application):'
181 sys.path.remove(old)
181 sys.path.remove(old)
182 sys.path.append(os.path.abspath(new))
182 sys.path.append(os.path.abspath(new))
183 if not os.path.isdir(new):
183 if not os.path.isdir(new):
184 os.makedirs(new, mode=0777)
184 os.makedirs(new, mode=0o777)
185 readme = os.path.join(new, 'README')
185 readme = os.path.join(new, 'README')
186 if not os.path.exists(readme):
186 if not os.path.exists(readme):
187 path = os.path.join(get_ipython_package_dir(), u'config', u'profile')
187 path = os.path.join(get_ipython_package_dir(), u'config', u'profile')
@@ -75,7 +75,7 b' class ExtensionManager(Configurable):'
75
75
76 def _on_ipython_dir_changed(self):
76 def _on_ipython_dir_changed(self):
77 if not os.path.isdir(self.ipython_extension_dir):
77 if not os.path.isdir(self.ipython_extension_dir):
78 os.makedirs(self.ipython_extension_dir, mode = 0777)
78 os.makedirs(self.ipython_extension_dir, mode = 0o777)
79
79
80 def load_extension(self, module_str):
80 def load_extension(self, module_str):
81 """Load an IPython extension by its module name.
81 """Load an IPython extension by its module name.
@@ -138,7 +138,7 b' class ExtensionManager(Configurable):'
138 """
138 """
139 # Ensure the extension directory exists
139 # Ensure the extension directory exists
140 if not os.path.isdir(self.ipython_extension_dir):
140 if not os.path.isdir(self.ipython_extension_dir):
141 os.makedirs(self.ipython_extension_dir, mode = 0777)
141 os.makedirs(self.ipython_extension_dir, mode = 0o777)
142
142
143 if os.path.isfile(url):
143 if os.path.isfile(url):
144 src_filename = os.path.basename(url)
144 src_filename = os.path.basename(url)
@@ -501,7 +501,7 b' class InteractiveShell(SingletonConfigurable):'
501
501
502 def _ipython_dir_changed(self, name, new):
502 def _ipython_dir_changed(self, name, new):
503 if not os.path.isdir(new):
503 if not os.path.isdir(new):
504 os.makedirs(new, mode = 0777)
504 os.makedirs(new, mode = 0o777)
505
505
506 def set_autoindent(self,value=None):
506 def set_autoindent(self,value=None):
507 """Set the autoindent flag, checking for readline support.
507 """Set the autoindent flag, checking for readline support.
@@ -110,10 +110,10 b' class ProfileDir(LoggingConfigurable):'
110
110
111 def check_security_dir(self):
111 def check_security_dir(self):
112 if not os.path.isdir(self.security_dir):
112 if not os.path.isdir(self.security_dir):
113 os.mkdir(self.security_dir, 0700)
113 os.mkdir(self.security_dir, 0o700)
114 else:
114 else:
115 try:
115 try:
116 os.chmod(self.security_dir, 0700)
116 os.chmod(self.security_dir, 0o700)
117 except OSError:
117 except OSError:
118 self.log.warn("Could not set security dir permissions to private.")
118 self.log.warn("Could not set security dir permissions to private.")
119
119
@@ -122,10 +122,10 b' class ProfileDir(LoggingConfigurable):'
122
122
123 def check_pid_dir(self):
123 def check_pid_dir(self):
124 if not os.path.isdir(self.pid_dir):
124 if not os.path.isdir(self.pid_dir):
125 os.mkdir(self.pid_dir, 0700)
125 os.mkdir(self.pid_dir, 0o700)
126 else:
126 else:
127 try:
127 try:
128 os.chmod(self.pid_dir, 0700)
128 os.chmod(self.pid_dir, 0o700)
129 except OSError:
129 except OSError:
130 self.log.warn("Could not set pid dir permissions to private.")
130 self.log.warn("Could not set pid dir permissions to private.")
131
131
@@ -860,10 +860,10 b' class path(unicode):'
860
860
861 # --- Create/delete operations on directories
861 # --- Create/delete operations on directories
862
862
863 def mkdir(self, mode=0777):
863 def mkdir(self, mode=0o777):
864 os.mkdir(self, mode)
864 os.mkdir(self, mode)
865
865
866 def makedirs(self, mode=0777):
866 def makedirs(self, mode=0o777):
867 os.makedirs(self, mode)
867 os.makedirs(self, mode)
868
868
869 def rmdir(self):
869 def rmdir(self):
@@ -879,7 +879,7 b' class path(unicode):'
879 """ Set the access/modified times of this file to the current time.
879 """ Set the access/modified times of this file to the current time.
880 Create the file if it does not exist.
880 Create the file if it does not exist.
881 """
881 """
882 fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0666)
882 fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0o666)
883 os.close(fd)
883 os.close(fd)
884 os.utime(self, None)
884 os.utime(self, None)
885
885
General Comments 0
You need to be logged in to leave comments. Login now