[issue16383] Python 3.3 Permission Error with User Library on Windows

Zachary Ware report at bugs.python.org
Wed Jul 30 21:37:16 CEST 2014


Zachary Ware added the comment:

Jim, is there any way you could cut down your example to something small and self-contained?  It may be that the process of doing that leads to a problem in your code.  As it is, I cannot reproduce your error, or pick out what might be causing it.  From a brief glance, I have a few suggestions, though:

- Don't use sys.path[0] to determine where the file lives, it's not a reliable indicator.  Try using 'os.path.dirname(__file__)' instead (or 'os.path.dirname(os.path.abspath(__file__))' if __file__ is relative, which should only be the case when passing the filename directly to Python as a relative path).
- Use 'os.path.join()' instead of adding strings to make paths.  Shouldn't matter, but makes things cleaner.
- (Unrelated, but) it's really not very nice to change the display color without changing it back.  On Windows, 'color' affects the entire window, not just your output, and it lasts past the death of your process.

Until you can provide a short (200 lines or less across 5 files or less) reproducer, there's not much we can do, so I'm closing the issue.  If you can provide one, please do so and I'll happily take a look!

----------
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16383>
_______________________________________


More information about the Python-bugs-list mailing list