Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Permission denied when copying a template from a read-only path #1292
There are two things uncommon about my setup that cause the error.
This is what I get:
What happens is, the built-in theme files get copied with their permissions preserved, so
I’m not really sure what to do with that. Probably, catching the exception and adjusting the permissions would make sense.
Hmm, I'm not sure how we should deal with this either. That said, it is reasonable to expect that a user could have read-only permissions to any files in site-packages. For example, on a system with multiple users, only the root user might have write access to site-packages and therefore permission to install/update Python libs. Just because the user running MkDocs isn't the root user shouldn't mean they can't have access to all of MkDocs' features. So, yeah, this is a bug.
As a workaround, you could create a virtualenv with your user account and install MkDocs in there. Then you would have full access. You just need to remember to "activate" the venv before running MkDocs. Actually, I always run MkDocs from a venv; I don't even have it installed as a system Python lib.
So, it appears that the problem is that we use shutil.copy rather than shutil.copyfile. The difference is that