diff Lib/test/test_httpservers.py @ 62874:730b728e5aef

Implement #1578269. Patch by Jason R. Coombs. Added Windows support for os.symlink when run on Windows 6.0 or greater, aka Vista. Previous Windows versions will raise NotImplementedError when trying to symlink. Includes numerous test updates and additions to test_os, including a symlink_support module because of the fact that privilege escalation is required in order to run the tests to ensure that the user is able to create symlinks. By default, accounts do not have the required privilege, so the escalation code will have to be exposed later (or documented on how to do so). I'll be following up with that work next. Note that the tests use ctypes, which was agreed on during the PyCon language summit.
author Brian Curtin <brian.curtin@gmail.com>
date Thu, 08 Jul 2010 21:39:08 +0000
parents 493bb4585e38
children 58c22d30f749
line wrap: on
line diff
--- a/Lib/test/test_httpservers.py	Thu Jul 08 21:15:36 2010 +0000
+++ b/Lib/test/test_httpservers.py	Thu Jul 08 21:39:08 2010 +0000
@@ -299,7 +299,7 @@
 
         # The shebang line should be pure ASCII: use symlink if possible.
         # See issue #7668.
-        if hasattr(os, 'symlink'):
+        if support.can_symlink():
             self.pythonexe = os.path.join(self.parent_dir, 'python')
             os.symlink(sys.executable, self.pythonexe)
         else: