Merge pull request #128471 from mweinelt/cpython-venv-permissions

cpython: fix permissions on venv activation scripts

authored by Martin Weinelt and committed by GitHub 1c5a8677 fc76765e

+17
+4
pkgs/development/interpreters/python/cpython/default.nix
··· 190 # (since it will do a futile invocation of gcc (!) to find 191 # libuuid, slowing down program startup a lot). 192 (./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch") 193 ] ++ optionals mimetypesSupport [ 194 # Make the mimetypes module refer to the right file 195 ./mimetypes.patch
··· 190 # (since it will do a futile invocation of gcc (!) to find 191 # libuuid, slowing down program startup a lot). 192 (./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch") 193 + # Make sure that the virtualenv activation scripts are 194 + # owner-writable, so venvs can be recreated without permission 195 + # errors. 196 + ./virtualenv-permissions.patch 197 ] ++ optionals mimetypesSupport [ 198 # Make the mimetypes module refer to the right file 199 ./mimetypes.patch
+13
pkgs/development/interpreters/python/cpython/virtualenv-permissions.patch
···
··· 1 + diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py 2 + index caa7285..ad666ac 100644 3 + --- a/Lib/venv/__init__.py 4 + +++ b/Lib/venv/__init__.py 5 + @@ -379,7 +379,7 @@ class EnvBuilder: 6 + if data is not None: 7 + with open(dstfile, 'wb') as f: 8 + f.write(data) 9 + - shutil.copymode(srcfile, dstfile) 10 + + os.chmod(dstfile, 0o644) 11 + 12 + 13 + def create(env_dir, system_site_packages=False, clear=False,