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

Skip to content

Commit d69fe2a

Browse files
committed
Merged revisions 77712,77740-77741,77756,77886,77902,77936 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r77712 | tarek.ziade | 2010-01-23 11:52:57 -0600 (Sat, 23 Jan 2010) | 1 line fixed the 64bits tests for get_platform() - mac osx ........ r77740 | benjamin.peterson | 2010-01-24 21:58:21 -0600 (Sun, 24 Jan 2010) | 1 line compare types with is not == ........ r77741 | facundo.batista | 2010-01-25 00:15:01 -0600 (Mon, 25 Jan 2010) | 3 lines Added a note about Event.is_set() syntax being new to 2.6 ........ r77756 | tarek.ziade | 2010-01-26 11:20:37 -0600 (Tue, 26 Jan 2010) | 1 line fixed bdist_msi imports and added a test module for distutils.command.bdist_msi ........ r77886 | benjamin.peterson | 2010-01-31 12:09:34 -0600 (Sun, 31 Jan 2010) | 1 line move distutils.rst to different toc ........ r77902 | andrew.kuchling | 2010-01-31 20:04:26 -0600 (Sun, 31 Jan 2010) | 1 line Add various items ........ r77936 | andrew.kuchling | 2010-02-02 20:19:14 -0600 (Tue, 02 Feb 2010) | 1 line Add various items ........
1 parent f044812 commit d69fe2a

8 files changed

Lines changed: 117 additions & 38 deletions

File tree

Doc/library/language.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ These modules include:
2626
compileall.rst
2727
dis.rst
2828
pickletools.rst
29-
distutils.rst

Doc/library/python.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ overview:
2525
inspect.rst
2626
site.rst
2727
fpectl.rst
28+
distutils.rst

Doc/library/threading.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ An event object manages an internal flag that can be set to true with the
647647

648648
Return true if and only if the internal flag is true.
649649

650+
.. versionchanged:: 2.6
651+
The ``is_set()`` syntax is new.
652+
650653
.. method:: set()
651654

652655
Set the internal flag to true. All threads waiting for it to become true

Doc/whatsnew/2.7.rst

Lines changed: 83 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:Release: |release|
77
:Date: |today|
88

9-
.. Fix accents on Kristjan Valur Jonsson, Fuerstenau, Tarek Ziade.
9+
.. Fix accents on Kristjan Valur Jonsson, Fuerstenau
1010
1111
.. $Id$
1212
Rules for maintenance:
@@ -53,6 +53,11 @@ This article explains the new features in Python 2.7. The final
5353
release of 2.7 is currently scheduled for June 2010; the detailed
5454
schedule is described in :pep:`373`.
5555

56+
Python 2.7 is planned to be the last major release in the 2.x series.
57+
Though more major releases have not been absolutely ruled out, it's
58+
likely that the 2.7 release will have an extended period of
59+
maintenance compared to earlier 2.x versions.
60+
5661
.. Compare with previous release in 2 - 3 sentences here.
5762
add hyperlink when the documentation becomes available online.
5863
@@ -458,10 +463,12 @@ Several performance enhancements have been added:
458463
conversion function that supports arbitrary bases.
459464
(Patch by Gawain Bolton; :issue:`6713`.)
460465

461-
* The :meth:`rindex`, :meth:`rpartition`, and :meth:`rsplit` methods
462-
of string objects now uses a fast reverse-search algorithm instead of
463-
a character-by-character scan. This is often faster by a factor of 10.
464-
(Added by Florent Xicluna; :issue:`7462`.)
466+
* The :meth:`split`, :meth:`replace`, :meth:`rindex`,
467+
:meth:`rpartition`, and :meth:`rsplit` methods of string-like types
468+
(strings, Unicode strings, and :class:`bytearray` objects) now use a
469+
fast reverse-search algorithm instead of a character-by-character
470+
scan. This is sometimes faster by a factor of 10. (Added by
471+
Florent Xicluna; :issue:`7462` and :issue:`7622`.)
465472

466473
* The :mod:`pickle` and :mod:`cPickle` modules now automatically
467474
intern the strings used for attribute names, reducing memory usage
@@ -585,11 +592,16 @@ changes, or look through the Subversion logs for all the details.
585592
left-alignment. This has been changed to right-alignment, which seems
586593
more sensible for numeric types. (Changed by Mark Dickinson; :issue:`6857`.)
587594

588-
* Distutils is being more actively developed, thanks to Tarek Ziade
589-
who has taken over maintenance of the package. A new
590-
:file:`setup.py` subcommand, ``check``, will
591-
check that the arguments being passed to the :func:`setup` function
592-
are complete and correct (:issue:`5732`).
595+
* Distutils is being more actively developed, thanks to Tarek Ziadé
596+
who has taken over maintenance of the package, so there are a number
597+
of fixes and improvments.
598+
599+
A new :file:`setup.py` subcommand, ``check``, will check that the
600+
arguments being passed to the :func:`setup` function are complete
601+
and correct (:issue:`5732`).
602+
603+
Byte-compilation by the ``install_lib`` subcommand is now only done
604+
if the ``sys.dont_write_bytecode`` setting allows it (:issue:`7071`).
593605

594606
:func:`distutils.sdist.add_defaults` now uses
595607
*package_dir* and *data_files* to create the MANIFEST file.
@@ -601,7 +613,7 @@ changes, or look through the Subversion logs for all the details.
601613
It is no longer mandatory to store clear-text passwords in the
602614
:file:`.pypirc` file when registering and uploading packages to PyPI. As long
603615
as the username is present in that file, the :mod:`distutils` package will
604-
prompt for the password if not present. (Added by Tarek Ziade,
616+
prompt for the password if not present. (Added by Tarek Ziadé,
605617
based on an initial contribution by Nathan Van Gheem; :issue:`4394`.)
606618

607619
A Distutils setup can now specify that a C extension is optional by
@@ -614,7 +626,7 @@ changes, or look through the Subversion logs for all the details.
614626
:meth:`read_pkg_file` method will read the contents of a package's
615627
:file:`PKG-INFO` metadata file. For an example of its use, see
616628
:ref:`reading-metadata`.
617-
(Contributed by Tarek Ziade; :issue:`7457`.)
629+
(Contributed by Tarek Ziadé; :issue:`7457`.)
618630

619631
:file:`setup.py` files will now accept a :option:`--no-user-cfg` switch
620632
to skip reading the :file:`~/.pydistutils.cfg` file. (Suggested by
@@ -643,6 +655,10 @@ changes, or look through the Subversion logs for all the details.
643655
recorded in a gzipped file by providing an optional timestamp to
644656
the constructor. (Contributed by Jacques Frechet; :issue:`4272`.)
645657

658+
Files in gzip format can be padded with trailing zero bytes; the
659+
:mod:`gzip` module will now consume these trailing bytes. (Fixed by
660+
Tadek Pietraszek and Brian Curtin; :issue:`2846`.)
661+
646662
* The default :class:`HTTPResponse` class used by the :mod:`httplib` module now
647663
supports buffering, resulting in much faster reading of HTTP responses.
648664
(Contributed by Kristjan Valur Jonsson; :issue:`4879`.)
@@ -662,7 +678,9 @@ changes, or look through the Subversion logs for all the details.
662678

663679
The :class:`io.FileIO` class now raises an :exc:`OSError` when passed
664680
an invalid file descriptor. (Implemented by Benjamin Peterson;
665-
:issue:`4991`.)
681+
:issue:`4991`.) The :meth:`truncate` method now preserves the
682+
file position; previously it would change the file position to the
683+
end of the new file. (Fixed by Pascal Chambon; :issue:`6939`.)
666684

667685
* New function: ``itertools.compress(data, selectors)`` takes two
668686
iterators. Elements of *data* are returned if the corresponding
@@ -718,6 +736,14 @@ changes, or look through the Subversion logs for all the details.
718736
passed to the callable.
719737
(Contributed by lekma; :issue:`5585`.)
720738

739+
The :class:`Pool` class, which controls a pool of worker processes,
740+
now has an optional *maxtasksperchild* parameter. Worker processes
741+
will perform the specified number of tasks and then exit, causing the
742+
:class:`Pool` to start a new worker. This is useful if tasks may leak
743+
memory or other resources, or if some tasks will cause the worker to
744+
become very large.
745+
(Contributed by Charles Cazabon; :issue:`6963`.)
746+
721747
* The :mod:`nntplib` module now supports IPv6 addresses.
722748
(Contributed by Derek Morr; :issue:`1664`.)
723749

@@ -730,6 +756,10 @@ changes, or look through the Subversion logs for all the details.
730756
contributed by Travis H.; :issue:`6508`. Support for initgroups added
731757
by Jean-Paul Calderone; :issue:`7333`.)
732758

759+
The :func:`normpath` function now preserves Unicode; if its input path
760+
is a Unicode string, the return value is also a Unicode string.
761+
(Fixed by Matt Giuca; :issue:`5827`.)
762+
733763
* The :mod:`pydoc` module now has help for the various symbols that Python
734764
uses. You can now do ``help('<<')`` or ``help('@')``, for example.
735765
(Contributed by David Laban; :issue:`4739`.)
@@ -753,7 +783,7 @@ changes, or look through the Subversion logs for all the details.
753783
:func:`getuserbase` returns the value of the :envvar:`USER_BASE`
754784
environment variable, giving the path to a directory that can be used
755785
to store data.
756-
(Contributed by Tarek Ziade; :issue:`6693`.)
786+
(Contributed by Tarek Ziadé; :issue:`6693`.)
757787

758788
* The :mod:`socket` module's :class:`SSL` objects now support the
759789
buffer API, which fixed a test suite failure. (Fixed by Antoine Pitrou;
@@ -795,18 +825,33 @@ changes, or look through the Subversion logs for all the details.
795825
(Contributed by Jeremy Hylton.)
796826

797827
* The ``sys.version_info`` value is now a named tuple, with attributes
798-
named ``major``, ``minor``, ``micro``, ``releaselevel``, and ``serial``.
799-
(Contributed by Ross Light; :issue:`4285`.)
800-
801-
* The :mod:`tarfile` module now supports filtering the :class:`TarInfo`
828+
named :attr:`major`, :attr:`minor`, :attr:`micro`,
829+
:attr:`releaselevel`, and :attr:`serial`. (Contributed by Ross
830+
Light; :issue:`4285`.)
831+
832+
:func:`sys.getwindowsversion` also returns a named tuple,
833+
with attributes named :attr:`service_pack_major`,
834+
:attr:`service_pack_minor`,
835+
:attr:`suite_mask`, and :attr:`product_type`. (Contributed by
836+
Brian Curtin; :issue:`7766`.)
837+
838+
* The :mod:`tarfile` module's default error handling has changed, to
839+
no longer suppress fatal errors. The default error level was previously 0,
840+
which meant that errors would only result in a message being written to the
841+
debug log, but because the debug log is not activated by default,
842+
these errors go unnoticed. The default error level is now 1,
843+
which raises an exception if there's an error.
844+
(Changed by Lars Gustäbel; :issue:`7357`.)
845+
846+
:mod:`tarfile` now supports filtering the :class:`TarInfo`
802847
objects being added to a tar file. When you call :meth:`TarFile.add`,
803848
instance, you may supply an optional *filter* argument
804849
that's a callable. The *filter* callable will be passed the
805850
:class:`TarInfo` for every file being added, and can modify and return it.
806851
If the callable returns ``None``, the file will be excluded from the
807852
resulting archive. This is more powerful than the existing
808853
*exclude* argument, which has therefore been deprecated.
809-
(Added by Lars Gustaebel; :issue:`6856`.)
854+
(Added by Lars Gustäbel; :issue:`6856`.)
810855

811856
* The :mod:`threading` module's :meth:`Event.wait` method now returns
812857
the internal flag on exit. This means the method will usually
@@ -815,12 +860,22 @@ changes, or look through the Subversion logs for all the details.
815860
a timeout was provided and the operation timed out.
816861
(Contributed by Tim Lesher; :issue:`1674032`.)
817862

818-
* The :func:`is_zipfile` function in the :mod:`zipfile` module now
819-
accepts a file object, in addition to the path names accepted in earlier
820-
versions. (Contributed by Gabriel Genellina; :issue:`4756`.)
863+
* The :class:`UserDict` class is now a new-style class. (Changed by
864+
Benjamin Peterson.)
865+
866+
* The :mod:`zipfile` module's :class:`ZipFile` now supports the context
867+
management protocol, so you can write ``with zipfile.ZipFile(...) as f: ...``.
868+
(Contributed by Brian Curtin; :issue:`5511`.)
821869

822870
:mod:`zipfile` now supports archiving empty directories and
823871
extracts them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.)
872+
Reading files out of an archive is now faster, and interleaving
873+
:meth:`read` and :meth:`readline` now works correctly.
874+
(Contributed by Nir Aides; :issue:`7610`.)
875+
876+
The :func:`is_zipfile` function in the module now
877+
accepts a file object, in addition to the path names accepted in earlier
878+
versions. (Contributed by Gabriel Genellina; :issue:`4756`.)
824879

825880
.. ======================================================================
826881
.. whole new modules get described in subsections here
@@ -1046,10 +1101,12 @@ Changes to Python's build process and to the C API include:
10461101
instruction currently executing, and then look up the line number
10471102
corresponding to that address. (Added by Jeffrey Yasskin.)
10481103

1049-
* New function: :cfunc:`PyLong_AsLongAndOverflow` approximates a Python long
1050-
integer as a C :ctype:`long`. If the number is too large to fit into
1051-
a :ctype:`long`, an *overflow* flag is set and returned to the caller.
1052-
(Contributed by Case Van Horsen; :issue:`7528`.)
1104+
* New functions: :cfunc:`PyLong_AsLongAndOverflow` and
1105+
:cfunc:`PyLong_AsLongLongAndOverflow` approximates a Python long
1106+
integer as a C :ctype:`long` or :ctype:`long long`.
1107+
If the number is too large to fit into
1108+
the output type, an *overflow* flag is set and returned to the caller.
1109+
(Contributed by Case Van Horsen; :issue:`7528` and :issue:`7767`.)
10531110

10541111
* New function: stemming from the rewrite of string-to-float conversion,
10551112
a new :cfunc:`PyOS_string_to_double` function was added. The old

Lib/decimal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,12 +3600,12 @@ def __reduce__(self):
36003600
return (self.__class__, (str(self),))
36013601

36023602
def __copy__(self):
3603-
if type(self) == Decimal:
3603+
if type(self) is Decimal:
36043604
return self # I'm immutable; therefore I am my own clone
36053605
return self.__class__(str(self))
36063606

36073607
def __deepcopy__(self, memo):
3608-
if type(self) == Decimal:
3608+
if type(self) is Decimal:
36093609
return self # My components are also immutable
36103610
return self.__class__(str(self))
36113611

Lib/distutils/command/bdist_msi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
Implements the bdist_msi command.
88
"""
99
import sys, os
10-
from sysconfig import get_python_version
10+
from sysconfig import get_python_version, get_platform
1111

12-
import sys, os
1312
from distutils.core import Command
1413
from distutils.dir_util import remove_tree
15-
from distutils.sysconfig import get_python_version
1614
from distutils.version import StrictVersion
1715
from distutils.errors import DistutilsOptionError
18-
from distutils.util import get_platform
1916
from distutils import log
2017

2118
import msilib
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Tests for distutils.command.bdist_msi."""
2+
import unittest
3+
import sys
4+
5+
from distutils.tests import support
6+
7+
@unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
8+
class BDistMSITestCase(support.TempdirManager,
9+
support.LoggingSilencer,
10+
unittest.TestCase):
11+
12+
def test_minial(self):
13+
# minimal test XXX need more tests
14+
from distutils.command.bdist_msi import bdist_msi
15+
pkg_pth, dist = self.create_dist()
16+
cmd = bdist_msi(dist)
17+
cmd.ensure_finalized()
18+
19+
def test_suite():
20+
return unittest.makeSuite(BDistMSITestCase)
21+
22+
if __name__ == '__main__':
23+
test_support.run_unittest(test_suite())

Lib/test/test_sysconfig.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ def test_get_platform(self):
145145
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
146146
'-fwrapv -O3 -Wall -Wstrict-prototypes')
147147

148-
maxsize = sys.maxsize
148+
maxint = sys.maxsize
149149
try:
150150
sys.maxsize = 2147483647
151151
self.assertEquals(get_platform(), 'macosx-10.3-ppc')
152152
sys.maxsize = 9223372036854775807
153153
self.assertEquals(get_platform(), 'macosx-10.3-ppc64')
154154
finally:
155-
sys.maxsize = maxsize
155+
sys.maxsize = maxint
156156

157157

158158
self._set_uname(('Darwin', 'macziade', '8.11.1',
@@ -164,15 +164,14 @@ def test_get_platform(self):
164164

165165
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
166166
'-fwrapv -O3 -Wall -Wstrict-prototypes')
167-
168-
maxsize = sys.maxsize
167+
maxint = sys.maxsize
169168
try:
170169
sys.maxsize = 2147483647
171170
self.assertEquals(get_platform(), 'macosx-10.3-i386')
172171
sys.maxsize = 9223372036854775807
173172
self.assertEquals(get_platform(), 'macosx-10.3-x86_64')
174173
finally:
175-
sys.maxsize = maxsize
174+
sys.maxsize = maxint
176175

177176
# macbook with fat binaries (fat, universal or fat64)
178177
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4'

0 commit comments

Comments
 (0)