]> granicus.if.org Git - python/log
python
7 years ago[2.7] bpo-32478: Add tests for 'break' and 'return' inside 'finally' clause. (GH...
Serhiy Storchaka [Tue, 2 Jan 2018 08:56:40 +0000 (10:56 +0200)]
[2.7] bpo-32478: Add tests for 'break' and 'return' inside 'finally' clause. (GH-5078). (#5084)

(cherry picked from commit 7cc42c356b0dc5ad9eaa9392789e84bd4aa1c7de)

7 years agobpo-32416: Add two new tests in test_sys_settrace. (GH-5072) (#5074)
Miss Islington (bot) [Mon, 1 Jan 2018 18:51:12 +0000 (10:51 -0800)]
bpo-32416: Add two new tests in test_sys_settrace. (GH-5072) (#5074)

Move other test to more proper place.
(cherry picked from commit e8ed96550c6aa9a1e39c36e67e892994e25e2c41)

7 years ago[2.7] Add missing backslashes in PCbuild bat files (GH-5056) (GH-5058)
Zachary Ware [Sun, 31 Dec 2017 00:34:46 +0000 (18:34 -0600)]
[2.7] Add missing backslashes in PCbuild bat files (GH-5056) (GH-5058)

(cherry picked from commit fe90efdc07ec70fd4ff28eac179448a41379cff1)

7 years agobpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)
Segev Finer [Fri, 29 Dec 2017 20:44:04 +0000 (22:44 +0200)]
bpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)

select.error doesn't have an errno attribute so access the errno by
indexing instead.

7 years ago[2.7] remove unused import (GH-5040). (#5043)
Benjamin Peterson [Fri, 29 Dec 2017 07:38:55 +0000 (23:38 -0800)]
[2.7] remove unused import (GH-5040). (#5043)

(cherry picked from commit e325608740bee161ca7fefd09463d63099efa1b8)

7 years agomake PatternCompiler use the packaged grammar if possible (more bpo-24960) (GH-5034...
Miss Islington (bot) [Fri, 29 Dec 2017 02:05:07 +0000 (18:05 -0800)]
make PatternCompiler use the packaged grammar if possible (more bpo-24960) (GH-5034) (#5037)

(cherry picked from commit e5f7dccefaa8d97ab53b3051acbb4a4d49379dc4)

7 years ago[2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991...
Serhiy Storchaka [Wed, 27 Dec 2017 19:32:03 +0000 (21:32 +0200)]
[2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991). (#5017)

(cherry picked from commit 53f9135667226f33e049e327db60fb033afbd77a)

7 years agocorrect wording (GH-4983) (#4985)
Miss Islington (bot) [Sat, 23 Dec 2017 05:49:49 +0000 (21:49 -0800)]
correct wording (GH-4983) (#4985)

(cherry picked from commit d11e8e0d11c759cd0f96aebb59de914e4d62b8cd)

7 years ago[2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (GH...
Benjamin Peterson [Fri, 22 Dec 2017 20:52:10 +0000 (12:52 -0800)]
[2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (GH-4977) (#4980)

This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist..
(cherry picked from commit 8a5877165e993afb2633cd48da5222326d3f6e0e)

7 years agocorrect the typos (GH-4950) (#4952)
Miss Islington (bot) [Thu, 21 Dec 2017 05:42:42 +0000 (21:42 -0800)]
correct the typos (GH-4950) (#4952)

(cherry picked from commit 83cb778b4a3f856f2243b0f0d36fefb5c44b388f)

7 years agopythoninfo: sync with master (#4843)
Victor Stinner [Wed, 13 Dec 2017 22:23:40 +0000 (23:23 +0100)]
pythoninfo: sync with master (#4843)

7 years agotrivial: link updates in documentation (GH-2765) (#4836)
Miss Islington (bot) [Wed, 13 Dec 2017 12:45:13 +0000 (04:45 -0800)]
trivial: link updates in documentation (GH-2765) (#4836)

(cherry picked from commit 4f29f3c84b74de8c208980a14bc56bffa6363121)

7 years agoFix improper use of re.escape() in tests. (GH-4814) (#4817)
Miss Islington (bot) [Tue, 12 Dec 2017 18:49:18 +0000 (10:49 -0800)]
Fix improper use of re.escape() in tests. (GH-4814) (#4817)

(cherry picked from commit b748e3b2586e44bfc7011b601bce9cc6d16d89f1)

7 years agobpo-30806: Fix netrc.__repr__() format (GH-2491)
Steven Loria [Sun, 10 Dec 2017 06:09:58 +0000 (01:09 -0500)]
bpo-30806: Fix netrc.__repr__() format (GH-2491)

netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc

7 years agobpo-32212: Updated logging documentation to make parameter names more consistent...
Vinay Sajip [Sat, 9 Dec 2017 12:49:10 +0000 (12:49 +0000)]
bpo-32212: Updated logging documentation to make parameter names more consistent with source. (GH-4765) (GH-4768)

(cherry picked from commit a9f8df646aac7fc94ced0aefd1ed2c8566d14d10)

7 years ago[2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651)
Nir Soffer [Thu, 7 Dec 2017 20:25:39 +0000 (22:25 +0200)]
[2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651)

In fileio, there were 3 fstat() calls and one lseek() call that did not
release the GIL during the call. This can cause all threads to hang for
unlimited time when using io.FileIO with inaccessible NFS server.

Same issue seen in fileio exists also in fileobject, fixed in the same
way.

7 years agoAdd a missing space in tkinter documentation. (GH-4692). (GH-4723)
Mariatta [Tue, 5 Dec 2017 05:15:57 +0000 (21:15 -0800)]
Add a missing space in tkinter documentation. (GH-4692). (GH-4723)

(cherry picked from commit ae342cf7deebdcf2035f4064609b32b2102dadcf)

7 years ago[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in...
Serhiy Storchaka [Sat, 2 Dec 2017 19:00:09 +0000 (21:00 +0200)]
[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) (#4676)

7 years agobpo-20891: Fix PyGILState_Ensure() (#4650) (#4657)
Victor Stinner [Thu, 30 Nov 2017 22:35:14 +0000 (23:35 +0100)]
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4657)

When PyGILState_Ensure() is called in a non-Python thread before
PyEval_InitThreads(), only call PyEval_InitThreads() after calling
PyThreadState_New() to fix a crash.

(cherry picked from commit b4d1e1f7c1af6ae33f0e371576c8bcafedb099db)

7 years agomake tags: index also Modules/_ctypes/ (#4648) (#4660)
Victor Stinner [Thu, 30 Nov 2017 22:28:01 +0000 (23:28 +0100)]
make tags: index also Modules/_ctypes/ (#4648) (#4660)

Avoid also "cd $(srcdir)" to not change the current directory.

(cherry picked from commit 3be3b97a9709d3cd5303175ddbffa7dcca57ac3e)

7 years ago[2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)
Barry Warsaw [Wed, 29 Nov 2017 15:34:40 +0000 (10:34 -0500)]
[2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)

Remove a flakey test and rewrite another one for readability.

7 years agobpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)
Miss Islington (bot) [Wed, 29 Nov 2017 15:29:54 +0000 (07:29 -0800)]
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)

(cherry picked from commit cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d)

7 years agobpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4623)
Miss Islington (bot) [Wed, 29 Nov 2017 00:15:43 +0000 (16:15 -0800)]
bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4623)

characters/bytes for non-negative n.  This makes it compatible with
read() methods of other file-like objects.
(cherry picked from commit 219c2de5ad0fdac825298bed1bb251f16956c04a)

7 years agopythoninfo: add Py_DEBUG (#4198) (#4581)
Victor Stinner [Mon, 27 Nov 2017 09:44:50 +0000 (10:44 +0100)]
pythoninfo: add Py_DEBUG (#4198) (#4581)

(cherry picked from commit afd055a59fe0291881fc2459215ce106e424da51)

7 years agobpo-30855: Bump Tcl/Tk to 8.5.19 on Windows (GH-4550)
Zachary Ware [Sun, 26 Nov 2017 17:55:46 +0000 (11:55 -0600)]
bpo-30855: Bump Tcl/Tk to 8.5.19 on Windows (GH-4550)

7 years agoImprove Scheduler Objects documentation. (GH-4556) (GH-4558)
Miss Islington (bot) [Sat, 25 Nov 2017 05:49:10 +0000 (21:49 -0800)]
Improve Scheduler Objects documentation. (GH-4556) (GH-4558)

Mention that the lower the priority number, the higher priority it represents.
(cherry picked from commit 9d5ec808de2c1359f434cc2fa8378458e4339c96)

7 years agobpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) (GH...
Miss Islington (bot) [Sat, 25 Nov 2017 05:01:39 +0000 (21:01 -0800)]
bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) (GH-4555)

The provided code example was supposed to find repeated words, however it returned false results.
(cherry picked from commit 610e5afdcbe3eca906ef32f4e0364e20e1b1ad23)

7 years agoImprove the String tutorial docs (GH-4541) (GH-4546)
Miss Islington (bot) [Fri, 24 Nov 2017 17:35:53 +0000 (09:35 -0800)]
Improve the String tutorial docs (GH-4541) (GH-4546)

The paragraph that contains example of string literal concatenation was placed
after the section about concatenation using the '+' sign.
Moved the paragraph to the appropriate section.
(cherry picked from commit 78a5722ae950b80a4b3d13377957f3932195aef3)

7 years agoExtending Python Doc minor updates (GH-4518) (GH-4536)
Miss Islington (bot) [Fri, 24 Nov 2017 08:55:33 +0000 (00:55 -0800)]
Extending Python Doc minor updates  (GH-4518) (GH-4536)

Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.
(cherry picked from commit cdfe910e746e1d0fc43429b8cc3384a65a19b358)

7 years agobpo-31626: Fix _PyObject_DebugReallocApi() (#4310)
Victor Stinner [Fri, 24 Nov 2017 01:13:26 +0000 (02:13 +0100)]
bpo-31626: Fix _PyObject_DebugReallocApi() (#4310)

_PyObject_DebugReallocApi() now calls Py_FatalError() if realloc()
fails to shrink a memory block.

Call Py_FatalError() because _PyObject_DebugReallocApi() erased freed
bytes *before* realloc(), expecting that realloc() *cannot* fail to
shrink a memory block.

7 years agobpo-31324: Optimize support._match_test() (#4523) (#4524)
Victor Stinner [Thu, 23 Nov 2017 17:34:59 +0000 (18:34 +0100)]
bpo-31324: Optimize support._match_test() (#4523) (#4524)

* bpo-31324: Optimize support._match_test() (#4421)

* Rename support._match_test() to support.match_test(): make it
  public
* Remove support.match_tests global variable. It is replaced with a
  new support.set_match_tests() function, so match_test() doesn't
  have to check each time if patterns were modified.
* Rewrite match_test(): use different code paths depending on the
  kind of patterns for best performances.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 803ddd8ce22f0de3ab42fb98a225a704c000ef06)

* bpo-31324: Fix test.support.set_match_tests(None) (#4505)

(cherry picked from commit bb11c3c967afaf263e00844d4ab461b7fafd6d36)
(cherry picked from commit 70b2f8797146a56a6880743424f0bedf4fc30c62)

7 years agotest_builtin: TestExecFile removes created file (#4525)
Victor Stinner [Thu, 23 Nov 2017 17:23:37 +0000 (18:23 +0100)]
test_builtin: TestExecFile removes created file (#4525)

Fix the following warning:

Warning -- files was modified by test_builtin
  Before: []
  After:  ['@test_19422_tmp']
1 test altered the execution environment:
    test_builtin

7 years agobpo-29512: Fix Lib/test/bisect.py shebang (#4522)
Victor Stinner [Thu, 23 Nov 2017 16:04:34 +0000 (17:04 +0100)]
bpo-29512: Fix Lib/test/bisect.py shebang (#4522)

Replace python3 with python2.

7 years agobpo-32050: Fix -x option documentation (#4423)
Victor Stinner [Mon, 20 Nov 2017 15:08:44 +0000 (07:08 -0800)]
bpo-32050: Fix -x option documentation (#4423)

The line number in correct when using the -x option: Py_Main() uses
ungetc() to not skip the first newline character.

7 years agoDocument parameters of BaseServer.finish_request() (GH-4445)
Masayuki Yamamoto [Sun, 19 Nov 2017 12:20:09 +0000 (21:20 +0900)]
Document parameters of BaseServer.finish_request() (GH-4445)

(cherry picked from commit 7750bded92d908cbc422c57b97214f8eec615b0d)

7 years agoFix typo in atexit documentation. (GH-4419) (GH-4442)
Erik Bray [Fri, 17 Nov 2017 13:57:54 +0000 (14:57 +0100)]
Fix typo in atexit documentation. (GH-4419) (GH-4442)

`kargs` -> `kwargs`

7 years agobpo-31691: Specify how to build installer in Windows (#4430)
native-api [Fri, 17 Nov 2017 00:28:42 +0000 (03:28 +0300)]
bpo-31691: Specify how to build installer in Windows (#4430)

7 years agobpo-15606: Improve the re.VERBOSE documentation. (GH-4366) (#4395)
Miss Islington (bot) [Tue, 14 Nov 2017 15:39:04 +0000 (07:39 -0800)]
bpo-15606: Improve the re.VERBOSE documentation. (GH-4366) (#4395)

(cherry picked from commit b0b44b4b3337297007f5ef87220a75df204399f8)

7 years ago[2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)
Gregory P. Smith [Sat, 11 Nov 2017 22:48:49 +0000 (14:48 -0800)]
[2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)

* Work around a GC process finalization bug.

The logging RLock instances may exist but the threading.RLock class
itself has already been emptied causing a
Exception TypeError: "'NoneType' object is not callable" in <function _removeHandlerRef ..."
to be printed to stderr on process termination.

This catches that exception and ignores it because there is absolutely
nothing we can or should do about it from the context of a weakref
handler called from the gc context.

7 years ago[2.7] bpo-31530: Stop crashes when iterating over a file on multiple threads. (#3672)
Serhiy Storchaka [Fri, 10 Nov 2017 10:58:55 +0000 (12:58 +0200)]
[2.7] bpo-31530: Stop crashes when iterating over a file on multiple threads. (#3672)

7 years ago[2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH address (GH...
Serhiy Storchaka [Thu, 9 Nov 2017 21:05:59 +0000 (23:05 +0200)]
[2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH address (GH-4235) (GH-4352) (#4355)

on NetBSD and DragonFly BSD.
(cherry picked from commit d3187158c09cf899e9849f335bdff10594209167).
(cherry picked from commit 596286f8f3c8e53ef010d6298464775dc900a515)

7 years agoFix a test for select.kevent. (#4349)
Serhiy Storchaka [Thu, 9 Nov 2017 17:04:47 +0000 (19:04 +0200)]
Fix a test for select.kevent. (#4349)

select.kevent objects are now comparable with other objects in Python 2.

7 years agoFix DeprecationWarning in tests (#4345)
Victor Stinner [Wed, 8 Nov 2017 22:45:55 +0000 (14:45 -0800)]
Fix DeprecationWarning in tests (#4345)

Define __hash__() in test_functools and test_itertools to fix the
following warning:

DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x

7 years ago[2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (...
xdegaye [Wed, 8 Nov 2017 16:10:16 +0000 (17:10 +0100)]
[2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). (#4342)

(cherry picked from commit 0de92859caf25e65fc968d4bb68626e9ba21b851)

7 years agobpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316)
Mazay0 [Wed, 8 Nov 2017 15:48:48 +0000 (22:48 +0700)]
bpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316)

Fix CCompiler.set_executable() of distutils to handle properly Unicode strings.

7 years agobpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is...
Oren Milman [Wed, 8 Nov 2017 09:57:02 +0000 (11:57 +0200)]
bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (GH-4333)

7 years agobpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)
Miss Islington (bot) [Tue, 7 Nov 2017 16:53:24 +0000 (08:53 -0800)]
bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)

(cherry picked from commit 5a66c8a64d180b5f3c80307924adaec53cc8faa3)

7 years agoFix a memory leak in _msi.c (GH-4127) (#4308)
Miss Islington (bot) [Tue, 7 Nov 2017 10:33:41 +0000 (02:33 -0800)]
Fix a memory leak in _msi.c (GH-4127) (#4308)

(cherry picked from commit cb04f7518292108d68e5ba4c685ca2bf2da18eab)

7 years agoFix bpo-27666 backporting error in _cursesmodule.c (#4305)
Serhiy Storchaka [Tue, 7 Nov 2017 07:55:33 +0000 (09:55 +0200)]
Fix bpo-27666 backporting error in _cursesmodule.c (#4305)

7 years agobpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more...
Miss Islington (bot) [Tue, 7 Nov 2017 00:44:19 +0000 (16:44 -0800)]
bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (GH-3968) (#4302)

(cherry picked from commit e56ab746a965277ffcc4396d8a0902b6e072d049)

7 years ago[2.7] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (GH-3201) (...
Oren Milman [Tue, 7 Nov 2017 00:17:54 +0000 (02:17 +0200)]
[2.7] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (GH-3201) (#3951)

7 years agobpo-31923: Fix spelling in sqlite3 docs (GH-4227)
Miss Islington (bot) [Sat, 4 Nov 2017 23:11:25 +0000 (16:11 -0700)]
bpo-31923: Fix spelling in sqlite3 docs (GH-4227)

(cherry picked from commit aafece7a9e010075fff4420cfbb16f1ec0342698)

7 years ago[2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430...
Serhiy Storchaka [Sat, 4 Nov 2017 08:42:56 +0000 (10:42 +0200)]
[2.7] bpo-18699: Corrected documentation for window.chgat in curses module (GH-1430). (#4272)

(cherry picked from commit b838cc3ff4e039af949c6a19bd896e98e944dcbe)

7 years ago[2.7] bpo-9678: Fix determining the MAC address in the uuid module. (GH-4264) (#4270)
Serhiy Storchaka [Sat, 4 Nov 2017 08:23:09 +0000 (10:23 +0200)]
[2.7] bpo-9678: Fix determining the MAC address in the uuid module. (GH-4264) (#4270)

* Using ifconfig on NetBSD and OpenBSD.
* Using arp on Linux, FreeBSD, NetBSD and OpenBSD.

Based on patch by Takayuki Shimizukawa..
(cherry picked from commit ee1a9a2b78d5b6bb1a8148fc5fcf365e6d4e9e67)

7 years agobpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4260)
Miss Islington (bot) [Fri, 3 Nov 2017 20:11:12 +0000 (13:11 -0700)]
bpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4260)

(cherry picked from commit a7723d8b09f516a2b75837a3527b8cc7bee89fad)

7 years ago[2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263)
Antoine Pitrou [Fri, 3 Nov 2017 19:36:39 +0000 (20:36 +0100)]
[2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263)

Bug report and patch by Jeroen Demeyer..
(cherry picked from commit f6f90ff079a22b79a58d47b6117cc8a8c7d366f3)

7 years agobpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220...
Miss Islington (bot) [Wed, 1 Nov 2017 19:24:00 +0000 (12:24 -0700)]
bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220) (#4222)

(cherry picked from commit 4f469c096628af730b17798d0ebfd8925bfde836)

7 years agobpo-31893: Fix a backporting error in 8cbf4e10646c3f5b8f0d274c2d7dea5bb6305f57. ...
Serhiy Storchaka [Wed, 1 Nov 2017 15:43:07 +0000 (17:43 +0200)]
bpo-31893: Fix a backporting error in 8cbf4e10646c3f5b8f0d274c2d7dea5bb6305f57. (#4219)

7 years agobpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)
Miss Islington (bot) [Wed, 1 Nov 2017 13:11:18 +0000 (06:11 -0700)]
bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)

(cherry picked from commit 894ebd065e02debf20c0657d26020ecc42b7534f)

7 years agoFix test_socket.test_create_connection() (GH-4206) (#4209)
Miss Islington (bot) [Wed, 1 Nov 2017 13:08:40 +0000 (06:08 -0700)]
Fix test_socket.test_create_connection() (GH-4206) (#4209)

bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.
(cherry picked from commit 280c22a82a6756e9caffef031c564fd98f1b50e7)

7 years agobpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4213)
Miss Islington (bot) [Wed, 1 Nov 2017 12:36:48 +0000 (05:36 -0700)]
bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4213)

Modify the code to use ncurses is_pad() instead of checking WINDOW
_flags field.  If your platform does not provide the is_pad(), the
existing way that checks the field will be enabled.

Note: This change does not drop support for platforms where do not
have both WINDOW _flags field and is_pad().
(cherry picked from commit 8bc7d63560024681dce9f40445f2877b2987e92c)

7 years agobpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (GH-4196) (#4202)
Miss Islington (bot) [Tue, 31 Oct 2017 18:16:11 +0000 (11:16 -0700)]
bpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (GH-4196) (#4202)

* Fix a compilation error on FreeBSD.
* Fix the data attribute size on Mac OS X.
(cherry picked from commit 2298fad5ff907dd48ea0fb5c71fa22334ef28c6b)

7 years agobpo-20064: Document PyObject_Malloc() (#4204)
Victor Stinner [Tue, 31 Oct 2017 17:08:28 +0000 (10:08 -0700)]
bpo-20064: Document PyObject_Malloc() (#4204)

Document the following functions:

* PyObject_Malloc()
* PyObject_Realloc()
* PyObject_Free()

Document also the pymalloc allocator.

7 years ago[2.7] bpo-31893: Fixed select.kqueue(). (GH-4166) (#4193)
Serhiy Storchaka [Tue, 31 Oct 2017 14:13:52 +0000 (16:13 +0200)]
[2.7] bpo-31893: Fixed select.kqueue(). (GH-4166) (#4193)

* Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD.
* Fixed the comparison of the kqueue_event objects..
(cherry picked from commit b9052a0f91d2e83bbc27267247a5920c82b242a3)

7 years ago[2.7] bpo-31891: Fix building the curses module on NetBSD. (GH-4165). (#4194)
Serhiy Storchaka [Tue, 31 Oct 2017 14:12:35 +0000 (16:12 +0200)]
[2.7] bpo-31891: Fix building the curses module on NetBSD. (GH-4165). (#4194)

(cherry picked from commit baac01e629d90f63dfde6b5cc433f4bc65c5feeb)

7 years agobpo-31629: Add support.SaveSignals (#4183) (#4188)
Victor Stinner [Tue, 31 Oct 2017 10:44:55 +0000 (03:44 -0700)]
bpo-31629: Add support.SaveSignals (#4183) (#4188)

test_curses now saves/restores signals. On FreeBSD, the curses module
sets handlers of some signals, but don't restore old handlers when
the module is deinitialized.

(cherry picked from commit 19f68301a1295a9c30d9f28b8f1479cdcccd75aa)

7 years ago[2.7] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH...
Serhiy Storchaka [Sun, 29 Oct 2017 10:25:38 +0000 (12:25 +0200)]
[2.7] bpo-20047: Make bytearray methods partition() and rpartition() rejecting (GH-4158) (#4163)

separators that are not bytes-like objects..
(cherry picked from commit a2314283ff87c65e1745a42c2f2b716b1a209128)

7 years agobpo-30855: Fix winfo_id related Tkinter test on Windows. (#4121)
Serhiy Storchaka [Wed, 25 Oct 2017 21:28:02 +0000 (00:28 +0300)]
bpo-30855: Fix winfo_id related Tkinter test on Windows. (#4121)

7 years agofix marshal uninitialized variable warnings (#4114)
Benjamin Peterson [Wed, 25 Oct 2017 06:09:55 +0000 (23:09 -0700)]
fix marshal uninitialized variable warnings (#4114)

GCC says:
../cpython/Python/marshal.c: In function ‘PyMarshal_WriteLongToFile’:
../cpython/Python/marshal.c:70:35: warning: ‘wf.ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                       else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
                                   ^~
../cpython/Python/marshal.c:70:47: warning: ‘wf.end’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                       else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
                                               ^~
../cpython/Python/marshal.c:77:10: warning: ‘wf.str’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (p->str == NULL)
         ~^~~~~

This isn't a real problem because if the file pointer is not NULL, the
string-related fields are never touched. But, it doesn't hurt to set the unused
fields to NULL.

7 years ago[2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH...
Serhiy Storchaka [Tue, 24 Oct 2017 20:35:22 +0000 (23:35 +0300)]
[2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on OpenBSD. (GH-4111). (#4112)

(cherry picked from commit f52dff611cff2fb9e90340b4787eda50ab2d40c6)

7 years ago[2.7] bpo-31667: Fix gettext related links. (GH-3860) (#4100)
Serhiy Storchaka [Tue, 24 Oct 2017 07:59:17 +0000 (10:59 +0300)]
[2.7] bpo-31667: Fix gettext related links. (GH-3860) (#4100)

* Fix incorrect links.
* Remove redundant links.
* Add signatures and index entries for gettext related
functions in the locale module.
(cherry picked from commit c02a1f4ad8fcdbffad2911c5a31c71a17a89d713)

7 years ago[2.7] bpo-31752: Fix possible crash in timedelta constructor called with custom integ...
Serhiy Storchaka [Mon, 23 Oct 2017 16:57:04 +0000 (19:57 +0300)]
[2.7] bpo-31752: Fix possible crash in timedelta constructor called with custom integers. (GH-3947) (#4088)

Bad remainder in divmod() in intermediate calculations caused an assertion failure..
(cherry picked from commit 4ffd4653a7ec9c97775472276cf5e159e2366bb2)

7 years ago[2.7] bpo-28286: Add tests for the mode argument of GzipFile. (GH-4074). (#4077)
Serhiy Storchaka [Sun, 22 Oct 2017 11:54:05 +0000 (14:54 +0300)]
[2.7] bpo-28286: Add tests for the mode argument of GzipFile. (GH-4074). (#4077)

(cherry picked from commit bcbdd2f8db396c3f0ec9186162b39b5a34effa0e)

7 years agoFix py3k warnings in 1/0 in tests. (#4072)
Serhiy Storchaka [Sun, 22 Oct 2017 09:15:41 +0000 (12:15 +0300)]
Fix py3k warnings in 1/0 in tests. (#4072)

7 years agoUpdate TestCase.assertAlmostEqual and assertNotAlmostEqual docstrings. (GH-3998)...
Miss Islington (bot) [Wed, 18 Oct 2017 17:30:05 +0000 (10:30 -0700)]
Update TestCase.assertAlmostEqual and assertNotAlmostEqual docstrings. (GH-3998) (GH-4040)

The word "difference" from missing the sentence.
This clarifies that it compares the difference between the two objects.
(cherry picked from commit 032a6480e360427d4f964e31643604fad804ea14)

7 years ago[2.7] bpo-31334: Fix timeout in select.poll.poll() (GH-3277) (#4034)
Riccardo Coccioli [Wed, 18 Oct 2017 12:04:04 +0000 (14:04 +0200)]
[2.7] bpo-31334: Fix timeout in select.poll.poll() (GH-3277) (#4034)

Always pass -1, or INFTIM where defined, to the poll() system call when
a negative timeout is passed to the poll.poll([timeout]) method in the
select module. Various OSes throw an error with arbitrary negative
values..
(cherry picked from commit 6cfa927ceb931ad968b5b03e4a2bffb64a8a0604)

7 years ago[2.7] bpo-31786: Make functions in the select module blocking when timeout is a small...
Serhiy Storchaka [Wed, 18 Oct 2017 08:28:35 +0000 (11:28 +0300)]
[2.7] bpo-31786: Make functions in the select module blocking when timeout is a small negative value. (GH-4003). (#4031)

(cherry picked from commit 2c15b29aea5d6b9c61aa42d2c24a07ff1edb4b46)

7 years ago[2.7] bpo-31733, bpo-31692: Document 2 new env vars in What's New in Python 2.7 ...
Victor Stinner [Tue, 17 Oct 2017 20:13:13 +0000 (13:13 -0700)]
[2.7] bpo-31733, bpo-31692: Document 2 new env vars in What's New in Python 2.7 (GH-4019)

bpo-31733, bpo-31692: Document the new PYTHONSHOWREFCOUNT and
PYTHONSHOWALLOCCOUNT environment variables.

7 years ago[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
Victor Stinner [Tue, 17 Oct 2017 09:25:23 +0000 (02:25 -0700)]
[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)

bpo-31692, bpo-19527:

* Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
  the Python 3 "-X showalloccount" option
* When Python is compiled with COUNT_ALLOCS, the new
  PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
  allocation counts into stderr on shutdown. Moreover, allocations
  statistics are now dumped into stderr rather than stdout.
* Add @test.support.requires_type_collecting decorator: skip test if
  COUNT_ALLOCS is defined
* Fix tests for COUNT_ALLOCS: decorate some methods with
  @requires_type_collecting
* test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
  is defined

7 years agobpo-31733: Add PYTHONSHOWREFCOUNT env var (GH-3932)
Victor Stinner [Tue, 17 Oct 2017 08:35:19 +0000 (01:35 -0700)]
bpo-31733: Add PYTHONSHOWREFCOUNT env var (GH-3932)

Add a new PYTHONSHOWREFCOUNT environment variable. In debug mode,
Python now only print the total reference count if PYTHONSHOWREFCOUNT
is set.

7 years ago[2.7] bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides (GH-3993)
vyas45 [Mon, 16 Oct 2017 18:23:43 +0000 (11:23 -0700)]
[2.7] bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides (GH-3993)

7 years ago[2.7] bpo-30058: Fixed buffer overflow in select.kqueue.control(). (GH-1095). (#3976)
Serhiy Storchaka [Thu, 12 Oct 2017 21:13:11 +0000 (00:13 +0300)]
[2.7] bpo-30058: Fixed buffer overflow in select.kqueue.control(). (GH-1095). (#3976)

(cherry picked from commit de072100775cc29e6cd93a75466cecbd1086f258)

7 years agobpo-31766: restore 3.5 to docs version switchers (#3971)
Ned Deily [Thu, 12 Oct 2017 18:24:23 +0000 (14:24 -0400)]
bpo-31766: restore 3.5 to docs version switchers (#3971)

7 years ago[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is...
Oren Milman [Thu, 12 Oct 2017 14:39:01 +0000 (17:39 +0300)]
[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3952)

7 years ago[2.7] bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of Element...
Oren Milman [Wed, 11 Oct 2017 13:29:12 +0000 (16:29 +0300)]
[2.7] bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of Element.text and Element.tail (GH-3924) (#3950)

7 years agobpo-31681: Make sure pkgutil.get_data closes files properly (#3875)
Elvis Pranskevichus [Mon, 9 Oct 2017 14:55:54 +0000 (10:55 -0400)]
bpo-31681: Make sure pkgutil.get_data closes files properly (#3875)

Also remove an obsolete note about
backward compat with old Pythons.

7 years agobpo-31719: Fix test_regrtest.test_crashed() on s390x (#3912)
Victor Stinner [Mon, 9 Oct 2017 07:52:06 +0000 (00:52 -0700)]
bpo-31719: Fix test_regrtest.test_crashed() on s390x (#3912)

Add a new _testcapi._read_null() function to crash Python in a
reliable way on s390x.

On s390x, ctypes.string_at(0) returns an empty string rather than
crashing.

7 years agobpo-31720: msilib documentation, change MsiError into MSIError (GH-3914) (GH-3916)
Miss Islington (bot) [Sat, 7 Oct 2017 16:00:42 +0000 (09:00 -0700)]
bpo-31720: msilib documentation, change MsiError into MSIError (GH-3914) (GH-3916)

(cherry picked from commit 28f713601d3ec80820e842dcb25a234093f1ff18)

7 years agobpo-31507: Add docstring to parseaddr function in email.utils.parseaddr (GH-3647...
Rohit Balasubramanian [Sat, 7 Oct 2017 05:29:54 +0000 (10:59 +0530)]
bpo-31507: Add docstring to parseaddr function in email.utils.parseaddr (GH-3647) (GH-3735)

(cherry picked from commit 9e7b9b21fe45f7d93eaf9382fedfa18247d0d2b2)

7 years ago[2.7] remove tabs from getcompiler.c (GH-3892) (#3894)
Miss Islington (bot) [Thu, 5 Oct 2017 15:41:31 +0000 (08:41 -0700)]
[2.7] remove tabs from getcompiler.c (GH-3892) (#3894)

(cherry picked from commit a8ed11742b4c2115597977ce04fa8e043d9e0792)

7 years ago[2.7] bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and split() (GH...
Serhiy Storchaka [Wed, 4 Oct 2017 18:37:53 +0000 (21:37 +0300)]
[2.7] bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and split() (GH-3866) (#3876)

when pass a string larger than 2 GiB.

Decrease memory requirements for Tcl's bigmem tests..
(cherry picked from commit 27c623c845dd6e4b8e1782666ca3a956636da266)

7 years agoRemove retired and security branches from active docs (#3881)
Ned Deily [Wed, 4 Oct 2017 03:06:13 +0000 (23:06 -0400)]
Remove retired and security branches from active docs (#3881)

7 years ago[2.7] bpo-31478: Prevent unwanted behavior in _random.Random.seed() in case the arg...
Oren Milman [Mon, 2 Oct 2017 21:31:42 +0000 (00:31 +0300)]
[2.7] bpo-31478: Prevent unwanted behavior in _random.Random.seed() in case the arg has a bad __abs__() method (GH-3596) (#3845)

7 years agobpo-31158: Fix nondeterministic read in test_pty (#3808) (#3853)
Victor Stinner [Mon, 2 Oct 2017 09:58:09 +0000 (02:58 -0700)]
bpo-31158: Fix nondeterministic read in test_pty (#3808) (#3853)

(cherry picked from commit e6f62f69f07892b993910ff03c9db3ffa5cb9ca5)

7 years ago[2.7] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) (#3838)
Serhiy Storchaka [Sat, 30 Sep 2017 19:52:25 +0000 (22:52 +0300)]
[2.7] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) (#3838)

(cherry picked from commit f4ea642cb60556231e714089a79d3c59c202661e)

7 years ago[2.7] bpo-31285: Don't raise a SystemError in warnings.warn_explicit() in case __load...
Oren Milman [Sat, 30 Sep 2017 14:06:55 +0000 (17:06 +0300)]
[2.7] bpo-31285: Don't raise a SystemError in warnings.warn_explicit() in case __loader__.get_source() has a bad splitlines() method. (GH-3219) (#3823)

(cherry picked from commit 91fb0af)

7 years agobpo-28129: fix ctypes crashes (#386) (#3800)
Victor Stinner [Thu, 28 Sep 2017 14:31:40 +0000 (07:31 -0700)]
bpo-28129: fix ctypes crashes (#386) (#3800)

* init commit, with initial tests for from_param and fields __set__ and __get__, and some additions to from_buffer and from_buffer_copy

* added the rest of tests and patches. probably only a first draft.

* removed trailing spaces

* replace ctype with ctypes in error messages

* change back from ctypes instance to ctype instance

(cherry picked from commit 1bea762d9ec823544c530d567330a47f64d93d4f)

7 years agobpo-31593: test_socketserver waits child processes (#3786)
Victor Stinner [Wed, 27 Sep 2017 10:02:57 +0000 (03:02 -0700)]
bpo-31593: test_socketserver waits child processes (#3786)

7 years ago[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is...
Miss Islington (bot) [Wed, 27 Sep 2017 06:52:44 +0000 (23:52 -0700)]
[2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3780)

(cherry picked from commit 30b61b51e05d2d43e8e2e783b0a9df738535423b)

7 years ago[2.7] bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in...
Serhiy Storchaka [Wed, 27 Sep 2017 06:24:39 +0000 (09:24 +0300)]
[2.7] bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in case of a bad __dict__. (GH-3254). (#3781)

(cherry picked from commit 57c2561c8c5663aef55b00e3f29cba575ff36ccd)