Commit Graph

17151 Commits

Author SHA1 Message Date
Serhiy Storchaka 4a01cab898 Issue #19176: Fixed doctype() related bugs in C implementation of ElementTree.
A deprecation warning no longer issued by XMLParser subclass with default
doctype() method.  Direct call of doctype() now issues a warning.  Parser's
doctype() now is not called if target's doctype() is called.  Based on patch
by Martin Panter.
2015-06-29 23:08:52 +03:00
Serhiy Storchaka 05744ac6e0 Issue #19176: Fixed doctype() related bugs in C implementation of ElementTree.
A deprecation warning no longer issued by XMLParser subclass with default
doctype() method.  Direct call of doctype() now issues a warning.  Parser's
doctype() now is not called if target's doctype() is called.  Based on patch
by Martin Panter.
2015-06-29 22:35:58 +03:00
Serhiy Storchaka bc9e75ed02 Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray
object now always allocates place for trailing null byte and it's buffer now
is always null-terminated.
2015-06-29 21:18:01 +03:00
Serhiy Storchaka 7b6e3b91f5 Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray
object now always allocates place for trailing null byte and it's buffer now
is always null-terminated.
2015-06-29 21:14:06 +03:00
Jason R. Coombs a95a476b3a Issue #20387: Merge test and patch from 3.4.4 2015-06-28 11:13:30 -04:00
Jason R. Coombs 50373e6c21 Issue #20387: Merge 2015-06-28 11:10:29 -04:00
Serhiy Storchaka b9b9e7b46a Issue #24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()
functions of the audioop module.
2015-06-28 17:55:33 +03:00
Serhiy Storchaka 449e2be12b Issue #24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()
functions of the audioop module.
2015-06-28 17:52:09 +03:00
Jason R. Coombs 80c29ac1ea Issue #20387: Merge patch and test 2015-06-28 10:23:11 -04:00
Serhiy Storchaka eab7704044 Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self".  Patch by Martin Panter.
2015-06-28 17:08:35 +03:00
Serhiy Storchaka 101ff3541c Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self".  Patch by Martin Panter.
2015-06-28 17:06:07 +03:00
Benjamin Peterson 4801383c29 upgrade to Unicode 8.0.0 2015-06-27 15:45:56 -05:00
Benjamin Peterson 7b78d4364d prevent integer overflow in escape_unicode (closes #24522) 2015-06-27 15:01:51 -05:00
Benjamin Peterson 758d60baaa merge 3.4 2015-06-27 14:26:21 -05:00
Benjamin Peterson acac1e0e3b merge 3.3 2015-06-27 14:26:15 -05:00
Benjamin Peterson dac3ab84c7 add issue number 2015-06-27 14:25:50 -05:00
Benjamin Peterson 7763c68dcd merge 3.4 2015-06-27 14:18:23 -05:00
Benjamin Peterson ff0f322edb merge 3.3 2015-06-27 13:56:46 -05:00
Benjamin Peterson 59b08c18a8 use safe allocation and reallocation macros 2015-06-27 13:41:33 -05:00
Jason R. Coombs d1d628d552 Issue #20387: Update Misc/NEWS 2015-06-26 17:45:09 -04:00
Antoine Pitrou a72f0cdaea Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:38:13 +02:00
Antoine Pitrou 6bc217dd3d Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). 2015-06-23 14:31:11 +02:00
Yury Selivanov 5376ba9630 Issue #24400: Introduce a distinct type for 'async def' coroutines.
Summary of changes:

1. Coroutines now have a distinct, separate from generators
   type at the C level: PyGen_Type, and a new typedef PyCoroObject.
   PyCoroObject shares the initial segment of struct layout with
   PyGenObject, making it possible to reuse existing generators
   machinery.  The new type is exposed as 'types.CoroutineType'.

   As a consequence of having a new type, CO_GENERATOR flag is
   no longer applied to coroutines.

2. Having a separate type for coroutines made it possible to add
   an __await__ method to the type.  Although it is not used by the
   interpreter (see details on that below), it makes coroutines
   naturally (without using __instancecheck__) conform to
   collections.abc.Coroutine and collections.abc.Awaitable ABCs.

   [The __instancecheck__ is still used for generator-based
   coroutines, as we don't want to add __await__ for generators.]

3. Add new opcode: GET_YIELD_FROM_ITER.  The opcode is needed to
   allow passing native coroutines to the YIELD_FROM opcode.

   Before this change, 'yield from o' expression was compiled to:

      (o)
      GET_ITER
      LOAD_CONST
      YIELD_FROM

   Now, we use GET_YIELD_FROM_ITER instead of GET_ITER.

   The reason for adding a new opcode is that GET_ITER is used
   in some contexts (such as 'for .. in' loops) where passing
   a coroutine object is invalid.

4. Add two new introspection functions to the inspec module:
   getcoroutinestate(c) and getcoroutinelocals(c).

5. inspect.iscoroutine(o) is updated to test if 'o' is a native
   coroutine object.  Before this commit it used abc.Coroutine,
   and it was requested to update inspect.isgenerator(o) to use
   abc.Generator; it was decided, however, that inspect functions
   should really be tailored for checking for native types.

6. sys.set_coroutine_wrapper(w) API is updated to work with only
   native coroutines.  Since types.coroutine decorator supports
   any type of callables now, it would be confusing that it does
   not work for all types of coroutines.

7. Exceptions logic in generators C implementation was updated
   to raise clearer messages for coroutines:

   Before: TypeError("generator raised StopIteration")
   After: TypeError("coroutine raised StopIteration")
2015-06-22 12:19:30 -04:00
Barry Warsaw 9380acbbf7 - Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
2015-06-09 14:22:44 -04:00
Barry Warsaw 17d5f47423 - Issue #24351: Clarify what is meant by "identifier" in the context of
string.Template instances.
2015-06-09 14:20:31 -04:00
Serhiy Storchaka 4fafda731a Issue #24408: Fixed AttributeError in measure() and metrics() methods of
tkinter.Font.
2015-06-08 18:43:55 +03:00
Serhiy Storchaka e7070f09bc Issue #14373: C implementation of functools.lru_cache() now can be used with
methods.
2015-06-08 11:19:24 +03:00
Steve Dower 93cfeb93ac Issue #8232: webbrowser support incomplete on Windows. Patch by Brandon Milam 2015-06-07 21:35:39 -07:00
Nick Coghlan 53f95024d7 Issue #24373: Eliminate PEP 489 test refleaks
_testmultiphase and xxlimited now use tp_traverse and
tp_finalize to avoid reference leaks encountered when
combining tp_dealloc with PyType_FromSpec (see
issue #16690 for details)
2015-06-04 21:52:57 +10:00
Eric Snow 4fabf02633 Issue #24369: Defend against key-changes during iteration. 2015-06-04 00:09:56 -06:00
Eric Snow db4061cb9d Issue #24377: Fix a ref leak in OrderedDict.__repr__. 2015-06-03 11:09:48 -06:00
Eric Snow 4c72918a59 Issue #24362: Simplify the C OrderedDict fast nodes resize logic. 2015-06-03 10:50:37 -06:00
Eric Snow ac02ef373f Issue #24368: Support keyword arguments in OrderedDict methods. 2015-06-02 20:42:14 -06:00
Eric Snow b952ab43f2 Issue #24359: Check for changed OrderedDict size during iteration. 2015-06-01 23:35:13 -06:00
Eric Snow d171975609 Issue #24348: Drop superfluous increfs/decrefs. 2015-06-01 23:12:13 -06:00
Eric Snow a762af74b2 Issue #24347: Set KeyError if PyDict_GetItemWithError returns NULL. 2015-06-01 22:59:08 -06:00
Benjamin Peterson 0969a9f8ab add Py_tp_finalize slot (closes #24345)
Patch from Petr Viktorin.
2015-06-01 10:12:48 -05:00
Serhiy Storchaka 55a57b0766 Moved Misc/NEWS entry (issue #24270) to correct section. 2015-06-01 09:46:57 +03:00
Larry Hastings c72056a1ae Merge release engineering changes with 3.5 branch head. 2015-05-31 21:43:57 -07:00
Larry Hastings 61eb146b22 Post-release updates for Python 3.5.0b2. 2015-05-31 21:42:35 -07:00
Tal Einat d5519ed7f4 Issue #19543: Implementation of isclose as per PEP 485
For details, see:
PEP 0485 -- A Function for testing approximate equality

Functions added: math.isclose() and cmath.isclose().

Original code by Chris Barker. Patch by Tal Einat.
2015-05-31 22:05:00 +03:00
Serhiy Storchaka d4ea03c785 Issue #24284: The startswith and endswith methods of the str class no longer
return True when finding the empty string and the indexes are completely out
of range.
2015-05-31 09:15:51 +03:00
Larry Hastings d200e0c072 Version bump for Python 3.5.0b2. 2015-05-30 17:00:48 -07:00
Yury Selivanov bf304fcb32 Issue #23934: Fix inspect.signature to fail correctly for builtin types.
Initial patch by James Powell.
2015-05-30 17:08:36 -04:00
Serhiy Storchaka 1b560cbf85 Issue #5633: Fixed timeit when the statement is a string and the setup is not.
Refactored timeit.__init__ for unified handling of stmt and setup parameters.
2015-05-30 19:44:55 +03:00
Serhiy Storchaka f28fa66351 Issue #5633: Fixed timeit when the statement is a string and the setup is not. 2015-05-30 19:38:26 +03:00
Yury Selivanov 7aa5341164 Reverting my previous commit.
Something went horribly wrong when I was doing `hg rebase`.
2015-05-30 10:57:56 -04:00
Serhiy Storchaka e90982111a Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
2015-05-30 17:48:54 +03:00
Serhiy Storchaka ac5569b1fa Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
2015-05-30 17:48:19 +03:00
Serhiy Storchaka fa494fd883 Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
2015-05-30 17:45:22 +03:00