How to maintain same permissions on python dist-package after upgrade?

dieter dieter at handshake.de
Fri Nov 17 02:32:47 EST 2017


Debraj Manna <subharaj.manna at gmail.com> writes:

> I am using a python package patroni version 1.0 on Ubuntu 14. On doing ls
> -lrt /usr/local/lib/python2.7/dist-packages/ I am seeing the permission
> like below
>
> drwxr-sr-x    4   root   staff 4096 Nov 6 14:29 patroni
> drwxr-sr-x    2   root   staff 4096 Nov 6 14:29 patroni-1.0-py2.7.egg-info
>
> But once I upgrade the patroni via the command sudo pip install patroni
> --upgrade I am seeing the permission of the patroni change after upgrade
>
> drwxr-s---    4   root   staff 4096 Nov 6 15:29 patroni
> drwxr-s---    2   root   staff 4096 Nov 6 15:29 patroni-1.3.6.dist-info
>
> The installation output is attached (sudo-pip-install.txt).
>
> If I don't use sudo and just do pip install patroni --upgrade it fails. The
> output is attached (pip-install.txt).
>
> Can someone let me know :-

Verify the "umask" effective for your "sudo" user, i.e.

       sudo bash
       umask

Should the "umask" result end in "7",
then this may be responsible for the permissions you observe.

On POSIX systems, the "umask" setting effects the permissions of newly
created directories and files.

Use "umask 0002" to change this setting temporarily.




More information about the Python-list mailing list