Commit Graph

102317 Commits

Author SHA1 Message Date
Julien Palard b6b77955f2 [3.7] Doc: Disable smartquotes for zh-tw, zh-cn, fr and ja translations (GH-9423) (GH-10344)
(cherry picked from commit c03bf0ae79)
2018-12-08 21:56:59 -08:00
Julien Palard 2db96ae744 [3.7] Doc: Bump sphinx. (GH-10676) (GH-10803) 2018-12-09 00:21:54 -05:00
Miss Islington (bot) 8b7d8ac09c
bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.

In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.

In addition, check if the list changed size in the loop in array_array_fromlist().
(cherry picked from commit 99d56b5356)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-08 06:34:49 -08:00
Miss Islington (bot) ee2c5a8e2d bpo-35330: Don't call the wrapped object if `side_effect` is set (GH11035)
* tests: Further validate `wraps` functionality in `unittest.mock.Mock`

Add more tests to validate how `wraps` interacts with other features of
mocks.

* Don't call the wrapped object if `side_effect` is set

When a object is wrapped using `Mock(wraps=...)`, if an user sets a
`side_effect` in one of their methods, return the value of `side_effect`
and don't call the original object.

* Refactor what to be called on `mock_call`

When a `Mock` is called, it should return looking up in the following
order: `side_effect`, `return_value`, `wraps`. If any of the first two
return `mock.DEFAULT`, lookup in the next option.

It makes no sense to check for `wraps` returning default, as it is
supposed to be the original implementation and there is nothing to
fallback to.
(cherry picked from commit f05df0a4b6)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-12-08 11:47:01 +00:00
Victor Stinner 783b794a5e
Revert "[3.7] bpo-34977: Add Windows App Store package (GH-10245)" (GH-11021)
This reverts commit 2532091493.
2018-12-07 14:31:40 +01:00
Serhiy Storchaka 0d5730e643
[3.7] bpo-22005: Fixed unpickling instances of datetime classes pickled by Python 2. (GH-11017) (GH-11022)
encoding='latin1' should be used for successful decoding.
(cherry picked from commit 8452ca15f4)
2018-12-07 14:56:02 +02:00
Zackery Spytz 602d307ac5 bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7)
2018-12-07 14:17:43 +02:00
Miss Islington (bot) 2db190bb35
bpo-34864: warn if "Prefer tabs when opening documents" set to "Always" (GH-10464)
* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe8794f0)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-12-06 22:51:10 -08:00
Steve Dower 2532091493
[3.7] bpo-34977: Add Windows App Store package (GH-10245) 2018-12-06 21:09:53 -08:00
Miss Islington (bot) 72c71956ca
Add missing period in distutils.dep_util.newer_group doc (GH-11003)
(cherry picked from commit c9566b8c45)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-06 13:30:13 -08:00
Miss Islington (bot) f913d44eb7
Clarify expectedFailure in the unittest docs. (GH-10953)
(cherry picked from commit 91f259b478)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-12-06 13:16:03 -08:00
Miss Islington (bot) 6485aa6eb1
bpo-33023: Fix NotImplemented to NotImplementedError. (GH-10934)
(cherry picked from commit 42b1d6127b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-06 12:52:43 -08:00
Miss Islington (bot) 560fa4db17
bpo-35363: test_eintr uses print(flush=True) (GH-10990)
(cherry picked from commit 0644b33821)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-06 05:34:59 -08:00
Miss Islington (bot) b7c67c4d51
bpo-35424: test_multiprocessing: join 3 pools (GH-10986)
Join 3 pools in these tests:

* test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback
(cherry picked from commit 388c8c208d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-06 03:20:50 -08:00
Miss Islington (bot) f740818f3d
bpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii character. (GH-10863)
(cherry picked from commit 3ffa8b9ba1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-06 01:58:24 -08:00
Terry Jan Reedy de8037db8c
[3.7] bpo-34162: Update idlelib NEWS to 2018-12-05 (GH-10964) (GH-10980)
Cherry-picked from 6ea9d54.
2018-12-06 03:25:40 -05:00
Miss Islington (bot) b1438c0d37
bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)
(cherry picked from commit 8752dfbd1f)

Co-authored-by: native-api <ivan_pozdeev@mail.ru>
2018-12-05 23:22:17 -08:00
Victor Stinner 3c6b0d967e
[3.7] Revert "bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450) (GH-9676)" (#10968)
This reverts commit 97f998a4df.
2018-12-06 01:49:05 +01:00
Mariatta c28317e4c2 [3.7] Fix typo in xml.dom.minidom documentation (GH-10956) (GH-10961)
Escape the \t and \n.
Follow up from https://github.com/python/cpython/pull/10814..
(cherry picked from commit 2d8f976cde)

Co-authored-by: E Kawashima <e-kwsm@users.noreply.github.com>
2018-12-05 16:24:44 -08:00
Miss Islington (bot) 0fc3b2fe01
bpo-35363: test_eintr runs eintr_tester.py in verbose mode (GH-10965)
Moreover, "python3 -m test test_eintr -v" now avoids redirecting
stdout/stderr to a pipe, the child process inherits stdout/stderr
from the parent.
(cherry picked from commit aa8ae904ad)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-05 15:35:43 -08:00
Miss Islington (bot) 022d7bc7cc
Fix typos in concurrent.Futures documentation (GH-10920)
Add a missing word `as` in `as well as an`.
Linkify `threading.Thread`.
(cherry picked from commit 40a61da40d)

Co-authored-by: Matt Wheeler <m@funkyhat.org>
2018-12-05 14:17:28 -08:00
Miss Islington (bot) 3451078190
bpo-35310: Clear select() lists before returning upon EINTR (GH-10877)
select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415a6d)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
2018-12-05 13:31:07 -08:00
Serhiy Storchaka ac8b47c8b4
bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165). (GH-10947)
(cherry picked from commit 34c7f0c04e)

Co-authored-by: William Grzybowski <wg@FreeBSD.org>
2018-12-05 23:23:06 +02:00
Serhiy Storchaka 1de91a0032
bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946)
(cherry picked from commit 5b25f1d031)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-12-05 23:09:56 +02:00
Miss Islington (bot) 53bed18d93
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
(cherry picked from commit 67a93b3a0b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-05 12:29:31 -08:00
Miss Islington (bot) 349d9910b2
Correct a couple of unbalanced parenthesis. (GH-10779)
(cherry picked from commit 55f41e45b4)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-05 12:15:54 -08:00
Miss Islington (bot) d2c7c1f768
Move __missing__ after __delitem__ in Data model. (GH-10923)
(cherry picked from commit 1ce853f377)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2018-12-05 12:11:16 -08:00
Miss Islington (bot) c7c4e938b9
bpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)
When running test_bdb.py as a script, `import test_module` would be
importing the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.
(cherry picked from commit 54fd45505b)

Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
2018-12-05 11:54:42 -08:00
Miss Islington (bot) e2f376f284
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)
(cherry picked from commit 25d389789c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-05 11:35:41 -08:00
Miss Islington (bot) 983d1ab0e6
bpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919)
* posixpath.expanduser() now returns the input path unchanged if
  the HOME environment variable is not set and pwd.getpwuid() raises
  KeyError (the current user identifier doesn't exist in the password
  database).
* Add test_no_home_directory() to test_site.
(cherry picked from commit f2f4555d82)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-05 08:07:57 -08:00
Miss Islington (bot) 2d594f8578
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
(cherry picked from commit 2a893430c9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-04 23:51:08 -08:00
Victor Stinner c93e3b05d5
bpo-35363, test_eintr: skip test_open() on macOS (GH-10896) (GH-10911)
(cherry picked from commit 4752e65250)
2018-12-05 03:03:28 +01:00
Miss Islington (bot) 74a80e1ed0
bpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)
On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".

test.pythoninfo now also logs TRAVIS environment variable.
(cherry picked from commit c11b3b19a5)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-04 17:16:39 -08:00
Victor Stinner b02774f421
bpo-35296: make install now installs the internal API (GH-10665) (GH-10897)
* bpo-35296: make install now installs the internal API (GH-10665)

make install now also installs the internal API: Include/internal/*.h
header files.

(cherry picked from commit f653fd4d95)

* Windows installer now also install Include/internal/

The Windows installer (MSI) now also install header files of the
Include/internal/ subdirectory.
2018-12-04 21:28:28 +01:00
Miss Islington (bot) 0091f349cd bpo-29564: warnings suggests to enable tracemalloc (GH-10486) (GH-10509)
The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.
(cherry picked from commit 2c07c493d2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-04 21:25:57 +01:00
Miss Islington (bot) 1751423686
bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.
(cherry picked from commit f92c7aa1ae)

Co-authored-by: stratakis <cstratak@redhat.com>
2018-12-04 07:06:16 -08:00
Miss Islington (bot) 12735c1413 bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (GH-10873) (#10887)
Fix minor typo in test function name.
(cherry picked from commit e63e617ebb)

Co-authored-by: Andrew Dunai <andunai@gmail.com>
2018-12-04 09:34:34 +00:00
Miss Islington (bot) 6627d3ae1e
bpo-35395: fix typos in asyncio eventloop documentation (GH-10880)
Fixes `loop.add_writer` and `loop.add_signal_handler` method documentation to correctly reference the callback parameter from method signature.

https://bugs.python.org/issue35395
(cherry picked from commit 1747334794)

Co-authored-by: Naglis <naglis@users.noreply.github.com>
2018-12-03 23:36:31 -08:00
Victor Stinner 5eb78c7512
[3.7] bpo-35373: Fix PyInit_timezone() error handling (GH-10864)
* bpo-35373: Fix PyInit_timezone() error handling

PyInit_timezone() now returns -1 at exit if an exception is raised.
Check also explicitly PyUnicode_DecodeLocale() and Py_BuildValue()
errors.

* bpo-35373: Fix PyInit_time() error handling (GH-10865)

* PyInit_time() now returns NULL if an exception is raised.
* Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is
  a special prefix for function initializing a module.
  init_timezone() doesn't initialize a module and the function is not
  exported.

(cherry picked from commit 3bb150d814)
2018-12-04 00:09:02 +01:00
Miss Islington (bot) e8f9e4785c bpo-35226: Fix equality for nested unittest.mock.call objects. (GH-10555)
Also refactor the call recording imolementation and add some notes
about its limitations.
(cherry picked from commit 8ca0fa9d2f)

Co-authored-by: Chris Withers <chris@withers.org>
2018-12-03 21:54:44 +00:00
Miss Islington (bot) fe91e9ba08 [3.7] bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867) (GH-10872)
* bpo-35380: Enable TCP_NODELAY for proactor event loop (GH-10867)
(cherry picked from commit 3bc0ebab17)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-12-03 23:11:41 +02:00
Miss Islington (bot) a9f435e5d8
bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(). (GH-10853)
Use "ll" instead of the nonstandard "q".
(cherry picked from commit 062cbb6772)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-12-03 01:11:30 -08:00
Miss Islington (bot) bdeb56cd21
bpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)
(cherry picked from commit 4013c17911)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-03 01:09:11 -08:00
Miss Islington (bot) 1ef06c62d3 bpo-32153: Add unit test for create_autospec with partial function returned in getattr (GH-10398) (#10855)
* Add create_autospec with partial function returned in getattr

* Use self.assertFalse instead of assert

* Use different names and remove object
(cherry picked from commit c667b094ae)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-12-03 08:26:06 +00:00
Miss Islington (bot) 6cb0486ce8
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)
(cherry picked from commit 68b56d02ef)

Co-authored-by: Ismo Toijala <ismo.toijala@gmail.com>
2018-12-02 08:14:44 -08:00
Miss Islington (bot) 265b41996a
bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)
(cherry picked from commit 32bc11c33c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-12-01 04:52:04 -08:00
E Kawashima 7da9755021 [3.7] Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814). (GH-10824)
(cherry picked from commit b7c2182604)
2018-12-01 14:19:39 +02:00
Miss Islington (bot) 422c1658b7
bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)
(cherry picked from commit edeca92c84)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-12-01 02:24:47 -08:00
Victor Stinner 38c06d9193
get_gmtoff() now returns time_t (GH-10838) (GH-10839)
get_gmtoff() now returns time_t instead of int to fix the following
Visual Studio warning:

    Modules\timemodule.c(1183): warning C4244: 'return':
    conversion from 'time_t' to 'int', possible loss of data

(cherry picked from commit 503ce5c482)
2018-12-01 01:24:21 +01:00
Victor Stinner 38bed786a2
[3.7] bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826) (GH-10834)
* bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)

Modify asyncio tests to utilize the certificates from the test directory
instead of its own set, as they are the same and with each update they had
to be updated as well.

(cherry picked from commit b062ba77b6)

* bpo-35352: Cleanup test_asyncio/utils.py (GH-10831)

'here' variable is no longer needed.

(cherry picked from commit 7212148c95)
2018-11-30 20:44:27 +01:00