| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | """distutils.command.bdist_wininst
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Implements the Distutils 'bdist_wininst' command: create a windows installer | 
					
						
							|  |  |  | exe-program."""
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | __revision__ = "$Id$" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-04-17 08:48:32 +00:00
										 |  |  | import sys, os | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | from distutils.core import Command | 
					
						
							| 
									
										
										
										
											2000-08-05 01:31:54 +00:00
										 |  |  | from distutils.util import get_platform | 
					
						
							|  |  |  | from distutils.dir_util import create_tree, remove_tree | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | from distutils.errors import * | 
					
						
							| 
									
										
										
										
											2002-11-22 20:57:20 +00:00
										 |  |  | from distutils.sysconfig import get_python_version | 
					
						
							| 
									
										
										
										
											2002-06-04 20:14:43 +00:00
										 |  |  | from distutils import log | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  | class bdist_wininst(Command): | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-06-28 00:56:20 +00:00
										 |  |  |     description = "create an executable installer for MS Windows" | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-03-16 20:57:37 +00:00
										 |  |  |     user_options = [('bdist-dir=', None, | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |                      "temporary directory for creating the distribution"), | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |                     ('plat-name=', 'p', | 
					
						
							|  |  |  |                      "platform name to embed in generated filenames " | 
					
						
							|  |  |  |                      "(default: %s)" % get_platform()), | 
					
						
							| 
									
										
										
										
											2000-09-16 15:56:32 +00:00
										 |  |  |                     ('keep-temp', 'k', | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |                      "keep the pseudo-installation tree around after " + | 
					
						
							|  |  |  |                      "creating the distribution archive"), | 
					
						
							| 
									
										
										
										
											2004-07-06 19:23:27 +00:00
										 |  |  |                     ('target-version=', None, | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |                      "require a specific python version" + | 
					
						
							| 
									
										
										
										
											2000-08-26 02:40:10 +00:00
										 |  |  |                      " on the target system"), | 
					
						
							| 
									
										
										
										
											2000-09-07 15:59:22 +00:00
										 |  |  |                     ('no-target-compile', 'c', | 
					
						
							|  |  |  |                      "do not compile .py to .pyc on the target system"), | 
					
						
							|  |  |  |                     ('no-target-optimize', 'o', | 
					
						
							| 
									
										
										
										
											2000-09-29 11:36:55 +00:00
										 |  |  |                      "do not compile .py to .pyo (optimized)" | 
					
						
							|  |  |  |                      "on the target system"), | 
					
						
							| 
									
										
										
										
											2000-07-05 03:08:55 +00:00
										 |  |  |                     ('dist-dir=', 'd', | 
					
						
							|  |  |  |                      "directory to put final built distributions in"), | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |                     ('bitmap=', 'b', | 
					
						
							|  |  |  |                      "bitmap to use for the installer instead of python-powered logo"), | 
					
						
							|  |  |  |                     ('title=', 't', | 
					
						
							|  |  |  |                      "title to display on the installer background instead of default"), | 
					
						
							| 
									
										
										
										
											2002-01-12 11:27:42 +00:00
										 |  |  |                     ('skip-build', None, | 
					
						
							|  |  |  |                      "skip rebuilding everything (for testing/debugging)"), | 
					
						
							| 
									
										
										
										
											2002-02-20 08:01:19 +00:00
										 |  |  |                     ('install-script=', None, | 
					
						
							| 
									
										
										
										
											2002-11-05 10:06:19 +00:00
										 |  |  |                      "basename of installation script to be run after" | 
					
						
							|  |  |  |                      "installation or before deinstallation"), | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |                     ('pre-install-script=', None, | 
					
						
							|  |  |  |                      "Fully qualified filename of a script to be run before " | 
					
						
							|  |  |  |                      "any files are installed.  This script need not be in the " | 
					
						
							|  |  |  |                      "distribution"), | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |                    ] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-03-21 23:44:01 +00:00
										 |  |  |     boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize', | 
					
						
							|  |  |  |                        'skip-build'] | 
					
						
							| 
									
										
										
										
											2000-09-25 01:41:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def initialize_options(self): | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         self.bdist_dir = None | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |         self.plat_name = None | 
					
						
							| 
									
										
										
										
											2000-09-16 15:56:32 +00:00
										 |  |  |         self.keep_temp = 0 | 
					
						
							| 
									
										
										
										
											2000-09-07 15:59:22 +00:00
										 |  |  |         self.no_target_compile = 0 | 
					
						
							|  |  |  |         self.no_target_optimize = 0 | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         self.target_version = None | 
					
						
							| 
									
										
										
										
											2000-07-05 03:08:55 +00:00
										 |  |  |         self.dist_dir = None | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         self.bitmap = None | 
					
						
							|  |  |  |         self.title = None | 
					
						
							| 
									
										
										
										
											2002-01-12 11:27:42 +00:00
										 |  |  |         self.skip_build = 0 | 
					
						
							| 
									
										
										
										
											2002-02-20 08:01:19 +00:00
										 |  |  |         self.install_script = None | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |         self.pre_install_script = None | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def finalize_options(self): | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         if self.bdist_dir is None: | 
					
						
							|  |  |  |             bdist_base = self.get_finalized_command('bdist').bdist_base | 
					
						
							|  |  |  |             self.bdist_dir = os.path.join(bdist_base, 'wininst') | 
					
						
							|  |  |  |         if not self.target_version: | 
					
						
							|  |  |  |             self.target_version = "" | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |         if not self.skip_build and self.distribution.has_ext_modules(): | 
					
						
							| 
									
										
										
										
											2002-11-14 01:44:35 +00:00
										 |  |  |             short_version = get_python_version() | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |             if self.target_version and self.target_version != short_version: | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |                 raise DistutilsOptionError( | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |                       "target version can only be %s, or the '--skip_build'" \ | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |                       " option must be specified" % (short_version,)) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |             self.target_version = short_version | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |         self.set_undefined_options('bdist', | 
					
						
							|  |  |  |                                    ('dist_dir', 'dist_dir'), | 
					
						
							|  |  |  |                                    ('plat_name', 'plat_name'), | 
					
						
							|  |  |  |                                   ) | 
					
						
							| 
									
										
										
										
											2000-07-05 03:08:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-11-05 10:06:19 +00:00
										 |  |  |         if self.install_script: | 
					
						
							|  |  |  |             for script in self.distribution.scripts: | 
					
						
							|  |  |  |                 if self.install_script == os.path.basename(script): | 
					
						
							|  |  |  |                     break | 
					
						
							|  |  |  |             else: | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |                 raise DistutilsOptionError( | 
					
						
							|  |  |  |                       "install_script '%s' not found in scripts" | 
					
						
							|  |  |  |                       % self.install_script) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def run(self): | 
					
						
							| 
									
										
										
										
											2000-09-01 01:44:45 +00:00
										 |  |  |         if (sys.platform != "win32" and | 
					
						
							|  |  |  |             (self.distribution.has_ext_modules() or | 
					
						
							|  |  |  |              self.distribution.has_c_libraries())): | 
					
						
							| 
									
										
										
										
											2000-09-07 15:59:22 +00:00
										 |  |  |             raise DistutilsPlatformError \ | 
					
						
							| 
									
										
										
										
											2000-09-01 01:44:45 +00:00
										 |  |  |                   ("distribution contains extensions and/or C libraries; " | 
					
						
							|  |  |  |                    "must be compiled on a Windows 32 platform") | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-01-12 11:27:42 +00:00
										 |  |  |         if not self.skip_build: | 
					
						
							|  |  |  |             self.run_command('build') | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-12 17:23:58 +00:00
										 |  |  |         install = self.reinitialize_command('install', reinit_subcommands=1) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         install.root = self.bdist_dir | 
					
						
							| 
									
										
										
										
											2002-01-12 11:27:42 +00:00
										 |  |  |         install.skip_build = self.skip_build | 
					
						
							| 
									
										
										
										
											2002-04-09 14:14:38 +00:00
										 |  |  |         install.warn_dir = 0 | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |         install.plat_name = self.plat_name | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-06-28 00:56:20 +00:00
										 |  |  |         install_lib = self.reinitialize_command('install_lib') | 
					
						
							| 
									
										
										
										
											2000-08-26 02:40:10 +00:00
										 |  |  |         # we do not want to include pyc or pyo files | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         install_lib.compile = 0 | 
					
						
							|  |  |  |         install_lib.optimize = 0 | 
					
						
							| 
									
										
										
										
											2004-07-18 06:16:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-27 21:54:33 +00:00
										 |  |  |         if self.distribution.has_ext_modules(): | 
					
						
							|  |  |  |             # If we are building an installer for a Python version other | 
					
						
							|  |  |  |             # than the one we are currently running, then we need to ensure | 
					
						
							|  |  |  |             # our build_lib reflects the other Python version rather than ours. | 
					
						
							|  |  |  |             # Note that for target_version!=sys.version, we must have skipped the | 
					
						
							|  |  |  |             # build step, so there is no issue with enforcing the build of this | 
					
						
							|  |  |  |             # version. | 
					
						
							|  |  |  |             target_version = self.target_version | 
					
						
							|  |  |  |             if not target_version: | 
					
						
							|  |  |  |                 assert self.skip_build, "Should have already checked this" | 
					
						
							|  |  |  |                 target_version = sys.version[0:3] | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |             plat_specifier = ".%s-%s" % (self.plat_name, target_version) | 
					
						
							| 
									
										
										
										
											2004-10-27 21:54:33 +00:00
										 |  |  |             build = self.get_finalized_command('build') | 
					
						
							|  |  |  |             build.build_lib = os.path.join(build.build_base, | 
					
						
							|  |  |  |                                            'lib' + plat_specifier) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-09-05 13:00:40 +00:00
										 |  |  |         # Use a custom scheme for the zip-file, because we have to decide | 
					
						
							|  |  |  |         # at installation time which scheme to use. | 
					
						
							|  |  |  |         for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'): | 
					
						
							| 
									
										
										
										
											2007-04-17 08:48:32 +00:00
										 |  |  |             value = key.upper() | 
					
						
							| 
									
										
										
										
											2001-09-05 13:00:40 +00:00
										 |  |  |             if key == 'headers': | 
					
						
							|  |  |  |                 value = value + '/Include/$dist_name' | 
					
						
							|  |  |  |             setattr(install, | 
					
						
							|  |  |  |                     'install_' + key, | 
					
						
							|  |  |  |                     value) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-06-04 20:14:43 +00:00
										 |  |  |         log.info("installing to %s", self.bdist_dir) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         install.ensure_finalized() | 
					
						
							| 
									
										
										
										
											2001-09-05 13:00:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # avoid warning of 'install_lib' about installing | 
					
						
							|  |  |  |         # into a directory not in sys.path | 
					
						
							|  |  |  |         sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB')) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         install.run() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-09-05 13:00:40 +00:00
										 |  |  |         del sys.path[0] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         # And make an archive relative to the root of the | 
					
						
							|  |  |  |         # pseudo-installation tree. | 
					
						
							| 
									
										
										
										
											2002-10-15 14:51:58 +00:00
										 |  |  |         from tempfile import mktemp | 
					
						
							|  |  |  |         archive_basename = mktemp() | 
					
						
							| 
									
										
										
										
											2000-07-05 03:08:55 +00:00
										 |  |  |         fullname = self.distribution.get_fullname() | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         arcname = self.make_archive(archive_basename, "zip", | 
					
						
							| 
									
										
										
										
											2001-09-05 13:00:40 +00:00
										 |  |  |                                     root_dir=self.bdist_dir) | 
					
						
							| 
									
										
										
										
											2001-12-18 20:13:40 +00:00
										 |  |  |         # create an exe containing the zip-file | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         self.create_exe(arcname, fullname, self.bitmap) | 
					
						
							| 
									
										
										
										
											2005-03-23 18:54:36 +00:00
										 |  |  |         if self.distribution.has_ext_modules(): | 
					
						
							|  |  |  |             pyversion = get_python_version() | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             pyversion = 'any' | 
					
						
							|  |  |  |         self.distribution.dist_files.append(('bdist_wininst', pyversion, | 
					
						
							| 
									
										
										
										
											2005-03-22 22:23:29 +00:00
										 |  |  |                                              self.get_installer_filename(fullname))) | 
					
						
							| 
									
										
										
										
											2001-12-18 20:13:40 +00:00
										 |  |  |         # remove the zip-file again | 
					
						
							| 
									
										
										
										
											2002-06-04 20:14:43 +00:00
										 |  |  |         log.debug("removing temporary file '%s'", arcname) | 
					
						
							| 
									
										
										
										
											2002-10-15 14:51:58 +00:00
										 |  |  |         os.remove(arcname) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-09-16 15:56:32 +00:00
										 |  |  |         if not self.keep_temp: | 
					
						
							| 
									
										
										
										
											2002-06-04 20:14:43 +00:00
										 |  |  |             remove_tree(self.bdist_dir, dry_run=self.dry_run) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def get_inidata(self): | 
					
						
							| 
									
										
										
										
											2000-09-01 01:44:45 +00:00
										 |  |  |         # Return data describing the installation. | 
					
						
							|  |  |  |         lines = [] | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         metadata = self.distribution.metadata | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |         # Write the [metadata] section. | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         lines.append("[metadata]") | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-06-28 00:56:20 +00:00
										 |  |  |         # 'info' will be displayed in the installer's dialog box, | 
					
						
							|  |  |  |         # describing the items to be installed. | 
					
						
							| 
									
										
										
										
											2000-08-27 20:44:13 +00:00
										 |  |  |         info = (metadata.long_description or '') + '\n' | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |         # Escape newline characters | 
					
						
							|  |  |  |         def escape(s): | 
					
						
							| 
									
										
										
										
											2007-04-17 08:48:32 +00:00
										 |  |  |             return s.replace("\n", "\\n") | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-10-05 20:40:48 +00:00
										 |  |  |         for name in ["author", "author_email", "description", "maintainer", | 
					
						
							|  |  |  |                      "maintainer_email", "name", "url", "version"]: | 
					
						
							|  |  |  |             data = getattr(metadata, name, "") | 
					
						
							|  |  |  |             if data: | 
					
						
							|  |  |  |                 info = info + ("\n    %s: %s" % \ | 
					
						
							| 
									
										
										
										
											2007-04-17 08:48:32 +00:00
										 |  |  |                                (name.capitalize(), escape(data))) | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |                 lines.append("%s=%s" % (name, escape(data))) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # The [setup] section contains entries controlling | 
					
						
							|  |  |  |         # the installer runtime. | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         lines.append("\n[Setup]") | 
					
						
							| 
									
										
										
										
											2002-02-20 08:01:19 +00:00
										 |  |  |         if self.install_script: | 
					
						
							|  |  |  |             lines.append("install_script=%s" % self.install_script) | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |         lines.append("info=%s" % escape(info)) | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         lines.append("target_compile=%d" % (not self.no_target_compile)) | 
					
						
							|  |  |  |         lines.append("target_optimize=%d" % (not self.no_target_optimize)) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  |         if self.target_version: | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |             lines.append("target_version=%s" % self.target_version) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         title = self.title or self.distribution.get_fullname() | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |         lines.append("title=%s" % escape(title)) | 
					
						
							| 
									
										
										
										
											2000-09-09 21:15:12 +00:00
										 |  |  |         import time | 
					
						
							|  |  |  |         import distutils | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |         build_info = "Built %s with distutils-%s" % \ | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |                      (time.ctime(time.time()), distutils.__version__) | 
					
						
							|  |  |  |         lines.append("build_info=%s" % build_info) | 
					
						
							| 
									
										
										
										
											2007-04-17 08:48:32 +00:00
										 |  |  |         return "\n".join(lines) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def create_exe(self, arcname, fullname, bitmap=None): | 
					
						
							| 
									
										
										
										
											2000-09-01 01:44:45 +00:00
										 |  |  |         import struct | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         self.mkpath(self.dist_dir) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-09-01 01:44:45 +00:00
										 |  |  |         cfgdata = self.get_inidata() | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-23 19:58:28 +00:00
										 |  |  |         installer_name = self.get_installer_filename(fullname) | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         self.announce("creating %s" % installer_name) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         if bitmap: | 
					
						
							|  |  |  |             bitmapdata = open(bitmap, "rb").read() | 
					
						
							|  |  |  |             bitmaplen = len(bitmapdata) | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             bitmaplen = 0 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         file = open(installer_name, "wb") | 
					
						
							|  |  |  |         file.write(self.get_exe_bytes()) | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         if bitmap: | 
					
						
							|  |  |  |             file.write(bitmapdata) | 
					
						
							| 
									
										
										
										
											2001-12-06 21:01:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  |         # Convert cfgdata from unicode to ascii, mbcs encoded | 
					
						
							| 
									
										
										
										
											2007-06-11 21:38:39 +00:00
										 |  |  |         if isinstance(cfgdata, str): | 
					
						
							|  |  |  |             cfgdata = cfgdata.encode("mbcs") | 
					
						
							| 
									
										
										
										
											2004-07-23 19:44:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-02-20 14:43:21 +00:00
										 |  |  |         # Append the pre-install script | 
					
						
							|  |  |  |         cfgdata = cfgdata + "\0" | 
					
						
							|  |  |  |         if self.pre_install_script: | 
					
						
							|  |  |  |             script_data = open(self.pre_install_script, "r").read() | 
					
						
							|  |  |  |             cfgdata = cfgdata + script_data + "\n\0" | 
					
						
							| 
									
										
										
										
											2004-02-20 19:38:50 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             # empty pre-install script | 
					
						
							|  |  |  |             cfgdata = cfgdata + "\0" | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         file.write(cfgdata) | 
					
						
							| 
									
										
										
										
											2004-07-19 09:45:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # The 'magic number' 0x1234567B is used to make sure that the | 
					
						
							|  |  |  |         # binary layout of 'cfgdata' is what the wininst.exe binary | 
					
						
							|  |  |  |         # expects.  If the layout changes, increment that number, make | 
					
						
							|  |  |  |         # the corresponding changes to the wininst.exe sources, and | 
					
						
							|  |  |  |         # recompile them. | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |         header = struct.pack("<iii", | 
					
						
							| 
									
										
										
										
											2004-07-19 09:45:46 +00:00
										 |  |  |                              0x1234567B,       # tag | 
					
						
							| 
									
										
										
										
											2001-02-19 09:20:30 +00:00
										 |  |  |                              len(cfgdata),     # length | 
					
						
							|  |  |  |                              bitmaplen,        # number of bytes in bitmap | 
					
						
							|  |  |  |                              ) | 
					
						
							| 
									
										
										
										
											2000-09-30 18:27:54 +00:00
										 |  |  |         file.write(header) | 
					
						
							|  |  |  |         file.write(open(arcname, "rb").read()) | 
					
						
							| 
									
										
										
										
											2000-06-27 01:24:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-23 19:58:28 +00:00
										 |  |  |     def get_installer_filename(self, fullname): | 
					
						
							|  |  |  |         # Factored out to allow overriding in subclasses | 
					
						
							|  |  |  |         if self.target_version: | 
					
						
							|  |  |  |             # if we create an installer for a specific python version, | 
					
						
							|  |  |  |             # it's better to include this in the name | 
					
						
							|  |  |  |             installer_name = os.path.join(self.dist_dir, | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |                                           "%s.%s-py%s.exe" % | 
					
						
							|  |  |  |                                            (fullname, self.plat_name, self.target_version)) | 
					
						
							| 
									
										
										
										
											2004-07-23 19:58:28 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             installer_name = os.path.join(self.dist_dir, | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |                                           "%s.%s.exe" % (fullname, self.plat_name)) | 
					
						
							| 
									
										
										
										
											2004-08-17 10:15:07 +00:00
										 |  |  |         return installer_name | 
					
						
							| 
									
										
										
										
											2004-07-23 19:58:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-30 03:52:21 +00:00
										 |  |  |     def get_exe_bytes(self): | 
					
						
							| 
									
										
										
										
											2004-02-20 19:38:50 +00:00
										 |  |  |         from distutils.msvccompiler import get_build_version | 
					
						
							| 
									
										
										
										
											2004-07-06 19:23:27 +00:00
										 |  |  |         # If a target-version other than the current version has been | 
					
						
							|  |  |  |         # specified, then using the MSVC version from *this* build is no good. | 
					
						
							|  |  |  |         # Without actually finding and executing the target version and parsing | 
					
						
							|  |  |  |         # its sys.version, we just hard-code our knowledge of old versions. | 
					
						
							|  |  |  |         # NOTE: Possible alternative is to allow "--target-version" to | 
					
						
							|  |  |  |         # specify a Python executable rather than a simple version string. | 
					
						
							|  |  |  |         # We can then execute this program to obtain any info we need, such | 
					
						
							|  |  |  |         # as the real sys.version string for the build. | 
					
						
							|  |  |  |         cur_version = get_python_version() | 
					
						
							|  |  |  |         if self.target_version and self.target_version != cur_version: | 
					
						
							|  |  |  |             # If the target version is *later* than us, then we assume they | 
					
						
							|  |  |  |             # use what we use | 
					
						
							|  |  |  |             # string compares seem wrong, but are what sysconfig.py itself uses | 
					
						
							|  |  |  |             if self.target_version > cur_version: | 
					
						
							|  |  |  |                 bv = get_build_version() | 
					
						
							|  |  |  |             else: | 
					
						
							|  |  |  |                 if self.target_version < "2.4": | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |                     bv = 6.0 | 
					
						
							| 
									
										
										
										
											2004-07-06 19:23:27 +00:00
										 |  |  |                 else: | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |                     bv = 7.1 | 
					
						
							| 
									
										
										
										
											2004-07-06 19:23:27 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             # for current version - use authoritative check. | 
					
						
							|  |  |  |             bv = get_build_version() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-02-20 19:38:50 +00:00
										 |  |  |         # wininst-x.y.exe is in the same directory as this file | 
					
						
							| 
									
										
										
										
											2002-11-22 21:08:34 +00:00
										 |  |  |         directory = os.path.dirname(__file__) | 
					
						
							| 
									
										
										
										
											2004-02-20 19:38:50 +00:00
										 |  |  |         # we must use a wininst-x.y.exe built with the same C compiler | 
					
						
							|  |  |  |         # used for python.  XXX What about mingw, borland, and so on? | 
					
						
							| 
									
										
											  
											
												Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r62194 | jeffrey.yasskin | 2008-04-07 01:04:28 +0200 (Mon, 07 Apr 2008) | 7 lines
  Add enough debugging information to diagnose failures where the
  HandlerBException is ignored, and fix one such problem, where it was thrown
  during the __del__ method of the previous Popen object.
  We may want to find a better way of printing verbose information so it's not
  spammy when the test passes.
........
  r62197 | mark.hammond | 2008-04-07 03:53:39 +0200 (Mon, 07 Apr 2008) | 2 lines
  Issue #2513: enable 64bit cross compilation on windows.
........
  r62198 | mark.hammond | 2008-04-07 03:59:40 +0200 (Mon, 07 Apr 2008) | 2 lines
  correct heading underline for new "Cross-compiling on Windows" section
........
  r62204 | gregory.p.smith | 2008-04-07 08:33:21 +0200 (Mon, 07 Apr 2008) | 4 lines
  Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
  within the standard library.  These modules use PyFile_AsFile and later
  release the GIL while operating on the previously returned FILE*.
........
  r62205 | mark.summerfield | 2008-04-07 09:39:23 +0200 (Mon, 07 Apr 2008) | 4 lines
  changed "2500 components" to "several thousand" since the number keeps
  growning:-)
........
  r62214 | georg.brandl | 2008-04-07 20:51:59 +0200 (Mon, 07 Apr 2008) | 2 lines
  #2525: update timezone info examples in the docs.
........
  r62219 | andrew.kuchling | 2008-04-08 01:57:07 +0200 (Tue, 08 Apr 2008) | 1 line
  Write PEP 3127 section; add items
........
  r62220 | andrew.kuchling | 2008-04-08 01:57:21 +0200 (Tue, 08 Apr 2008) | 1 line
  Typo fix
........
  r62221 | andrew.kuchling | 2008-04-08 03:33:10 +0200 (Tue, 08 Apr 2008) | 1 line
  Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit
........
  r62227 | andrew.kuchling | 2008-04-08 23:22:53 +0200 (Tue, 08 Apr 2008) | 1 line
  Add items
........
  r62229 | amaury.forgeotdarc | 2008-04-08 23:27:42 +0200 (Tue, 08 Apr 2008) | 7 lines
  Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
  suite as a side-effect of importing the module.
  - in test_capi, a thread tried to import other modules
  - re.compile() imported sre_parse again on every call.
........
  r62230 | amaury.forgeotdarc | 2008-04-08 23:51:57 +0200 (Tue, 08 Apr 2008) | 2 lines
  Prevent an error when inspect.isabstract() is called with something else than a new-style class.
........
  r62231 | amaury.forgeotdarc | 2008-04-09 00:07:05 +0200 (Wed, 09 Apr 2008) | 8 lines
  Issue 2408: remove the _types module
  It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
  when they can easily be obtained with python code.
  These expressions even work with Jython.
  I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
  at least this change makes it simpler.
........
  r62233 | amaury.forgeotdarc | 2008-04-09 01:10:07 +0200 (Wed, 09 Apr 2008) | 2 lines
  Add a NEWS entry for previous checkin
........
  r62234 | trent.nelson | 2008-04-09 01:47:30 +0200 (Wed, 09 Apr 2008) | 37 lines
  - Issue #2550: The approach used by client/server code for obtaining ports
    to listen on in network-oriented tests has been refined in an effort to
    facilitate running multiple instances of the entire regression test suite
    in parallel without issue.  test_support.bind_port() has been fixed such
    that it will always return a unique port -- which wasn't always the case
    with the previous implementation, especially if socket options had been
    set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
    new implementation of bind_port() will actually raise an exception if it
    is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
    SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
    will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
    This currently only applies to Windows.  This option prevents any other
    sockets from binding to the host/port we've bound to, thus removing the
    possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
    that occurs when a second SOCK_STREAM socket binds and accepts to a
    host/port that's already been bound by another socket.  The optional
    preferred port parameter to bind_port() has been removed.  Under no
    circumstances should tests be hard coding ports!
    test_support.find_unused_port() has also been introduced, which will pass
    a temporary socket object to bind_port() in order to obtain an unused port.
    The temporary socket object is then closed and deleted, and the port is
    returned.  This method should only be used for obtaining an unused port
    in order to pass to an external program (i.e. the -accept [port] argument
    to openssl's s_server mode) or as a parameter to a server-oriented class
    that doesn't give you direct access to the underlying socket used.
    Finally, test_support.HOST has been introduced, which should be used for
    the host argument of any relevant socket calls (i.e. bind and connect).
    The following tests were updated to following the new conventions:
      test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
      test_poplib, test_ftplib, test_telnetlib, test_socketserver,
      test_asynchat and test_socket_ssl.
    It is now possible for multiple instances of the regression test suite to
    run in parallel without issue.
........
  r62235 | gregory.p.smith | 2008-04-09 02:25:17 +0200 (Wed, 09 Apr 2008) | 3 lines
  Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
  It tried to allocate negative or zero memory.  That fails.
........
  r62237 | trent.nelson | 2008-04-09 02:34:53 +0200 (Wed, 09 Apr 2008) | 1 line
  Fix typo with regards to self.PORT shadowing class variables with the same name.
........
  r62238 | andrew.kuchling | 2008-04-09 03:08:32 +0200 (Wed, 09 Apr 2008) | 1 line
  Add items
........
  r62239 | jerry.seutter | 2008-04-09 07:07:58 +0200 (Wed, 09 Apr 2008) | 1 line
  Changed test so it no longer runs as a side effect of importing.
........
											
										 
											2008-04-09 08:37:03 +00:00
										 |  |  |         if self.plat_name == 'win32': | 
					
						
							|  |  |  |             sfix = '' | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             sfix = self.plat_name[3:] # strip 'win' - leaves eg '-amd64' | 
					
						
							|  |  |  |         filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix)) | 
					
						
							| 
									
										
										
										
											2002-11-22 21:08:34 +00:00
										 |  |  |         return open(filename, "rb").read() |