summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)Anthony Sottile2019-02-2516-65/+19
|
* Autospec functions should propagate mock calls to parent GH-11273Xtreak2019-02-252-0/+21
|
* Merge tag 'v3.8.0a2'Łukasz Langa2019-02-251-4/+8
|\ | | | | | | Python 3.8.0a2
| * v3.8.0a2v3.8.0a2Łukasz Langa2019-02-251-4/+8
| |
* | bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-257-25/+143
|/ | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-33671: allow setting shutil.copyfile() bufsize globally (GH-12016)Giampaolo Rodola2019-02-241-1/+3
|
* bpo-36018: Add properties for mean and stdev (GH-12022)Raymond Hettinger2019-02-242-0/+16
| | | | | | | | | | | | Responding to suggestions on the tracker and some off-line suggestions. Davin suggested that english named accessors instead of greek letters would result in more intelligible user code. Steven suggested that the parameters still need to be *mu* and *theta* which are used elsewhere (and I noted those parameter names are used in linked-to resources). Michael suggested proving-out the API by seeing whether it generalized to *Lognormal*. I did so and found that Lognormal distribution parameters *mu* and *sigma* do not represent the mean and standard deviation of the lognormal distribution (instead, they are for the underlying regular normal distribution). Putting these ideas together, we have NormalDist parameterized by *mu* and *sigma* but offering English named properties for accessors. That gives lets us match other API that access mu and sigma, it matches the external resources on the topic, gives us clear english names in user code. The API extends nicely to LogNormal where the parameters and the summary statistic accessors are not the same. https://bugs.python.org/issue36018
* bpo-35512: Resolve string target to patch.dict decorator during function ↵Xtreak2019-02-243-2/+22
| | | | | | | | | | | | | | call GH#12000 * Resolve string target to patch.dict during function call * Add NEWS entry * Remove unneeded call * Restore original value for support.target and refactor assertions * Add extra assertion to verify unpatched dict
* bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk ↵Ned Deily2019-02-241-1/+6
| | | | (GH-12011)
* bpo-36018: Make __pos__ return a distinct instance of NormDist (GH-12009)Raymond Hettinger2019-02-242-1/+13
| | | https://bugs.python.org/issue36018
* bpo-35813: Tests and docs for shared_memory (#11816)Davin Potts2019-02-243-352/+677
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added tests for shared_memory submodule. * Added tests for ShareableList. * Fix bug in allocationn size during creation of empty ShareableList illuminated by existing test run on Linux. * Initial set of docs for shared_memory module. * Added docs for ShareableList, added doctree entry for shared_memory submodule, name refactoring for greater clarity. * Added examples to SharedMemoryManager docs, for ease of documentation switched away from exclusively registered functions to some explicit methods on SharedMemoryManager. * Wording tweaks to docs. * Fix test failures on Windows. * Added tests around SharedMemoryManager. * Documentation tweaks. * Fix inappropriate test on Windows. * Further documentation tweaks. * Fix bare exception. * Removed __copyright__. * Fixed typo in doc, removed comment. * Updated SharedMemoryManager preliminary tests to reflect change of not supporting all registered functions on SyncManager. * Added Sphinx doctest run controls. * CloseHandle should be in a finally block in case MapViewOfFile fails. * Missed opportunity to use with statement. * Switch to self.addCleanup to spare long try/finally blocks and save one indentation, change to use decorator to skip test instead. * Simplify the posixshmem extension module. Provide shm_open() and shm_unlink() functions. Move other functionality into the shared_memory.py module. * Added to doc around size parameter of SharedMemory. * Changed PosixSharedMemory.size to use os.fstat. * Change SharedMemory.buf to a read-only property as well as NamedSharedMemory.size. * Marked as provisional per PEP411 in docstring. * Changed SharedMemoryTracker to be private. * Removed registered Proxy Objects from SharedMemoryManager. * Removed shareable_wrap(). * Removed shareable_wrap() and dangling references to it. * For consistency added __reduce__ to key classes. * Fix for potential race condition on Windows for O_CREX. * Remove unused imports. * Update access to kernel32 on Windows per feedback from eryksun. * Moved kernel32 calls to _winapi. * Removed ShareableList.copy as redundant. * Changes to _winapi use from eryksun feedback. * Adopt simpler SharedMemory API, collapsing PosixSharedMemory and WindowsNamedSharedMemory into one. * Fix missing docstring on class, add test for ignoring size when attaching. * Moved SharedMemoryManager to managers module, tweak to fragile test. * Tweak to exception in OpenFileMapping suggested by eryksun. * Mark a few dangling bits as private as suggested by Giampaolo.
* bpo-24310: Document IDLE settings dialog font tab sample (GH-12007)Terry Jan Reedy2019-02-242-1/+9
|
* bpo-36018: Add the NormalDist class to the statistics module (GH-11973)Raymond Hettinger2019-02-232-1/+332
|
* bpo-36016: Add generation option to gc.getobjects() (GH-11909)Pablo Galindo2019-02-231-0/+32
|
* bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)Stéphane Wirtel2019-02-224-10/+16
|
* bpo-35904: Add statistics.fmean() (GH-11892)Raymond Hettinger2019-02-212-1/+73
|
* bpo-36068: Make _tuplegetter objects serializable (GH-11981)Joe Jevnik2019-02-211-1/+10
|
* bpo-36057 Update docs and tests for ordering in collections.Counter [no ↵Raymond Hettinger2019-02-212-2/+59
| | | | | | | | | | behavior change] (#11962) * Add tests for Counter order. No behavior change. * Update docs and tests * Fix doctest output and capitalization
* bpo-36060: Document how collections.ChainMap() determines iteration order ↵Raymond Hettinger2019-02-211-0/+14
| | | | (GH-11969)
* bpo-36052: Raise a SyntaxError when assigning a value to __debug__ with := ↵Stéphane Wirtel2019-02-211-0/+4
| | | | | | | (GH-11958) Trying to assign a value to __debug__ using the assignment operator is supposed to fail, but a missing check for forbidden names when setting the context in the ast was preventing this behaviour.
* bpo-36037: Fix test_ssl for strict OpenSSL policy (GH-11940)Victor Stinner2019-02-191-1/+29
| | | | | Fix test_ssl for strict OpenSSL configuration like RHEL8 strict crypto policy. Use older TLS version for minimum TLS version of the server SSL context if needed, to test TLS version older than default minimum TLS version.
* bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308)Cédric Krier2019-02-192-7/+73
| | | Allow to add HTTP headers to XML-RPC requests sent to the server.
* bpo-31506: Clarify error messages for object.__new__ and object.__init__ ↵Sanyam Khurana2019-02-191-7/+13
| | | | | | | | | (GH-11641) `object.__new__` and `object.__init__` do take one argument each, they just don't take extra user supplied arguments. Patch by Sanyam Khurana.
* Fix a misnamed test for lists. (GH-11933)Serhiy Storchaka2019-02-191-1/+7
|
* Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)Serhiy Storchaka2019-02-191-12/+4
|
* Fix syntax warnings in tests introduced in bpo-15248. (GH-11932)Serhiy Storchaka2019-02-193-6/+10
|
* bpo-35798: Add test.support.check_syntax_warning(). (#11895)Serhiy Storchaka2019-02-193-52/+43
| | | | | | | It checks that a SyntaxWarning is raised when compile specified statement, that it is raised only once, that it is converted to a SyntaxError when raised as exception, and that both warning and exception objects have corresponding attributes.
* bpo-35689: IDLE: Add docstrings and unittests for colorizer.py (GH-11472)Cheryl Sabella2019-02-193-16/+407
|
* bpo-34572: change _pickle unpickling to use import rather than retrieving ↵tjb9002019-02-181-1/+66
| | | | | from sys.modules (GH-9047) Fix C implementation of pickle.loads to use importlib's locking mechanisms, and thereby avoid using partially-loaded modules.
* bpo-34294: re module, fix wrong capturing groups in rare cases. (GH-11546)animalize2019-02-181-0/+34
| | | | | | Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases. Also add a missing index in re.rst.
* bpo-35704: Prevent test_shutil fail result when AIX is 32-bit and MAXDATA < ↵Michael Felt2019-02-181-0/+13
| | | | | 0x20000000 (GH-11500) https://bugs.python.org/issue35704
* bpo-35942: Improve the error message if __fspath__ returns invalid types in ↵Pablo Galindo2019-02-181-1/+18
| | | | | path_converter (GH-11831) The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error.
* bpo-35992: Use PySequence_GetItem only if sq_item is not NULL (GH-11857)Ivan Levkivskyi2019-02-171-1/+8
| | | | Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
* bpo-36013: delete fragile interactive shell SIGINT test (GH-11902)Gregory P. Smith2019-02-171-33/+7
| | | | | It makes the existing smaller test more readable and robust at the same time. The execution of a shell in interactive mode from CI and buildbot test automation wasn't working out. What would work locally in our terminals would only work within a fraction of automation systems. The integration test was a nice to have. painful. deleting. :)
* Convert range to repeat for choices() (#11889)Raymond Hettinger2019-02-161-3/+3
|
* bpo-1054041: Exit properly after an uncaught ^C. (#11862)Gregory P. Smith2019-02-161-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-1054041: Exit properly by a signal after a ^C. An uncaught KeyboardInterrupt exception means the user pressed ^C and our code did not handle it. Programs that install SIGINT handlers are supposed to reraise the SIGINT signal to the SIG_DFL handler in order to exit in a manner that their calling process can detect that they died due to a Ctrl-C. https://www.cons.org/cracauer/sigint.html After this change on POSIX systems while true; do python -c 'import time; time.sleep(23)'; done can be stopped via a simple Ctrl-C instead of the shell infinitely restarting a new python process. What to do on Windows, or if anything needs to be done there has not yet been determined. That belongs in its own PR. TODO(gpshead): A unittest for this behavior is still needed. * Do the unhandled ^C check after pymain_free. * Return STATUS_CONTROL_C_EXIT on Windows. * Fix ifdef around unistd.h include. * 📜🤖 Added by blurb_it. * Add STATUS_CTRL_C_EXIT to the os module on Windows * Add unittests. * Don't send CTRL_C_EVENT in the Windows test. It was causing CI systems to bail out of the entire test suite. See https://dev.azure.com/Python/cpython/_build/results?buildId=37980 for example. * Correct posix test (fail on macOS?) check. * STATUS_CONTROL_C_EXIT must be unsigned. * Improve the error message. * test typo :) * Skip if the bash version is too old. ...and rename the windows test to reflect what it does. * min bash version is 4.4, detect no bash. * restore a blank line i didn't mean to delete. * PyErr_Occurred() before the Py_DECREF(co); * Don't add os.STATUS_CONTROL_C_EXIT as a constant. * Update the Windows test comment. * Refactor common logic into a run_eval_code_obj fn.
* bpo-15248: Emit a compiler warning when missed a comma before tuple or list. ↵Serhiy Storchaka2019-02-161-0/+87
| | | | (GH-11757)
* bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)Daniel Hahler2019-02-152-1/+15
| | | | | | | | Previously, `debug print(` would cause the interpreter to exit on a SyntaxError whereas `print(` would properly display the error and return to the pdb prompt. This patch fixes this by pre-compiling the code before passing it to `Pdb.run`. https://bugs.python.org/issue35931
* bpo-35994: add sub dir for sub2_tree in os.walk test if symlink is not ↵pxinwr2019-02-151-1/+1
| | | | | supported (GH-11853) https://bugs.python.org/issue35994
* bpo-35633: test_lockf() fails with "PermissionError: [Errno 13] Permission ↵Michael Felt2019-02-141-0/+4
| | | | | | | | | | | | denied" on AIX (GH-11424) [bpo-35633](https://bugs.python.org/issue35633): Fix a test regression introduced with [bpo-35189](https://bugs.python.org/issue35189) (PEP 475: fnctl functions are not retried if interrupted (EINTR)). Not only a blocking IO error needs to be ignored - permission errors also need to be ignored. p.s. - iirc as a "test" only correction a NEWS item is not required. If this is not correct - just mention, and I'll add a NEWS blurb. https://bugs.python.org/issue35633
* bpo-35500: align expected and actual calls on mock.assert_called_with error ↵Susan Su2019-02-142-9/+13
| | | | message. (GH-11804)
* bpo-35887: Add make regen-importlib step to importlib._bootstrap docstring ↵Nina Zakharenko2019-02-131-3/+3
| | | | (GH-11777)
* bpo-18283: Add support for bytes to shutil.which (GH-11818)Cheryl Sabella2019-02-132-14/+41
|
* Be consistent about the use of from-imports in random module (GH-11837)Raymond Hettinger2019-02-131-4/+4
| | | Minor code clean-up.
* bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP ↵Matěj Cepl2019-02-121-0/+10
| | | | | | port (GH-11823) Make test_imap4_host_default_value independent on whether the local IMAP server is running.
* bpo-35972: _xxsubinterpreters: Fix potential integer truncation on 32-bit in ↵Alexey Izbyshev2019-02-121-1/+13
| | | | channel_send() (gh-11822)
* bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815)Christopher Hunt2019-02-122-3/+13
|
* bpo-35918: Remove broken has_key method and add test (#11819)Rémi Lapeyre2019-02-122-3/+1
|
* bpo-35378: Fix multiprocessing.Pool references (GH-11627)Pablo Galindo2019-02-112-39/+74
| | | | | | | | | Changes in this commit: 1. Use a _strong_ reference between the Pool and associated iterators 2. Rework PR #8450 to eliminate a cycle in the Pool. There is no test in this commit because any test that automatically tests this behaviour needs to eliminate the pool before joining the pool to check that the pool object is garbaged collected/does not hang. But doing this will potentially leak threads and processes (see https://bugs.python.org/issue35413).
* bpo-22062: Updated docstring and documentation for pathlib (GH-8519)Eivind Teig2019-02-111-2/+3
| | | | | | Original patch by Mike Short https://bugs.python.org/issue22062