Jim Pattee added the comment:

The problem is not file permissions nor the install. I did some further testing.

The problem actually occurs with the library calls at lines 23 and 25. I 
changed these lines to eliminate the library call by just hard coding the file 
path.

Change from:
line 23:    header_path = libastyle.get_astyle_directory() + "/src/astyle.h"
line 25:    beautifier_path = libastyle.get_astyle_directory() + 
"/src/ASBeautifier.cpp"

Change to:
line 23:    header_path = 
"C:\\Users\\jimp\\ZPythonPermissionError\\Projects/AStyle/src/astyle.h"
line 25:    beautifier_path = 
"C:\\Users\\jimp\\ZPythonPermissionError\\Projects/AStyle/src/ASBeautifier.cpp"

When run with the changes the program worked. The problem is apparently with 
the library call, not the file itself.

Then I changed the same instructions to get the file name using the same 
instructions that the library program used. The library program uses 
“sys.path[0]” to get the directory containing the executed script.

Change to:
line 23:    header_path = sys.path[0] + "/../AStyle/src/astyle.h"
line 25:    beautifier_path = sys.path[0] + "/../AStyle/src/ASBeautifier.cpp"

This also worked.

I want to do some more testing this weekend. I will hopefully have more info on 
Monday. Thanks for your input on this.

Apparently this is not a problem on your PC. I have run this on both Windows 7 
and Windows 8. I get the same results (a Permission Error) on both.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16383>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to