From: Vinay Sajip Date: Sun, 8 Jul 2012 16:50:42 +0000 (+0100) Subject: Closes #15281, #15283: Don't make venv scripts executable, but copy source mode inste... X-Git-Tag: v3.3.0b2~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d378d834971179acf14c3ba019f64eafa9b6473;p=python Closes #15281, #15283: Don't make venv scripts executable, but copy source mode instead, and provide better help for pyvenv. --- diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py index 3d9d3b7e56..38ed54c88a 100644 --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py @@ -316,7 +316,7 @@ class EnvBuilder: data = self.replace_variables(data, context) with open(dstfile, mode) as f: f.write(data) - os.chmod(dstfile, 0o755) + shutil.copymode(srcfile, dstfile) def create(env_dir, system_site_packages=False, clear=False, symlinks=False): @@ -354,7 +354,12 @@ def main(args=None): description='Creates virtual Python ' 'environments in one or ' 'more target ' - 'directories.') + 'directories.', + epilog='Once an environment has been ' + 'created, you may wish to ' + 'activate it, e.g. by ' + 'sourcing an activate script ' + 'in its bin directory.') parser.add_argument('dirs', metavar='ENV_DIR', nargs='+', help='A directory to create the environment in.') parser.add_argument('--system-site-packages', default=False, @@ -368,7 +373,9 @@ def main(args=None): use_symlinks = True parser.add_argument('--symlinks', default=use_symlinks, action='store_true', dest='symlinks', - help="Attempt to symlink rather than copy.") + help='Try to use symlinks rather than copies, ' + 'when symlinks are not the default for ' + 'the platform.') parser.add_argument('--clear', default=False, action='store_true', dest='clear', help='Delete the environment ' 'directory if it already '