“Permission Denied” trying to run Python on Windows 10

As far as I can tell, this was caused by a conflict with the version of Python 3.7 that was recently added into the Windows Store. It looks like this added two “stubs” called python.exe and python3.exe into the %USERPROFILE%\AppData\Local\Microsoft\WindowsApps folder, and in my case, this was inserted before my existing Python executable’s entry in … Read more

How can I set the umask from within java?

You can’t fiddle with the umask directly, since Java is an abstraction and the umask is POSIX-implementation specific. But you have the following API: File f; f.setExecutable(true); f.setReadable(false); f.setWritable(true); There are some more APIs available, check the docs. If you must have direct access to the umask, either do it via JNI and the chmod() … Read more

shutil.rmtree fails on Windows with ‘Access is denied’ [duplicate]

Check this question out: What user do python scripts run as in windows? Apparently the answer is to change the file/folder to not be read-only and then remove it. Here’s onerror() handler from pathutils.py mentioned by @Sridhar Ratnakumar in comments: def onerror(func, path, exc_info): “”” Error handler for “shutil.rmtree“. If the error is due to … Read more

How can I get the Unix permission mask from a file? [duplicate]

os.stat is a wrapper around the stat(2) system call interface. >>> import os >>> from stat import * >>> os.stat(“test.txt”) # returns 10-tupel, you really want the 0th element … posix.stat_result(st_mode=33188, st_ino=57197013, \ st_dev=234881026L, st_nlink=1, st_uid=501, st_gid=20, st_size=0, \ st_atime=1300354697, st_mtime=1300354697, st_ctime=1300354697) >>> os.stat(“test.txt”)[ST_MODE] # this is an int, but we like octal … 33188 … Read more

java.security.AccessControlException: Access denied (java.io.FilePermission

Within your <jre location>\lib\security\java.policy try adding: grant { permission java.security.AllPermission; }; And see if it allows you. If so, you will have to add more granular permissions. See: Java 8 Documentation for java.policy files and http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html