]> granicus.if.org Git - python/log
python
8 years agobpo-29591: Update VS project files (#2310)
Jeremy Kloth [Wed, 21 Jun 2017 19:14:53 +0000 (13:14 -0600)]
bpo-29591: Update VS project files (#2310)

* Silence warnings caused by duplicated defines from Modules\expat\winconfig.h
* Add WIN32 define to VS9.0 project files to match MSBuild project files.

8 years ago[2.7] bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2312)
Victor Stinner [Wed, 21 Jun 2017 15:12:46 +0000 (17:12 +0200)]
[2.7] bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2312)

* bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300)

New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132313eb651107b179d20218dfe5d4e47f13)

* siphash.h: Address lack of stdint.h for Visual Studio 2003-2008

(cherry picked from libexpat commit c74d380b8f0b5215153d840d2af9455d9c53b960)

8 years agobpo-30368: Update build_ssl.py to restore Perl-less building (#1805)
Jeremy Kloth [Tue, 20 Jun 2017 20:53:39 +0000 (14:53 -0600)]
bpo-30368: Update build_ssl.py to restore Perl-less building (#1805)

* bpo-30368: Update build_ssl.py to restore Perl-less building

OpenSSL 1.0.2 releases changed how files are copied in the makefile,
thus causing Perl to be required even for Python's "prepared" OpenSSL.
Now build_ssl.py does the requisite copies before running nmake.

* bpo-30368: Update build_ssl.py to use prepared OpenSSL

* Updates SSL-linking projects to use the new include{suffix} directory
* build_ssl.py now only copies those files not handled by prepare_ssl.py

* * bpo-30368: Update build_ssl.py to use prepared OpenSSL

* Update SSL-linking projects to use the new include{suffix} directory

* Move comment to following line

8 years agobpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2294)
Victor Stinner [Tue, 20 Jun 2017 14:20:36 +0000 (16:20 +0200)]
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2294)

The current regex based splitting produces a wrong result. For example::

  http://abc#@def

Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)

8 years agobpo-30176: Add missing curses cell attributes constants (#2278)
Xiang Zhang [Mon, 19 Jun 2017 14:12:45 +0000 (22:12 +0800)]
bpo-30176: Add missing curses cell attributes constants (#2278)

8 years ago[2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174)
Jay Bosamiya [Sun, 18 Jun 2017 16:41:03 +0000 (22:11 +0530)]
[2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174)

8 years agobpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest (#2249)
Victor Stinner [Fri, 16 Jun 2017 15:30:03 +0000 (17:30 +0200)]
bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest (#2249)

[2.7] bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest

8 years agobpo-30675: Fix refleak hunting in regrtest (#2227)
Victor Stinner [Fri, 16 Jun 2017 10:14:09 +0000 (12:14 +0200)]
bpo-30675: Fix refleak hunting in regrtest (#2227)

regrtest now warms up caches: create explicitly all internal
singletons which are created on demand to prevent false positives
when checking for reference leaks.

8 years agobpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164) (#2202)
Victor Stinner [Thu, 15 Jun 2017 00:16:35 +0000 (02:16 +0200)]
bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164) (#2202)

* bpo-29591: Upgrade Modules/expat to libexpat 2.2

* bpo-29591: Restore Python changes on expat

* bpo-29591: Remove expat config of unsupported platforms

Remove the configuration (Modules/expat/*config.h) of unsupported
platforms:

* Amiga
* MacOS Classic on PPC32
* Open Watcom

* bpo-29591: Remove useless XML_HAS_SET_HASH_SALT

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became
useless since our local expat copy was upgrade to expat 2.1 (it's now
expat 2.2.0).

(cherry picked from commit 23ec4b57e1359f9c539b8defc317542173ae087e)

8 years agobpo-30659 : Use ** for kwargs in namedtuple._replace() signature (GH-2173) (GH-2196)
Mariatta [Wed, 14 Jun 2017 19:07:42 +0000 (12:07 -0700)]
bpo-30659 : Use ** for kwargs in namedtuple._replace() signature (GH-2173) (GH-2196)

(cherry picked from commit 184bd82ba8106785ba22f0d2477dbd08bef821fb)

8 years agoFix trivial typo in Python Setup documentation (GH-2185) (GH-2190)
csabella [Wed, 14 Jun 2017 16:26:03 +0000 (12:26 -0400)]
Fix trivial typo in Python Setup documentation (GH-2185) (GH-2190)

Replace platform with platforms.
(cherry picked from commit 4ebf03d109f827c91a23256a447c1d74a203dfee)

8 years ago[2.7] bpo-24484: Avoid race condition in multiprocessing cleanup (GH-2159) (#2168)
Antoine Pitrou [Tue, 13 Jun 2017 15:52:29 +0000 (17:52 +0200)]
[2.7] bpo-24484: Avoid race condition in multiprocessing cleanup (GH-2159) (#2168)

* bpo-24484: Avoid race condition in multiprocessing cleanup

The finalizer registry can be mutated while inspected by multiprocessing
at process exit.

* Use test.support.start_threads()

* Add Misc/NEWS.
(cherry picked from commit 1eb6c0074d17f4fd425cacfdda893d65f5f77f0a)

8 years ago[2.7] bpo-29514: Check magic number for bugfix releases
Nick Coghlan [Tue, 13 Jun 2017 10:58:48 +0000 (20:58 +1000)]
[2.7] bpo-29514: Check magic number for bugfix releases

Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.

This ensures that pre-merge CI will automatically pick up
on magic number changes in maintenance releases (and
explain why those are problematic), rather than relying on
all core developers to be aware of the implications of
such changes.

8 years ago_tkinter: Fix refleak in getint() (#2153)
Victor Stinner [Tue, 13 Jun 2017 09:12:01 +0000 (11:12 +0200)]
_tkinter: Fix refleak in getint() (#2153)

PyNumber_Int() creates a new reference: need to decrement result
reference counter.

8 years ago[2.7] Mention how to disable signal fd wakeup (GH-2140) (#2151)
Antoine Pitrou [Tue, 13 Jun 2017 08:21:28 +0000 (10:21 +0200)]
[2.7] Mention how to disable signal fd wakeup (GH-2140) (#2151)

(cherry picked from commit d79c1d4a9406384f10a37f26a7515ce79f9fdd78)

8 years agobpo-30217: add the operators ~ and | to the index (GH-1502) (GH-2137)
Marco Buttu [Mon, 12 Jun 2017 19:42:47 +0000 (21:42 +0200)]
bpo-30217: add the operators ~ and | to the index (GH-1502) (GH-2137)

(cherry picked from commit dc980dfbcfce4695ccde056c3983160ba97b5a36)

8 years agobpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129)
Stéphane Wirtel [Mon, 12 Jun 2017 13:30:48 +0000 (15:30 +0200)]
bpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129)

8 years ago[2.7] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) (#2123)
Serhiy Storchaka [Mon, 12 Jun 2017 06:10:53 +0000 (09:10 +0300)]
[2.7] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) (#2123)

The traceback no longer displayed for SystemExit raised in a callback registered by atexit..
(cherry picked from commit 3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4)

8 years agobpo-30621: Update Input Output Tutorial Example(GH-2074) (GH-2120)
Mariatta [Mon, 12 Jun 2017 01:59:33 +0000 (18:59 -0700)]
bpo-30621: Update Input Output Tutorial Example(GH-2074) (GH-2120)

import json before using json module
(cherry picked from commit 1dbce04d0e3e93b715eb0d8024da396361759d16)

8 years ago[2.7] Use Travis to make sure all generated files are up to date (GH-2080) (GH-2094)
Zachary Ware [Sun, 11 Jun 2017 22:45:40 +0000 (17:45 -0500)]
[2.7] Use Travis to make sure all generated files are up to date (GH-2080) (GH-2094)

(cherry-picked from commit 0afbabe245e2eb6f7cef3b70531d69f2a7ad8295)

Also adds `python.exe-gdb.py` to `.gitignore`, it is created by OS X builds.

8 years ago[2.7] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2086)
Zachary Ware [Sun, 11 Jun 2017 19:19:39 +0000 (14:19 -0500)]
[2.7] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2086)

Also updates checked-in line endings in several files.

8 years agobpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2067)
Mariatta [Sat, 10 Jun 2017 14:26:39 +0000 (07:26 -0700)]
bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2067)

Mention that fnmatchcase does not call normcase, and fnmatch does.
(cherry picked from commit e5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3)

8 years agobpo-30614: testInitNonExistentFile() of test_bz2 leaks references (#2033)
Stéphane Wirtel [Sat, 10 Jun 2017 12:36:57 +0000 (14:36 +0200)]
bpo-30614: testInitNonExistentFile() of test_bz2 leaks references (#2033)

* bpo-30614: testInitNonExistentFile() of test_bz2 leaks references

Extract the code of BZ2File_dealloc and create a new BZ2File_clear()
function. Call BZ2File_clear() in BZ2File_dealloc().

Define BZ2File_clear() as tp_clear.

Move the lock initialization before the "self->file =
PyObject_CallFunction" in BZ2File_init() and check the lock is not
created twice.

Call BZ2File_clear() in BZ2File_init() after the init of the lock

Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
* Create bz2module.c

Fix after the review of Victor Stinner

8 years ago[2.7] bpo-30417: Disable `cpu` resource on AppVeyor (GH-1951)
Zachary Ware [Sat, 10 Jun 2017 03:27:09 +0000 (22:27 -0500)]
[2.7] bpo-30417: Disable `cpu` resource on AppVeyor (GH-1951)

(cherry picked from commit 42e3acda86829def9adc354fbee77597b849bf9e)

8 years agobpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)
Victor Stinner [Thu, 8 Jun 2017 16:34:30 +0000 (18:34 +0200)]
bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)

On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the
pipe.
(cherry picked from commit d52aa31378ae43e044a300edfe8285954c167216)

8 years ago[2.7] trivial: update config.{guess,sub} from gnu.org. (GH-1987) (#2007)
Matthias Klose [Thu, 8 Jun 2017 16:25:58 +0000 (09:25 -0700)]
[2.7] trivial: update config.{guess,sub} from gnu.org. (GH-1987) (#2007)

* Update config.{guess,sub} from gnu.org..
(cherry picked from commit 6f46683a6257f22f25d136ed080d58d0c060a43b)

8 years agobpo-23787: Change sum() docstring from sequence to iterable (GH-1859)
Mariatta [Tue, 6 Jun 2017 16:12:03 +0000 (09:12 -0700)]
bpo-23787: Change sum() docstring from sequence to iterable (GH-1859)

* bpo-23787: Change sum() docstring from sequence to iterable

Original patch by Raymond Hettinger.

8 years ago[2.7] Install dependencies in Travis OSX build (GH-1952)
Zachary Ware [Tue, 6 Jun 2017 03:41:36 +0000 (22:41 -0500)]
[2.7] Install dependencies in Travis OSX build (GH-1952)

(cherry picked from commit 167e0fc211c06df)

8 years ago[2.7] bpo-30417: Disable 'cpu' resource on Travis (GH-1928)
Zachary Ware [Tue, 6 Jun 2017 01:03:05 +0000 (20:03 -0500)]
[2.7] bpo-30417: Disable 'cpu' resource on Travis (GH-1928)

Also weakens the 'should this be run?' regex to allow all builds when .travis.yml changes.
(cherry picked from commit c53b13b270767948fddb58b287149c499f9a03c4)

8 years agoSimplify code in warnings modules (#1957)
Alex Gaynor [Mon, 5 Jun 2017 13:13:50 +0000 (09:13 -0400)]
Simplify code in warnings modules (#1957)

Metaprogramming a list of attributes was excessive, and made the code less readable and slower.

Backport of 5de3a64179bafcd440b32849b1129ed1fea47b85

8 years ago[2.7] Only run AppVeyor on long-lived branches (GH-1941)
Zachary Ware [Mon, 5 Jun 2017 00:52:00 +0000 (19:52 -0500)]
[2.7] Only run AppVeyor on long-lived branches (GH-1941)

Also on the short-lived `buildbot-custom` branch.
(cherry picked from commit d3bedf356aca04ed9135a84b08)

8 years agoSkip UNC tests on AppVeyor in case of ENOENT (GH-1950)
Zachary Ware [Sun, 4 Jun 2017 22:45:02 +0000 (17:45 -0500)]
Skip UNC tests on AppVeyor in case of ENOENT (GH-1950)

8 years ago[2.7] Turn on macOS builds for Travis (GH-1846) (GH-1931)
Brett Cannon [Sat, 3 Jun 2017 17:38:43 +0000 (10:38 -0700)]
[2.7] Turn on macOS builds for Travis (GH-1846) (GH-1931)

Initially the macOS builds are allowed to fail until such time that they can be determined to be stable and not add an unacceptable amount of time to the overall Travis-passing process.
(cherry picked from commit 21c2dd7cf8414c903f0e83cf1d6b7f02f645f422)

8 years agobpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1904...
Xiang Zhang [Thu, 1 Jun 2017 14:22:18 +0000 (22:22 +0800)]
bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1904) (#1676)

8 years agobpo-30499: Remove a deprecated note about sets. (GH-1848) (GH-1907)
Mariatta [Thu, 1 Jun 2017 14:12:18 +0000 (07:12 -0700)]
bpo-30499: Remove a deprecated note about sets. (GH-1848) (GH-1907)

(cherry picked from commit 0737ee20671d60802a7ef40f653fe449f1921de0)

8 years agobpo-22702: Clarify documentation of str.join & bytes.join (GH-156) (GH-1898)
Mariatta [Thu, 1 Jun 2017 02:49:30 +0000 (19:49 -0700)]
bpo-22702: Clarify documentation of str.join & bytes.join (GH-156) (GH-1898)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition..
(cherry picked from commit 08e2f355d04d3cbea5751ce1275306ee3f569b32)

8 years ago[2.7] Fix Travis config to reinstate test build (GH-1879) (GH-1891)
Brett Cannon [Wed, 31 May 2017 22:53:30 +0000 (15:53 -0700)]
[2.7] Fix Travis config to reinstate test build (GH-1879) (GH-1891)

(cherry picked from commit a5aa72ac789052411797c6f079ffff0a9fdbf82c)

8 years ago[2.7] Fix a trivial typo in global section (GH-1497) (GH-1882)
Mariatta [Wed, 31 May 2017 05:08:19 +0000 (22:08 -0700)]
[2.7] Fix a trivial typo in global section (GH-1497) (GH-1882)

(cherry picked from commit f34c6850203a2406c4950af7a9c8a134145df4ea)

8 years ago[2.7] Build docs in parallel (GH-1842). (GH-1873)
Mariatta [Tue, 30 May 2017 22:29:40 +0000 (15:29 -0700)]
[2.7] Build docs in parallel (GH-1842). (GH-1873)

(cherry picked from commit eba68e2c42e149acecb15bbeb692786e2540157d)

8 years agobpo-29766: Do not force --with-lto to true for --enable-optimizations (#1858)
Hanno Schlichting [Tue, 30 May 2017 02:07:07 +0000 (04:07 +0200)]
bpo-29766: Do not force --with-lto to true for --enable-optimizations (#1858)

This fixes a faulty backport to the Python 2.7 branch only of http://bugs.python.org/issue28032. Details in the bpo-29766.

8 years ago[2.7] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1289)
Mariatta [Sat, 27 May 2017 14:19:55 +0000 (07:19 -0700)]
[2.7] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1289)

(cherry picked from commit 9616a82e7802241a4b74cf7ae38d43c37bf66e48)

8 years ago[2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567)
Serhiy Storchaka [Fri, 26 May 2017 05:15:51 +0000 (08:15 +0300)]
[2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567)

8 years ago[2.7] Indent methods and attributes of MimeType class (GH-1306) (#1801)
Stéphane Wirtel [Thu, 25 May 2017 17:11:30 +0000 (19:11 +0200)]
[2.7] Indent methods and attributes of MimeType class (GH-1306) (#1801)

8 years ago[2.7] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc ...
Antoine Pitrou [Thu, 25 May 2017 15:53:04 +0000 (17:53 +0200)]
[2.7] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc (GH-1683) (#1817)

* bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc

Queue background running thread was not handling exceptions correctly.
Any exception occurred inside thread (putting unpickable object) cause
feeder to finish running. After that every message put into queue is
silently ignored.

* bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc

Queue background running thread was not handling exceptions correctly.
Any exception occurred inside thread (putting unpickable object) cause
feeder to finish running. After that every message put into queue is
silently ignored..
(cherry picked from commit bc50f03db4f58c869b78e98468e374d7e61f1227)

8 years agobpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1788)
Stéphane Wirtel [Wed, 24 May 2017 18:24:27 +0000 (20:24 +0200)]
bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1788)

8 years agoadded re.UNICODE effects to insensitive flags (#1781)
Brian Ward [Wed, 24 May 2017 07:08:41 +0000 (00:08 -0700)]
added re.UNICODE effects to insensitive flags (#1781)

8 years agoFix spelling mistakes in tkinter.py (#1754)
Vijay Kumar [Tue, 23 May 2017 06:16:27 +0000 (11:46 +0530)]
Fix spelling mistakes in tkinter.py (#1754)

Ran the docstrings through spell checker, and fixed spelling issues.

8 years agoBuild the docs against Sphinx 1.6.1 (GH-1744)
Brett Cannon [Tue, 23 May 2017 00:47:01 +0000 (17:47 -0700)]
Build the docs against Sphinx 1.6.1 (GH-1744)

8 years ago[2.7] Fix typos in multiple `.rst` files (GH-1668) (#1707)
delirious-lettuce [Mon, 22 May 2017 17:16:53 +0000 (11:16 -0600)]
[2.7] Fix typos in multiple `.rst` files (GH-1668) (#1707)

8 years agobpo-30003: Fix handling escape characters in HZ codec (#1720) (#1556)
Xiang Zhang [Mon, 22 May 2017 17:04:27 +0000 (01:04 +0800)]
bpo-30003: Fix handling escape characters in HZ codec (#1720) (#1556)

8 years ago[2.7] bpo-30415: Add new tests for the fnmatch module. (GH-1684). (#1696)
Serhiy Storchaka [Sun, 21 May 2017 07:37:43 +0000 (10:37 +0300)]
[2.7] bpo-30415: Add new tests for the fnmatch module. (GH-1684). (#1696)

(cherry picked from commit 817554715b5578b0bac5c35e6ec9a1abd8649e53)

8 years agobpo-30409: locale.getpreferredencoding doesn't return result (#1672)
Sean McCully [Sun, 21 May 2017 01:44:02 +0000 (21:44 -0400)]
bpo-30409: locale.getpreferredencoding doesn't return result (#1672)

8 years ago[2.7] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1681)
Serhiy Storchaka [Sat, 20 May 2017 17:05:27 +0000 (20:05 +0300)]
[2.7] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1681)

Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)

8 years ago[2.7] bpo-25794: Fix `type.__setattr__()` for non-interned or unicode attribute names...
Serhiy Storchaka [Sat, 20 May 2017 07:04:53 +0000 (10:04 +0300)]
[2.7] bpo-25794: Fix `type.__setattr__()` for non-interned or unicode attribute names. (GH-1652) (#1675)

Based on patch by Eryk Sun.
(cherry picked from commit d896985bb2de49046f9b6879e906d1e4db255e23)

8 years agobpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)
Marc Schlaich [Fri, 19 May 2017 00:40:16 +0000 (02:40 +0200)]
bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)

Patch by Davin with help from Marc.

8 years ago[2.7] bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595) (#1648)
Serhiy Storchaka [Thu, 18 May 2017 10:46:17 +0000 (13:46 +0300)]
[2.7] bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595) (#1648)

Warnings emitted when compile a regular expression now always point
to the line in the user code.  Previously they could point into inners
of the re module if emitted from inside of groups or conditionals.

(cherry picked from commit c7ac7280c321b3c1679fe5f657a6be0f86adf173)

8 years ago[2.7] bpo-30363: Backport warnings in the re module. (#1577)
Serhiy Storchaka [Thu, 18 May 2017 09:34:40 +0000 (12:34 +0300)]
[2.7] bpo-30363: Backport warnings in the re module. (#1577)

Running Python with the -3 option now warns about regular expression
syntax that is invalid or has different semantic in Python 3
or will change the behavior in future Python versions.

8 years agobpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)
Serhiy Storchaka [Wed, 17 May 2017 07:08:11 +0000 (10:08 +0300)]
bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)

Running Python with the -3 option now emits deprecation warnings for
getchildren() and getiterator() methods of the Element class in the
xml.etree.cElementTree module and when pass the html argument to
xml.etree.ElementTree.XMLParser().

Fixed a deprecation warning about the doctype() method of the
xml.etree.ElementTree.XMLParser class.  Now it is emitted only when
define the doctype() method in the subclass of XMLParser.

Fixed a bug in the test_bug_200708_close test method.  An EchoTarget
instance was incorrectly passed to XMLParser() as the html argument and
silently ignored.

Tests no longer failed when use the -m option for running only selected
test methods. Checking warnings now is more specific, warnings are
expected only when use deprecated features.

8 years agobpo-30329: Catch Windows error 10022 on shutdown() (#1538) (#1624)
Victor Stinner [Wed, 17 May 2017 00:38:30 +0000 (17:38 -0700)]
bpo-30329: Catch Windows error 10022 on shutdown() (#1538) (#1624)

Catch the Windows socket WSAEINVAL error (code 10022) in imaplib
on shutdown(SHUT_RDWR): An invalid operation was attempted

This error occurs sometimes on SSL connections.
(cherry picked from commit 83a2c2879839da2e10037f5e4af1bd1dafbf1a52)

8 years ago[2.7] bpo-30380: Fix Sphinx 1.6.1 warnings. (GH-1613) (#1616)
Serhiy Storchaka [Tue, 16 May 2017 22:26:48 +0000 (01:26 +0300)]
[2.7] bpo-30380: Fix Sphinx 1.6.1 warnings. (GH-1613) (#1616)

* Use explicit numbering for footnotes referred by explicit number.
* Fix literal strings formatting in howto/urllib2.rst.
* Add `:noindex:` to duplicated definition of list.
* Update susp-ignored.csv for reference/expressions.rst.
(cherry picked from commit d97b7dc94b19063f0589d401bdc4aaadc7030762)

8 years ago[2.7] bpo-30380: Pin the version of Sphinx used to build the docs (GH-1612) (GH-1619)
Brett Cannon [Tue, 16 May 2017 21:41:00 +0000 (14:41 -0700)]
[2.7] bpo-30380: Pin the version of Sphinx used to build the docs (GH-1612) (GH-1619)

8 years agobpo-30357 each test in test_thread waits until all spawned threads finish (#1583)
grzgrzgrz3 [Mon, 15 May 2017 19:01:07 +0000 (21:01 +0200)]
bpo-30357 each test in test_thread waits until all spawned threads finish (#1583)

* bpo-30357 each test in test_thread waits until all spawn threads finish

* bpo-30357 each test in test_thread waits until all spawn threads finish

* bpo-30357: test_thread now uses threading_cleanup() (#1592)

test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.

Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
* bpo-30357: test_thread now uses threading_cleanup() (#1592)

test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.

Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
8 years agobpo-11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition...
Victor Stinner [Mon, 15 May 2017 15:32:14 +0000 (17:32 +0200)]
bpo-11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition. (#1591)

(cherry picked from commit f25a8de845d20349a265442eb0f3dcd71d0d7ac5)

8 years ago[2.7] bpo-30366: Backport tests for test.support. (#1582)
Serhiy Storchaka [Mon, 15 May 2017 08:59:35 +0000 (11:59 +0300)]
[2.7] bpo-30366: Backport tests for test.support. (#1582)

Also backport new functions temp_dir() and python_is_optimized().
temp_cwd() now accepts None as a name (means using tempfile.mkdtemp).
check_syntax_error() now accepts arguments lineno and offset.
Use more specific error messages in get_attribute().

8 years agobpo-30242: resolve some undefined behaviours in struct (#1418) (#1588)
Xiang Zhang [Mon, 15 May 2017 05:17:54 +0000 (13:17 +0800)]
bpo-30242: resolve some undefined behaviours in struct (#1418) (#1588)

8 years agoUpdate Travis Doc build config (GH-1565)
Zachary Ware [Sat, 13 May 2017 15:05:53 +0000 (10:05 -0500)]
Update Travis Doc build config (GH-1565)

Build the 'suspicious' doc target, turn on warnings-as-errors on the
docs, and always build the docs.  This better matches master's doc build
setup.

8 years agobpo-11681: Document the `-b` and `-bb` options (GH-1562)
Zachary Ware [Sat, 13 May 2017 14:30:20 +0000 (09:30 -0500)]
bpo-11681: Document the `-b` and `-bb` options (GH-1562)

8 years agoFix warnings due to deprecated latex options (GH-1563)
Zachary Ware [Sat, 13 May 2017 14:16:44 +0000 (09:16 -0500)]
Fix warnings due to deprecated latex options (GH-1563)

8 years agoUpdate susp-ignored.csv (GH-1564)
Zachary Ware [Sat, 13 May 2017 14:16:25 +0000 (09:16 -0500)]
Update susp-ignored.csv (GH-1564)

8 years agobpo-6393: Fix locale.getprerredencoding() on macOS (#1555)
Victor Stinner [Fri, 12 May 2017 09:51:38 +0000 (11:51 +0200)]
bpo-6393: Fix locale.getprerredencoding() on macOS (#1555)

Fix for bpo-6393: Python crashes on OSX when $LANG is set to some (but
not all) invalid values due to an invalid result from nl_langinfo

(cherry picked from commit 6d77e07196bfb5dfa4de6f5d80b2619c0643a75e)

8 years agobpo-30342: Fix sysconfig.is_python_build() on VS9.0 (#1544)
Victor Stinner [Fri, 12 May 2017 09:31:08 +0000 (11:31 +0200)]
bpo-30342: Fix sysconfig.is_python_build() on VS9.0 (#1544)

Fix sysconfig.is_python_build() if Python is built with Visual Studio
2008 (VS 9.0).

8 years ago[2.7] bpo-30283: regrtest: backport test_slow_interrupted() and test_coverage() ...
Victor Stinner [Thu, 11 May 2017 09:30:23 +0000 (11:30 +0200)]
[2.7] bpo-30283: regrtest: backport test_slow_interrupted() and test_coverage() (#1541)

* bpo-30283: regrtest: backport test_coverage()

* Add --coverage option, the option was already described in the doc
* When coverage is used, regrtest now pass all options to runtest()
  and calls also accumulate_result() (as done when coverage is not
  used).
* bpo-25260: Fix coverage on Windows: remove the list of ignored
  directories.

* bpo-30283: regrtest: backport test_slow_interrupted()

* Fix regrtest to report interrupted tests as omitted rather than
  failed.
* bpo-25260: Fix coverage on Windows: remove the list of ignored
  directories.

* bpo-30283: Fix test_regrtest on Visual Studio 2008

Skip Tools\buildbot\test.bat and PCbuild\rt.bat if Python was not
compiled in PCbuild (but compiled in PC\VS9.0\ for example).

8 years agobpo-15526: test_startfile changes the cwd (#1537)
Victor Stinner [Wed, 10 May 2017 23:23:19 +0000 (01:23 +0200)]
bpo-15526: test_startfile changes the cwd (#1537)

Try to fix test_startfile's inability to clean up after itself in
time. Patch by Jeremy Kloth.

Fix the following support.rmtree() error while trying to remove the
temporary working directory used by Python tests:

WindowsError: [Error 32] The process cannot access the file because
it is being used by another process: ...

Original commit: 8a53dbeb7a9d0ae3e446f36e56cf9acfabe443c1

8 years agobpo-30281: Fix the default value for stop in PySlice_Unpack() (#1531) (#1480)
Xiang Zhang [Wed, 10 May 2017 11:20:28 +0000 (19:20 +0800)]
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1531) (#1480)

8 years agogitignore: add rules for the PC/ directory (#1514)
Victor Stinner [Wed, 10 May 2017 00:38:28 +0000 (02:38 +0200)]
gitignore: add rules for the PC/ directory (#1514)

[2.7] gitignore: add rules for the PC/ directory

8 years ago[2.7] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (...
torsava [Tue, 9 May 2017 16:04:29 +0000 (18:04 +0200)]
[2.7] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (#1522)

* bpo-29243: Fix Makefile with respect to --enable-optimizations

When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.

Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.

* !squash.
(cherry picked from commit a1054c3b0037d4c2a5492e79fc193f36245366c7)

8 years agobpo-30283: Backport regrtest features from master to 2.7 (#1516)
Victor Stinner [Tue, 9 May 2017 15:06:34 +0000 (17:06 +0200)]
bpo-30283: Backport regrtest features from master to 2.7 (#1516)

* regrtest: add --slowest alias to --slow

* make buildbottest: add --slowest option

* regrtest: add "- " prefix to --slowest output

* regrtest: Fix an outdated comment

* regrtest: replace PermissionError

Replace PermissionError with OSError and check on exc.errno.
PermissionError was added to Python 3.3.

* regrtest: add -3 -tt options to run Python scripts

* regrtest: backport --list-tests option

* regrtest: backport "Tests result: xxx" summary

* regrtest: backport total duration

* regrtest: add timestamp to the progress

* regrtest: describe previous test state

* Add the state of the test: passed, failed, etc.
* If a test took longer than 30 seconds, log its execution time

* regrtest: -jN logs running workers

* regrtest: mention if tests are run in parallel

* regrtest: parallel mode is more verbose during wait

Display running tests every 30 seconds if no test completed in the
meanwhile.

* test_regrtest: fix typo in SubprocessRun

8 years ago[2.7] bpo-30283: Backport test_regrtest from master to 2.7 (#1513)
Victor Stinner [Tue, 9 May 2017 11:57:20 +0000 (13:57 +0200)]
[2.7] bpo-30283: Backport test_regrtest from master to 2.7 (#1513)

* bpo-30283: regrtest: add --testdir option

* bpo-30283: Backport _testcapi.raise_signal()

Function used by test_regrtest to simulate an interrupted unit test.

* bpo-30283: Backport test_regrtest from master

8 years agoFix SyntaxWarning on importing test_inspect (#1512)
Victor Stinner [Tue, 9 May 2017 09:53:16 +0000 (11:53 +0200)]
Fix SyntaxWarning on importing test_inspect (#1512)

Fix the following warning when test_inspect.py is compiled to
test_inspect.pyc:

test_inspect.py:505: SyntaxWarning: tuple parameter unpacking has been removed in 3.x
  def spam_deref(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h):

Replace also test.test_support import with test.support.

8 years agobpo-29990: Fix range checking in GB18030 decoder (#1509)
Xiang Zhang [Tue, 9 May 2017 04:18:56 +0000 (12:18 +0800)]
bpo-29990: Fix range checking in GB18030 decoder (#1509)

8 years agobpo-30258: Fix handling of child error in regrtest (#1477)
Victor Stinner [Fri, 5 May 2017 08:28:35 +0000 (10:28 +0200)]
bpo-30258: Fix handling of child error in regrtest (#1477)

Don't stop the worker thread if a child failed.

8 years agobpo-30265: support.unlink() don't catch any OSError (#1456)
Victor Stinner [Fri, 5 May 2017 08:27:34 +0000 (10:27 +0200)]
bpo-30265: support.unlink() don't catch any OSError (#1456)

support.unlink() now only ignores ENOENT and ENOTDIR, instead of
ignoring any OSError exception.

8 years ago[2.7] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1471)
Serhiy Storchaka [Fri, 5 May 2017 08:21:45 +0000 (11:21 +0300)]
[2.7] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1471)

It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed..
(cherry picked from commit 76a3e51a403bc84ed536921866c86dd7d07aaa7e)

8 years agobpo-30264: ExpatParser now closes the source (#1476)
Victor Stinner [Fri, 5 May 2017 08:11:55 +0000 (10:11 +0200)]
bpo-30264: ExpatParser now closes the source (#1476)

ExpatParser.parse() of xml.sax.xmlreader now closes the source: close
the file object or the urllib object if source is a string (not an
open file-like object).

Add test_parse_close_source() unit test.

8 years agoRelax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1472)
Victor Stinner [Fri, 5 May 2017 07:47:11 +0000 (09:47 +0200)]
Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1472)

(cherry picked from commit 685cdb9acc3fca04a9897d88b89771ddfd50e772)

8 years agoRevert "Issue #29094: Offsets in a ZIP file created with extern file object and modes...
Benjamin Peterson [Fri, 5 May 2017 06:54:43 +0000 (23:54 -0700)]
Revert "Issue #29094: Offsets in a ZIP file created with extern file object and modes" (#1467)

This reverts commit 0f4ed2cdc6e7887153c481f4c7298bc35e219d84 (though, the tests are retained) and the followup 58ab4b57da2e5db7ff9b9940dd21bbbe4d804957.

See discussion on bpo-29094.

8 years agobpo-23404: make touch becomes make regen-all (#1466)
Victor Stinner [Fri, 5 May 2017 01:14:23 +0000 (03:14 +0200)]
bpo-23404: make touch becomes make regen-all (#1466)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-opcode-targets: Python/opcode_targets.h

* Add PYTHON_FOR_REGEN variable
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

8 years agobpo-30108: Fix test_site setUpModule() (#1460)
Victor Stinner [Thu, 4 May 2017 16:52:26 +0000 (18:52 +0200)]
bpo-30108: Fix test_site setUpModule() (#1460)

Oops, I forgot that PermissionError was introduced in Python 3.3!
Replace PermissionError with OSError and check on errno.

8 years agobpo-30108: Restore sys.path in test_site (#1197) (#1459)
Victor Stinner [Thu, 4 May 2017 16:21:52 +0000 (18:21 +0200)]
bpo-30108: Restore sys.path in test_site (#1197) (#1459)

Add setUpModule() and tearDownModule() functions to test_site to
save/restore sys.path at the module level to prevent warning if the
user site directory is created, since site.addsitedir() modifies
sys.path.
(cherry picked from commit b85c136903c6d2368162f7c4a58f258c9c69ead0)

8 years agoFix test_ftplib warning if IPv6 is not available (#1457)
Victor Stinner [Thu, 4 May 2017 16:10:30 +0000 (18:10 +0200)]
Fix test_ftplib warning if IPv6 is not available (#1457)

DummyFTPServer now calls del_channel() on bind() error to prevent the
following warning in TestIPv6Environment.setUpClass():

Warning -- asyncore.socket_map was modified by test_ftplib
  Before: {}
  After:  {3: <test.test_ftplib.DummyFTPServer 127.0.0.1:0 at ...>}

8 years agotest_distutils: test_build_ext uses EnvironGuard (#1458)
Victor Stinner [Thu, 4 May 2017 16:10:09 +0000 (18:10 +0200)]
test_distutils: test_build_ext uses EnvironGuard (#1458)

Use EnvironGuard on BuildExtTestCase to save/restore os.environ, to fix the
following warning:

Warning -- os.environ was modified by test_distutils

MSVCCompiler.initialize() of distutils.msvc9compiler modifies
os.environ.

8 years ago[2.7] bpo-28315: Improve code examples in docs (GH-1372) (#1447)
Mariatta [Thu, 4 May 2017 01:54:28 +0000 (18:54 -0700)]
[2.7] bpo-28315: Improve code examples in docs (GH-1372) (#1447)

Replace
   File "<stdin>", line 1, in ?
with
   File "<stdin>", line 1, in <module>.
(cherry picked from commit 8856940cf2e82cb17db2b684cd5732fe658605ca)

8 years ago[2.7] bpo-30236: Backported regrtest options -m and -G. (#1394)
Serhiy Storchaka [Wed, 3 May 2017 21:23:50 +0000 (00:23 +0300)]
[2.7] bpo-30236: Backported regrtest options -m and -G. (#1394)

8 years agoAdd Appveyor to Python 2.7 branch (#1434)
Victor Stinner [Wed, 3 May 2017 16:42:42 +0000 (18:42 +0200)]
Add Appveyor to Python 2.7 branch (#1434)

* Add Appveyor to Python 2.7 branch

* Adapt AppVeyor config for Python 2

* Replace -j0 with -j2: -j0 is ignored on Python 2
* Replace --slowest with --slow
* Remove --timeout option (it was introduced in Python 3)

8 years agobpo-30257: _bsddb: Fix newDBObject() (#1428)
Victor Stinner [Wed, 3 May 2017 16:04:18 +0000 (18:04 +0200)]
bpo-30257: _bsddb: Fix newDBObject() (#1428)

Don't set cursorSetReturnsNone to DEFAULT_CURSOR_SET_RETURNS_NONE
anymore if self->myenvobj is set.

Fix a GCC warning on the strange indentation.

8 years agobpo-30258: regrtest handles child process crash (#1431)
Victor Stinner [Wed, 3 May 2017 15:28:28 +0000 (17:28 +0200)]
bpo-30258: regrtest handles child process crash (#1431)

Backport the CHILD_ERROR status from master: a test is considered as
failed if a worker process running a test exited with a code
different than zero.

Change also the output: write stdout and stderr of the child process
after the test name, instead of writing it before.

accumulate_result(): don't use time of CHILD_ERROR or INTERRUPTED
results.

8 years agotest_distutils: use EnvironGuard (#1433)
Victor Stinner [Wed, 3 May 2017 15:28:10 +0000 (17:28 +0200)]
test_distutils: use EnvironGuard (#1433)

Use EnvironGuard on InstallTestCase and UtilTestCase.

Backport fixes from master to prevent the following warning:

Warning -- os.environ was modified by test_distutils

8 years agoUpdate .gitignore (#1435)
Victor Stinner [Wed, 3 May 2017 15:27:17 +0000 (17:27 +0200)]
Update .gitignore (#1435)

Ignore more generated files and test data downloaded by tests.

8 years agobpo-30255: Clip step in _PySlice_Unpack() (#1429)
Victor Stinner [Wed, 3 May 2017 14:00:12 +0000 (16:00 +0200)]
bpo-30255: Clip step in _PySlice_Unpack() (#1429)

In PySlice_IndicesEx, clip the step to [-PY_SSIZE_T_MAX,
PY_SSIZE_T_MAX] rather than [PY_SSIZE_T_MIN, PY_SSIZE_T_MAX].

(cherry picked from commit e6fc7401a92c7b51a80782d8095819b9909a0322)

8 years agoregrtest: always show before/after of modified env (#1407) (#1409)
Victor Stinner [Wed, 3 May 2017 01:47:44 +0000 (03:47 +0200)]
regrtest: always show before/after of modified env (#1407) (#1409)

Buildbots don't run tests with -vv and so only log "xxx was modified
by test_xxx" which is not enough to debug such random issue. In many
cases, I'm unable to reproduce the warning and so unable to fix it.

Always logging the value before and value after should help to debug
such warning on buildbots.
(cherry picked from commit ec4b17239d899550be4ee6104b61751bb3c70382)
(cherry picked from commit 22982350235f8c5821b71661a5616423e1c7fcc0)