Commits

Vinay Sajip committed 9c345b4

Closes #15281, #15283: Don't make venv scripts executable, but copy source mode instead, and provide better help for pyvenv.

Comments (0)

Files changed (1)

Lib/venv/__init__.py

                     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):
                                          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,
             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 '