Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e69685

Browse files
committed
Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent f91197c commit 5e69685

48 files changed

Lines changed: 980 additions & 662 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/distutils/builtdist.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,42 @@ version number. This can be changed to another text by using the
329329
The installer file will be written to the "distribution directory" --- normally
330330
:file:`dist/`, but customizable with the :option:`--dist-dir` option.
331331

332+
.. _cross-compile-windows:
333+
334+
Cross-compiling on Windows
335+
==========================
336+
337+
Starting with Python 2.6, distutils is capable of cross-compiling between
338+
Windows platforms. In practice, this means that with the correct tools
339+
installed, you can use a 32bit version of Windows to create 64bit extensions
340+
and vice-versa.
341+
342+
To build for an alternate platform, specify the :option:`--plat-name` option
343+
to the build command. Valid values are currently 'win32', 'win-amd64' and
344+
'win-ia64'. For example, on a 32bit version of Windows, you could execute::
345+
346+
python setup.py build --plat-name=win-amd64
347+
348+
to build a 64bit version of your extension. The Windows Installers also
349+
support this option, so the command::
350+
351+
python setup.py build --plat-name=win-amd64 bdist_wininst
352+
353+
would create a 64bit installation executable on your 32bit version of Windows.
354+
355+
To cross-compile, you must download the Python source code and cross-compile
356+
Python itself for the platform you are targetting - it is not possible from a
357+
binary installtion of Python (as the .lib etc file for other platforms are
358+
not included.) In practice, this means the user of a 32 bit operating
359+
system will need to use Visual Studio 2008 to open the
360+
:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the
361+
"x64" configuration of the 'pythoncore' project before cross-compiling
362+
extensions is possible.
363+
364+
Note that by default, Visual Studio 2008 does not install 64bit compilers or
365+
tools. You may need to reexecute the Visual Studio setup process and select
366+
these tools (using Control Panel->[Add/Remove] Programs is a convenient way to
367+
check or modify your existing install.)
332368

333369
.. _postinstallation-script:
334370

Doc/includes/tzinfo-examples.py

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,31 @@ def first_sunday_on_or_after(dt):
8787
dt += timedelta(days_to_go)
8888
return dt
8989

90-
# In the US, DST starts at 2am (standard time) on the first Sunday in April.
91-
DSTSTART = datetime(1, 4, 1, 2)
92-
# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct.
93-
# which is the first Sunday on or after Oct 25.
94-
DSTEND = datetime(1, 10, 25, 1)
90+
91+
# US DST Rules
92+
#
93+
# This is a simplified (i.e., wrong for a few cases) set of rules for US
94+
# DST start and end times. For a complete and up-to-date set of DST rules
95+
# and timezone definitions, visit the Olson Database (or try pytz):
96+
# http://www.twinsun.com/tz/tz-link.htm
97+
# http://sourceforge.net/projects/pytz/ (might not be up-to-date)
98+
#
99+
# In the US, since 2007, DST starts at 2am (standard time) on the second
100+
# Sunday in March, which is the first Sunday on or after Mar 8.
101+
DSTSTART_2007 = datetime(1, 3, 8, 2)
102+
# and ends at 2am (DST time; 1am standard time) on the first Sunday of Nov.
103+
DSTEND_2007 = datetime(1, 11, 1, 1)
104+
# From 1987 to 2006, DST used to start at 2am (standard time) on the first
105+
# Sunday in April and to end at 2am (DST time; 1am standard time) on the last
106+
# Sunday of October, which is the first Sunday on or after Oct 25.
107+
DSTSTART_1987_2006 = datetime(1, 4, 1, 2)
108+
DSTEND_1987_2006 = datetime(1, 10, 25, 1)
109+
# From 1967 to 1986, DST used to start at 2am (standard time) on the last
110+
# Sunday in April (the one on or after April 24) and to end at 2am (DST time;
111+
# 1am standard time) on the last Sunday of October, which is the first Sunday
112+
# on or after Oct 25.
113+
DSTSTART_1967_1986 = datetime(1, 4, 24, 2)
114+
DSTEND_1967_1986 = DSTEND_1987_2006
95115

96116
class USTimeZone(tzinfo):
97117

@@ -122,9 +142,19 @@ def dst(self, dt):
122142
return ZERO
123143
assert dt.tzinfo is self
124144

125-
# Find first Sunday in April & the last in October.
126-
start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
127-
end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
145+
# Find start and end times for US DST. For years before 1967, return
146+
# ZERO for no DST.
147+
if 2006 < dt.year:
148+
dststart, dstend = DSTSTART_2007, DSTEND_2007
149+
elif 1986 < dt.year < 2007:
150+
dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006
151+
elif 1966 < dt.year < 1987:
152+
dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986
153+
else:
154+
return ZERO
155+
156+
start = first_sunday_on_or_after(dststart.replace(year=dt.year))
157+
end = first_sunday_on_or_after(dstend.replace(year=dt.year))
128158

129159
# Can't compare naive to aware objects, so strip the timezone from
130160
# dt first.

Doc/library/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ tools provided with the operating system to obtain some or all of the
3131
optional components.
3232

3333
In addition to the standard library, there is a growing collection of
34-
over 2500 additional components available from the `Python Package Index
35-
<http://pypi.python.org/pypi>`_.
34+
several thousand components (from individual programs and modules to
35+
packages and entire application development frameworks), available from
36+
the `Python Package Index <http://pypi.python.org/pypi>`_.
3637

3738

3839
.. toctree::

Doc/library/select.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ Edge and Level Trigger Polling (epoll) Objects
113113
+-----------------------+-----------------------------------------------+
114114
| :const:`EPOLLPRI` | Urgent data for read |
115115
+-----------------------+-----------------------------------------------+
116-
| :const:`EPOLLERR` | Error condition happend on the assoc. fd |
116+
| :const:`EPOLLERR` | Error condition happened on the assoc. fd |
117117
+-----------------------+-----------------------------------------------+
118-
| :const:`EPOLLHUP` | Hang up happend on the assoc. fd |
118+
| :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
119119
+-----------------------+-----------------------------------------------+
120120
| :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
121121
| | Level Trigger behavior |

Doc/library/types.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ The module defines the following names:
8686

8787
.. data:: GetSetDescriptorType
8888

89-
The type of objects defined in extension modules with ``PyGetSetDef``, such as
90-
``FrameType.f_locals`` or ``array.array.typecode``. This constant is not
91-
defined in implementations of Python that do not have such extension types, so
92-
for portable code use ``hasattr(types, 'GetSetDescriptorType')``.
89+
The type of objects defined in extension modules with ``PyGetSetDef``, such
90+
as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as
91+
descriptor for object attributes; it has the same purpose as the
92+
:class:`property` type, but for classes defined in extension modules.
9393

9494

9595
.. data:: MemberDescriptorType
9696

97-
The type of objects defined in extension modules with ``PyMemberDef``, such as
98-
``datetime.timedelta.days``. This constant is not defined in implementations of
99-
Python that do not have such extension types, so for portable code use
100-
``hasattr(types, 'MemberDescriptorType')``.
97+
The type of objects defined in extension modules with ``PyMemberDef``, such
98+
as ``datetime.timedelta.days``. This type is used as descriptor for simple C
99+
data members which use standard conversion functions; it has the same purpose
100+
as the :class:`property` type, but for classes defined in extension modules.
101+
In other implementations of Python, this type may be identical to
102+
``GetSetDescriptorType``.

0 commit comments

Comments
 (0)