Commit Graph

11400 Commits

Author SHA1 Message Date
Serhiy Storchaka 96f5020597 [2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567) 2017-05-26 08:15:51 +03:00
Antoine Pitrou bdd964710d [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 bc50f03db4)
2017-05-25 17:53:04 +02:00
delirious-lettuce 374e57d928 [2.7] Fix typos in multiple `.rst` files (GH-1668) (#1707) 2017-05-22 20:16:53 +03:00
Xiang Zhang 6e1b832a6c bpo-30003: Fix handling escape characters in HZ codec (#1720) (#1556) 2017-05-23 01:04:27 +08:00
Sean McCully cef8b1741c bpo-30409: locale.getpreferredencoding doesn't return result (#1672) 2017-05-20 18:44:02 -07:00
Serhiy Storchaka e6a0b59829 [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 753bca3934)
2017-05-20 20:05:27 +03:00
Serhiy Storchaka e9f9b04278 [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 d896985bb2)
2017-05-20 10:04:53 +03:00
Serhiy Storchaka dfcfc91578 [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 c7ac7280c3)
2017-05-18 13:46:17 +03:00
Serhiy Storchaka 955b6760cf [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.
2017-05-18 12:34:40 +03:00
Serhiy Storchaka 09b52471f3 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.
2017-05-17 10:08:11 +03:00
Victor Stinner 800e4b7ad6 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 83a2c28798)
2017-05-16 17:38:30 -07:00
grzgrzgrz3 6924ed55c9 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>
2017-05-15 21:01:07 +02:00
Victor Stinner 9d1983be50 bpo-11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition. (#1591)
(cherry picked from commit f25a8de845)
2017-05-15 17:32:14 +02:00
Victor Stinner f2e894cfd9 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).
2017-05-12 11:31:08 +02:00
torsava a473a73d0c [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 a1054c3b00)
2017-05-09 18:04:29 +02:00
Xiang Zhang 4e7457b853 bpo-29990: Fix range checking in GB18030 decoder (#1509) 2017-05-09 12:18:56 +08:00
Serhiy Storchaka 5d7a18f3b6 [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 76a3e51a40)
2017-05-05 11:21:45 +03:00
Benjamin Peterson ef4c6ba169 Revert "Issue #29094: Offsets in a ZIP file created with extern file object and modes" (#1467)
This reverts commit 0f4ed2cdc6 (though, the tests are retained) and the followup 58ab4b57da.

See discussion on bpo-29094.
2017-05-04 23:54:43 -07:00
Victor Stinner 8a19eb24c9 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
2017-05-05 03:14:23 +02:00
Serhiy Storchaka 74f0db885f [2.7] bpo-30236: Backported regrtest options -m and -G. (#1394) 2017-05-04 00:23:50 +03:00
Victor Stinner f6a3133972 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 e6fc7401a9)
2017-05-03 16:00:12 +02:00
Serhiy Storchaka 43566aee12 [2.7] bpo-30223: Add Lib/test/__main__.py. (#1373)
To unify running tests in Python 2.7 and Python 3, the test
package can be run as a script.  This is equivalent to running the
test.regrtest module as a script.
2017-05-02 18:26:25 +03:00
Victor Stinner 2c7085fd7b bpo-27593: Get SCM build info from git instead of hg (#1327)
Based on commit 5c4b0d063a by Ned
Deily, which is based on original patches by Brett Cannon and Steve
Dower.

Remove also the private _Py_svnversion() function and SVNVERSION
variable.

Note: Py_SubversionRevision() and Py_SubversionShortBranch() are
unchanged, they are part of the public API.
2017-05-02 16:55:50 +02:00
Serhiy Storchaka a694e092f6 bpo-30207: Rename test.test_support to test.support. (#1353)
To simplify backports from Python 3, the test.test_support module
was converted into a package and renamed to test.support.  The
test.script_helper module was moved into the test.support package.
Names test.test_support and test.script_helper are left as aliases to
test.support and test.support.script_helper.
2017-04-30 11:36:58 +03:00
Serhiy Storchaka 941ea53b57 [2.7] bpo-30197: Enhance swap_attr() and backport swap_item() in test.test_support. (#1341) (#1347)
(cherry picked from commit d1a1def7bf)
2017-04-28 20:06:30 +03:00
Serhiy Storchaka 2a1bf0633c [2.7] [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (GH-1185) (#1189)
(cherry picked from commit a79f4c2195).
(cherry picked from commit 952a05e4e2)
2017-04-20 00:48:57 +03:00
Serhiy Storchaka 64aa4df850 [2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) (#1183)
raised an error.

(cherry picked from commit bf623ae884)
(cherry picked from commit 680fea4)
2017-04-19 22:34:58 +03:00
Serhiy Storchaka 89f9eb5b19 bpo-29943: Remove the PySlice_GetIndicesEx() macro. (#1050) 2017-04-16 10:08:47 +03:00
Serhiy Storchaka 50f948edda bpo-30011: Fixed race condition in HTMLParser.unescape(). (#1140) 2017-04-15 18:35:46 +03:00
Xiang Zhang 5fbdfc36f3 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1152) 2017-04-15 13:18:22 +08:00
Nick Coghlan ab16dc180e bpo-29506: Clarify deep copy note in copy module
The reference to administrative data was confusing to readers,
so this simplifies the note to explain that deep copying may copy
more then you intended, such as data that you expected to be
shared between copies.

Patch by Sanyam Khurana.
2017-04-09 20:57:29 +10:00
cocoatomo 7f85947106 [2.7] bpo-19225: Lack of c api exceptions doc (#964)
* Keep the c-api exception doc up-to-date

cherry-pick'ed from ec1f5df..e3d6db3 and fix conflict
2017-04-08 09:19:24 +03:00
Victor Stinner 23d6eb656e bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. (#462) (#973)
* bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS

Skip some tests of select.poll when running on macOS due to unresolved
issues with the underlying system poll function on some macOS versions.

(cherry picked from commit de04644627)
2017-04-03 18:11:22 +02:00
Serhiy Storchaka 9c2c42c221 bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903) (#963)
(cherry picked from commit 576def096e)

(cherry picked from commit a6b4e19022)
2017-04-02 20:37:03 +03:00
Serhiy Storchaka 68903b656d bpo-15083: Convert ElementTree doctests to unittests. (#906) 2017-04-02 16:55:43 +03:00
T. Wouters d694a06206 bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#913)
Fix the use of recursion in itertools.chain.from_iterable. Using recursion
is unnecessary, and can easily cause stack overflows, especially when
building in low optimization modes or with Py_DEBUG enabled.
(cherry picked from commit 5466d4af5f)
2017-03-30 12:49:22 -07:00
Serhiy Storchaka 079f21f873 bpo-29935: Fixed error messages in the index() method of tuple and list (#887) (#907) (#910)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abf)
(cherry picked from commit bf4bb2e430)
2017-03-30 20:32:18 +03:00
INADA Naoki 6a04ef7ced bpo-29643: Fix check for --enable-optimizations (GH-873)
The presence of the ``--enable-optimizations`` flag is indicated by the
value of ``$enableval``, but the configure script was checking ``$withval``,
resulting in the ``--enable-optimizations`` flag being effectively ignored.
(cherry picked from commit 8cea5929f5)
2017-03-29 01:50:48 +09:00
Antoine Pitrou 5084ff7ddf bpo-29861: release references to multiprocessing Pool tasks (#743) (#803)
* bpo-29861: release references to multiprocessing Pool tasks (#743)

* bpo-29861: release references to multiprocessing Pool tasks

Release references to tasks, their arguments and their results as soon
as they are finished, instead of keeping them alive until another task
arrives.

* Comments in test

(cherry picked from commit 8988945cdc)

* Fix Misc/NEWS ?
2017-03-24 16:03:46 +01:00
Serhiy Storchaka 1aa1803b3d bpo-27880: Fixed integer overflow in cPickle when pickle large strings or (#662)
too many objects.
2017-03-14 07:29:33 +02:00
Zachary Ware f9a6516117 bpo-29572: Update Windows build to OpenSSL 1.0.2k (GH-444) 2017-03-03 16:28:39 -06:00
Xiang Zhang b4f0e980b6 bpo-28598: Support __rmod__ for RHS subclasses of str in % string formatting operations (GH-366) 2017-03-01 14:28:14 +08:00
INADA Naoki 02eb4b0bd4 bpo-29110: Fix file object leak in aifc.open (GH-356) 2017-02-28 20:39:30 +09:00
Mariatta 23d2c31cbf [2.7] bpo-28929: Add to Misc/NEWS (GH-286)
mention bpo-28929 in the Documentation section of
What's New in Python 2.7.14
2017-02-25 22:33:36 -08:00
Mark Dickinson c0b336e0ad bpo-29602: fix signed zero handling in complex constructor (#204)
* bpo-29602: fix signed zero handling in complex constructor

* Add missing have_getformat definition; remove use of unittest subtests.
2017-02-20 21:14:52 +00:00
Xiang Zhang 7131a73f96 bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects (#128) (#187) 2017-02-20 14:32:53 +08:00
Nick Coghlan 4e1e30dae9 Issue #26355: Specify canonical URLs in docs pages
Add canonical header link on each page to corresponding major version of the documentation.

Patch by Matthias Bussonnier.
2017-02-09 17:00:31 +01:00
Mark Dickinson ea82972ec8 Issue #14376: sys.exit now accepts longs as well as ints. Thanks Gareth Rees. 2017-02-02 19:31:53 +00:00
Serhiy Storchaka 3b23004112 Issue #29354: Fixed inspect.getargs() for parameters which are cell
variables.
2017-02-01 22:53:03 +02:00
Serhiy Storchaka 8e21cc3ce0 Issue #29028: Fixed possible use-after-free bugs in the subscription of the
buffer object with custom index object.
2017-02-01 22:47:44 +02:00