]> granicus.if.org Git - python/log
python
7 years agobpo-32652: Defer pymain_set_global_config() call (#5303)
Victor Stinner [Thu, 25 Jan 2018 08:18:36 +0000 (09:18 +0100)]
bpo-32652: Defer pymain_set_global_config() call (#5303)

In Py_Main(), don't call pymain_set_global_config() early: only call
it when the whole configuration has been read.

Add an unit test to prevent future regression.

7 years agobpo-29708: Add What's New entries for SOURCE_DATE_EPOCH and py_compile (GH-5306)
Brett Cannon [Thu, 25 Jan 2018 01:13:24 +0000 (17:13 -0800)]
bpo-29708: Add What's New entries for SOURCE_DATE_EPOCH and py_compile (GH-5306)

7 years agobpo-32391: Implement StreamWriter.wait_closed() (#5281)
Andrew Svetlov [Wed, 24 Jan 2018 22:30:30 +0000 (00:30 +0200)]
bpo-32391: Implement StreamWriter.wait_closed() (#5281)

7 years agobpo-10381: Add timezone to datetime C API (#5032)
Paul Ganssle [Wed, 24 Jan 2018 22:29:30 +0000 (17:29 -0500)]
bpo-10381: Add timezone to datetime C API (#5032)

* Add timezone to datetime C API

* Add documentation for timezone C API macros

* Add dedicated tests for datetime type check macros

* Remove superfluous C API test

* Drop support for TimeZoneType in datetime C API

* Expose UTC singleton to the datetime C API

* Update datetime C-API documentation to include links

* Add reference count information for timezone constructors

7 years agobpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)
Bernhard M. Wiedemann [Wed, 24 Jan 2018 21:26:18 +0000 (22:26 +0100)]
bpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)

To support reproducible builds, the setting of of SOURCE_DATE_EPOCH triggers the py_compile module -- and by extension, compileall -- to forcibly compile with hash-based .pyc files. This eliminates the possibility of timestamp-based .pyc files which vary between builds.

7 years ago bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for zipimport...
Barry Warsaw [Wed, 24 Jan 2018 20:36:21 +0000 (15:36 -0500)]
 bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for zipimport (#5248)

7 years agobpo-32636: Fix two bugs in test_asyncio (#5302)
Victor Stinner [Wed, 24 Jan 2018 20:15:14 +0000 (21:15 +0100)]
bpo-32636: Fix two bugs in test_asyncio (#5302)

7 years agobpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)
Nathaniel J. Smith [Wed, 24 Jan 2018 20:14:33 +0000 (12:14 -0800)]
bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)

7 years agobpo-32410: Improve sock_sendfile tests (#5294)
Andrew Svetlov [Wed, 24 Jan 2018 19:40:35 +0000 (21:40 +0200)]
bpo-32410: Improve sock_sendfile tests (#5294)

* Rename sock_sendfile test methods
* Make sock_sendfile tests more stable

7 years agobpo-32651 Recommend getpass.getuser() (#5301)
Barry Warsaw [Wed, 24 Jan 2018 17:51:29 +0000 (12:51 -0500)]
bpo-32651 Recommend getpass.getuser() (#5301)

* bpo-32651 - In the documentation for os.getlogin(), recommend getpass.getuser()

7 years agobpo-32643: Drop support for a few private Task and Future APIs. (#5293)
Yury Selivanov [Wed, 24 Jan 2018 16:31:01 +0000 (11:31 -0500)]
bpo-32643: Drop support for a few private Task and Future APIs. (#5293)

Specifically, it's not possible to subclass Task/Future classes
and override the following methods:

* Future._schedule_callbacks
* Task._step
* Task._wakeup

7 years agobpo-32030: Add _PyCoreConfig.module_search_paths (#4954)
Victor Stinner [Wed, 24 Jan 2018 16:03:28 +0000 (17:03 +0100)]
bpo-32030: Add _PyCoreConfig.module_search_paths (#4954)

_PyCoreConfig_Read() is now responsible to compute sys.path.
So sys.path is now computed before calling _Py_InitializeCore().

Changes:

* Add module_search_path, module_search_paths, executable, prefix,
  base_prefix, exec_prefix and base_exec_prefix to _PyCoreConfig.
* _PyMainInterpreterConfig_Read() now only converts wchar_t** lists
  into a Python list, it doesn't compute sys.path anymore.

7 years agobpo-28046: Remove MACHDEPPATH from Modules/Setup.dist (#5289)
Victor Stinner [Wed, 24 Jan 2018 16:02:41 +0000 (17:02 +0100)]
bpo-28046: Remove MACHDEPPATH from Modules/Setup.dist (#5289)

Makefile $MACHDEPPATH uses $PLATDIR, but this variable was removed.
So remove also $MACHDEPPATH.

Remove also $EXTRAMACHDEPPATH.

7 years agobpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)
Pablo Galindo [Wed, 24 Jan 2018 12:57:49 +0000 (12:57 +0000)]
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)

7 years agobpo-32360: unittest.util: Use Counter instead of custom count function (GH-4994)
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Wed, 24 Jan 2018 07:49:58 +0000 (13:19 +0530)]
bpo-32360: unittest.util: Use Counter instead of custom count function (GH-4994)

7 years agobpo-32436: Don't use native popcount() (also fixes bpo-32641) (#5292)
Yury Selivanov [Wed, 24 Jan 2018 03:17:04 +0000 (22:17 -0500)]
bpo-32436: Don't use native popcount() (also fixes bpo-32641) (#5292)

7 years agobpo-32502: Discard 64-bit (and other invalid) hardware addresses (#5254)
Bo Bayles [Wed, 24 Jan 2018 01:11:44 +0000 (19:11 -0600)]
bpo-32502: Discard 64-bit (and other invalid) hardware addresses (#5254)

7 years agobpo-32436: Fix potential NULL dereference (#5286)
Yury Selivanov [Tue, 23 Jan 2018 21:26:07 +0000 (16:26 -0500)]
bpo-32436: Fix potential NULL dereference (#5286)

7 years agobpo-32296: Make get_running_loop() another 4-5x faster (#5277)
Yury Selivanov [Tue, 23 Jan 2018 20:10:03 +0000 (15:10 -0500)]
bpo-32296: Make get_running_loop() another 4-5x faster (#5277)

7 years ago bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (#5284)
stratakis [Tue, 23 Jan 2018 15:11:24 +0000 (16:11 +0100)]
 bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (#5284)

glibc is deprecating libcrypt in favor of libxcrypt, however python assumes
that crypt.h will always be included. This change makes the header inclusion
explicit when libxcrypt is present on the system.

7 years agobpo-32618: Fix test_mutatingdecodehandler not testing test.mutating (#5269)
Xiang Zhang [Tue, 23 Jan 2018 14:50:50 +0000 (22:50 +0800)]
bpo-32618: Fix test_mutatingdecodehandler not testing test.mutating (#5269)

* bpo-32618: Fix test_mutatingdecodehandler not testing test.mutating

It should test both test.replacing and test.mutating instead of test test.replacing twice.

7 years agobpo-20361: Remove workaround for a now fixed bug (#5283)
Victor Stinner [Tue, 23 Jan 2018 12:30:53 +0000 (13:30 +0100)]
bpo-20361: Remove workaround for a now fixed bug (#5283)

"python3 -bb -Wd" now works as expected:
"python3 -bb -Wd -Werror::BytesWarning" is no more needed.

7 years agobpo-32593: Run autoconf (#5282)
Victor Stinner [Tue, 23 Jan 2018 12:14:08 +0000 (13:14 +0100)]
bpo-32593: Run autoconf (#5282)

Update configure since configure.ac was modified to drop support for
FreeBSD 4.

7 years agobpo-32633: Fix some warnings in test_asyncio.test_tasks (#5280)
Nathaniel J. Smith [Tue, 23 Jan 2018 09:09:31 +0000 (01:09 -0800)]
bpo-32633: Fix some warnings in test_asyncio.test_tasks (#5280)

7 years agobpo-32436: Remove a redundant assert (#5275)
Yury Selivanov [Tue, 23 Jan 2018 07:00:03 +0000 (02:00 -0500)]
bpo-32436: Remove a redundant assert (#5275)

7 years agoAdd myself as hamt/context (PEP 567) code owner (#5276)
Yury Selivanov [Tue, 23 Jan 2018 06:59:50 +0000 (01:59 -0500)]
Add myself as hamt/context (PEP 567) code owner (#5276)

7 years agobpo-32436: Implement PEP 567 (#5027)
Yury Selivanov [Tue, 23 Jan 2018 00:11:18 +0000 (19:11 -0500)]
bpo-32436: Implement PEP 567 (#5027)

7 years agobpo-29240: PyUnicode_DecodeLocale() uses UTF-8 on Android (#5272)
Victor Stinner [Mon, 22 Jan 2018 18:07:32 +0000 (19:07 +0100)]
bpo-29240: PyUnicode_DecodeLocale() uses UTF-8 on Android (#5272)

PyUnicode_DecodeLocaleAndSize(), PyUnicode_DecodeLocale() and
PyUnicode_EncodeLocale() now use always use the UTF-8 encoding on
Android, instead of the current locale encoding.

On Android API 19, mbstowcs() and wcstombs() are broken and cannot be
used.

7 years agobpo-32593: Drop FreeBSD 9 and older support (#5232)
Victor Stinner [Mon, 22 Jan 2018 17:32:50 +0000 (18:32 +0100)]
bpo-32593: Drop FreeBSD 9 and older support (#5232)

Drop support of FreeBSD 9 and older.

7 years agobpo-31179: Make dict.copy() up to 5.5 times faster. (#3067)
Yury Selivanov [Mon, 22 Jan 2018 16:54:41 +0000 (11:54 -0500)]
bpo-31179: Make dict.copy() up to 5.5 times faster. (#3067)

7 years agobpo-31801: Enum: add _ignore_ as class option (#5237)
Ethan Furman [Mon, 22 Jan 2018 15:56:37 +0000 (07:56 -0800)]
bpo-31801:  Enum:  add _ignore_ as class option (#5237)

* bpo-31801:  Enum:  add _ignore_ as class option

_ignore_ is a list, or white-space seperated str, of names that will not
be candidates for members; these names, and _ignore_ itself, are removed
from the final class.

* bpo-31801:  Enum:  add documentation for _ignore_

* bpo-31801: Enum: remove trailing whitespace

* bpo-31801: Enum: fix bulleted list format

* bpo-31801: add version added for _ignore_

7 years agourllib.request: Remove unused import (GH-5268)
INADA Naoki [Mon, 22 Jan 2018 07:45:31 +0000 (16:45 +0900)]
urllib.request: Remove unused import (GH-5268)

7 years agobpo-32591: Fix PyExc_WarnFormat call (follow-up commit) (#5263)
Yury Selivanov [Mon, 22 Jan 2018 01:47:04 +0000 (20:47 -0500)]
bpo-32591: Fix PyExc_WarnFormat call (follow-up commit) (#5263)

The previous version was correct in terms of behaviour, but
checking the return value of PyErr_WarnFormat allows to
avoid calling PyErr_Occurred and silences the coverity alarm.

7 years agobpo-32314: Fix asyncio.run() to cancel runinng tasks on shutdown (#5262)
Yury Selivanov [Sun, 21 Jan 2018 19:56:59 +0000 (14:56 -0500)]
bpo-32314: Fix asyncio.run() to cancel runinng tasks on shutdown (#5262)

7 years agobpo-32591: Add native coroutine origin tracking (#5250)
Nathaniel J. Smith [Sun, 21 Jan 2018 14:44:07 +0000 (06:44 -0800)]
bpo-32591: Add native coroutine origin tracking (#5250)

* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread

7 years agobpo-32503: Avoid creating too small frames in pickles. (#5127)
Serhiy Storchaka [Sat, 20 Jan 2018 14:42:44 +0000 (16:42 +0200)]
bpo-32503: Avoid creating too small frames in pickles. (#5127)

7 years agobpo-32602: Test ECDSA certs (#5247)
Christian Heimes [Sat, 20 Jan 2018 14:16:30 +0000 (15:16 +0100)]
bpo-32602: Test ECDSA certs (#5247)

Add test certs and test for ECDSA cert and EC/RSA dual mode.

I'm also adding certs for IDNA 2003/2008 tests and simplify some test
data handling.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-32598: Use autoconf to detect usable OpenSSL (#5242)
Christian Heimes [Sat, 20 Jan 2018 12:19:21 +0000 (13:19 +0100)]
bpo-32598: Use autoconf to detect usable OpenSSL (#5242)

Add https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
to auto-detect compiler flags, linker flags and libraries to compile
OpenSSL extensions. The M4 macro uses pkg-config and falls back to
manual detection.

Add autoconf magic to detect usable X509_VERIFY_PARAM_set1_host()
and related functions.

Refactor setup.py to use new config vars to compile _ssl and _hashlib
modules.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-32226: PEP 560: improve typing module (#4906)
Ivan Levkivskyi [Sat, 20 Jan 2018 11:23:59 +0000 (11:23 +0000)]
bpo-32226: PEP 560: improve typing module (#4906)

This PR re-designs the internal typing API using the new PEP 560 features.
However, there are only few minor changes in the public API.

7 years agobpo-32028: Fix suggestions for indented print statements (GH-4688)
Sanyam Khurana [Sat, 20 Jan 2018 03:12:22 +0000 (08:42 +0530)]
bpo-32028: Fix suggestions for indented print statements (GH-4688)

The suggested replacement for print statements previously failed to account
for leading whitespace and hence could end up including unwanted text in
the proposed call to the print builtin.

Patch by Sanyam Khurana.

7 years agobpo-32596: Lazy import concurrent.futures.process and thread (GH-5241)
INADA Naoki [Sat, 20 Jan 2018 00:54:42 +0000 (09:54 +0900)]
bpo-32596: Lazy import concurrent.futures.process and thread (GH-5241)

7 years agobpo-25910: Link redirections in docs (#1933)
Sanyam Khurana [Sat, 20 Jan 2018 00:25:37 +0000 (05:55 +0530)]
bpo-25910: Link redirections in docs (#1933)

Fixes some redirection links in docs.

7 years agobpo-32410: Make SendfileNotAvailableError exception public (#5243)
Andrew Svetlov [Fri, 19 Jan 2018 18:04:29 +0000 (20:04 +0200)]
bpo-32410: Make SendfileNotAvailableError exception public (#5243)

7 years agobpo-32588: Move _findvs into its own module and add missing _queue module to installe...
Steve Dower [Thu, 18 Jan 2018 22:09:36 +0000 (09:09 +1100)]
bpo-32588: Move _findvs into its own module and add missing _queue module to installer (#5227)

7 years agoRemoved unnecesssary bit inversion which doesn't improve dispersion statistics (...
Raymond Hettinger [Thu, 18 Jan 2018 21:23:27 +0000 (13:23 -0800)]
Removed unnecesssary bit inversion which doesn't improve dispersion statistics (#5235)

7 years agobpo-9566: Fix size_t=>int downcast warnings (#5230)
Victor Stinner [Thu, 18 Jan 2018 10:15:25 +0000 (11:15 +0100)]
bpo-9566: Fix size_t=>int downcast warnings (#5230)

* Use wider types (int => Py_ssize_t) to avoid integer overflows.
* Fix gc.get_freeze_count(): use Py_ssize_t type rather than int, since gc_list_size() returns a Py_ssize_t.

7 years agobpo-32576: use queue.SimpleQueue in critical places (#5216)
Antoine Pitrou [Thu, 18 Jan 2018 09:38:03 +0000 (10:38 +0100)]
bpo-32576: use queue.SimpleQueue in critical places (#5216)

Where a queue may be invoked from a weakref callback, we need
to use the reentrant SimpleQueue.

7 years agoFix typo in thread_nt.h code comment (GH-5211)
hui shang [Wed, 17 Jan 2018 23:21:01 +0000 (07:21 +0800)]
Fix typo in thread_nt.h code comment (GH-5211)

The comment for PyThread_allocate_lock says "It has too be implemented ...".
There was an extra "o" in ".. to be implemented.."

7 years agoUse assertCountEqual instead of assertEqual. (#5223)
Gregory P. Smith [Wed, 17 Jan 2018 22:57:57 +0000 (14:57 -0800)]
Use assertCountEqual instead of assertEqual. (#5223)

This test doesn't care about order, the underlying filesystem APIs do not
guarantee directory listings on subsequent calls will be in the same order.

7 years agobpo-32226: Fix memory leak in generic_alias_dealloc() (#5212)
Victor Stinner [Wed, 17 Jan 2018 22:08:18 +0000 (23:08 +0100)]
bpo-32226: Fix memory leak in generic_alias_dealloc() (#5212)

7 years agopythoninfo: add time.time and datetime.datetime.now (#5214)
Victor Stinner [Wed, 17 Jan 2018 15:35:45 +0000 (16:35 +0100)]
pythoninfo: add time.time and datetime.datetime.now (#5214)

7 years agobpo-32248: Fix test_importlib.test_open() (#5213)
Victor Stinner [Wed, 17 Jan 2018 14:21:50 +0000 (15:21 +0100)]
bpo-32248: Fix test_importlib.test_open() (#5213)

Use the binary.file instead of utf-8.file to avoid issues with
Unix newlines vs Windows newlines.

7 years agoFix Git attributes of test_importlib data files (#5209)
Victor Stinner [Wed, 17 Jan 2018 09:26:03 +0000 (10:26 +0100)]
Fix Git attributes of test_importlib data files (#5209)

bpo-32248: Make sure that Git checks out data files with Unix line
ending on Windows as well.

7 years agobpo-32549: Compile OpenSSL 1.1.0 on Travis CI (#5180)
Christian Heimes [Tue, 16 Jan 2018 20:02:26 +0000 (21:02 +0100)]
bpo-32549: Compile OpenSSL 1.1.0 on Travis CI (#5180)

Use an improved version of multissl test helper to compile a local copy
of OpenSSL 1.1.0g.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-32403: Faster date and datetime constructors (#4993)
Paul Ganssle [Tue, 16 Jan 2018 18:06:31 +0000 (13:06 -0500)]
bpo-32403: Faster date and datetime constructors (#4993)

* Add tests for date subclass alternate constructors

* Switch over alternate date constructors to fast path

* Switch datetime constructors to fastpath, fix bpo-32404

* Add fast path for datetime in date subclass constructor

* Set fold in constructor in datetime.combine

* Add news entries.

7 years agobpo-32410: Implement loop.sock_sendfile() (#4976)
Andrew Svetlov [Tue, 16 Jan 2018 17:59:34 +0000 (19:59 +0200)]
bpo-32410: Implement loop.sock_sendfile() (#4976)

7 years agoSkip test_readline.test_nonascii() on C locale (#5203)
Victor Stinner [Tue, 16 Jan 2018 16:34:34 +0000 (17:34 +0100)]
Skip test_readline.test_nonascii() on C locale (#5203)

bpo-29240: On FreeBSD, if the LC_CTYPE locale is "C" or "POSIX",
writing and reading non-ASCII bytes into/from a TTY works,
but readline or ncurses ignores non-ASCII bytes on read.

7 years agobpo-31572: Get rid of PyObject_HasAttr() and _PyObject_HasAttrId() in the _io module...
Serhiy Storchaka [Tue, 16 Jan 2018 16:34:21 +0000 (18:34 +0200)]
bpo-31572: Get rid of PyObject_HasAttr() and _PyObject_HasAttrId() in the _io module. (#3726)

7 years agobpo-32544: Speed up hasattr() and getattr() (GH-5173)
INADA Naoki [Tue, 16 Jan 2018 11:52:41 +0000 (20:52 +0900)]
bpo-32544: Speed up hasattr() and getattr() (GH-5173)

AttributeError was raised always when attribute is not found.
This commit skip raising AttributeError when `tp_getattro` is `PyObject_GenericGetAttr`.
It makes hasattr() and getattr() about 4x faster when attribute is not found.

7 years agobpo-26163: Frozenset hash improvement (#5194)
Raymond Hettinger [Tue, 16 Jan 2018 09:30:26 +0000 (01:30 -0800)]
bpo-26163: Frozenset hash improvement (#5194)

7 years agobpo-14976: Reentrant simple queue (#3346)
Antoine Pitrou [Mon, 15 Jan 2018 23:27:16 +0000 (00:27 +0100)]
bpo-14976: Reentrant simple queue (#3346)

Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().

7 years agoImplement the get_resource_reader() API for file system imports (#5168)
Barry Warsaw [Mon, 15 Jan 2018 23:07:11 +0000 (15:07 -0800)]
Implement the get_resource_reader() API for file system imports (#5168)

7 years agoMake asyncio tests run when there's no SSL module (#5196)
Yury Selivanov [Mon, 15 Jan 2018 22:56:32 +0000 (17:56 -0500)]
Make asyncio tests run when there's no SSL module (#5196)

7 years agobpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174)
Victor Stinner [Mon, 15 Jan 2018 14:58:02 +0000 (15:58 +0100)]
bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174)

* Add _Py_GetLocaleconvNumeric() function: decode decimal_point and
  thousands_sep fields of localeconv() from the LC_NUMERIC encoding,
  rather than decoding from the LC_CTYPE encoding.
* Modify locale.localeconv() and "n" formatter of str.format() (for
  int, float and complex to use _Py_GetLocaleconvNumeric()
  internally.

7 years agobpo-29240: Fix locale encodings in UTF-8 Mode (#5170)
Victor Stinner [Mon, 15 Jan 2018 09:45:49 +0000 (10:45 +0100)]
bpo-29240: Fix locale encodings in UTF-8 Mode (#5170)

Modify locale.localeconv(), time.tzname, os.strerror() and other
functions to ignore the UTF-8 Mode: always use the current locale
encoding.

Changes:

* Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or
  encoding error, they return the position of the error and an error
  message which are used to raise Unicode errors in
  PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale().
* Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx().
* PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all
  cases, especially for the strict error handler.
* Add _Py_DecodeUTF8Ex(): return more information on decoding error
  and supports the strict error handler.
* Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex().
* Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx().
* Ignore the UTF-8 mode to encode/decode localeconv(), strerror()
  and time zone name.
* Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
  and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use
  the "current" locale.
* Remove _PyUnicode_DecodeCurrentLocale(),
  _PyUnicode_DecodeCurrentLocaleAndSize() and
  _PyUnicode_EncodeCurrentLocale().

7 years agobpo-26330: Update shutil.disk_usage() documentation (GH-5184)
Cheryl Sabella [Mon, 15 Jan 2018 05:08:37 +0000 (00:08 -0500)]
bpo-26330: Update shutil.disk_usage() documentation (GH-5184)

Clarify that on Windows, path must be a directory.
On Unix, path can be a file or a directory.

7 years agobpo-15221: Update os.path.is*() documentation (GH-5185)
Cheryl Sabella [Mon, 15 Jan 2018 04:57:51 +0000 (23:57 -0500)]
bpo-15221: Update os.path.is*() documentation (GH-5185)

`os.path.is*()` can return False if the file can't be accessed.
The behaviour is documented in details in `os.path.exists()`.
Link to `os.path.exists()` from `os.path.is*()`.

7 years agobpo-29476: Simplify set_add_entry() (#5175)
Raymond Hettinger [Sun, 14 Jan 2018 18:20:13 +0000 (10:20 -0800)]
bpo-29476: Simplify set_add_entry() (#5175)

7 years agoAdd itertools recipe for directly finding the n-th combination (#5161)
Raymond Hettinger [Sat, 13 Jan 2018 18:35:40 +0000 (10:35 -0800)]
Add itertools recipe for directly finding the n-th combination (#5161)

7 years agoImprove enum.Flag code example (GH-5167)
Julian Kahnert [Sat, 13 Jan 2018 03:35:57 +0000 (04:35 +0100)]
Improve enum.Flag code example (GH-5167)

The code example that demonstrate how to use enum.Flag was missing
the import of enum.auto.

7 years agobpo-32248: Introduce the concept of Loader.get_resource_reader() (GH-5108)
Brett Cannon [Fri, 12 Jan 2018 23:08:59 +0000 (15:08 -0800)]
bpo-32248: Introduce the concept of Loader.get_resource_reader() (GH-5108)

7 years agobpo-31993: Do not use memoryview when pickle large strings. (#5154)
Serhiy Storchaka [Fri, 12 Jan 2018 22:28:31 +0000 (00:28 +0200)]
bpo-31993: Do not use memoryview when pickle large strings. (#5154)

PyMemoryView_FromMemory() created a memoryview referring to
the internal data of the string.  When the string is destroyed
the memoryview become referring to a freed memory.

7 years agobpo-32521: nis libtirpc (#5137)
Christian Heimes [Fri, 12 Jan 2018 14:26:32 +0000 (15:26 +0100)]
bpo-32521: nis libtirpc (#5137)

glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)
yahya-abou-imran [Fri, 12 Jan 2018 09:18:44 +0000 (10:18 +0100)]
bpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)

7 years agoOrderedDict import is no longer needed (#4890)
Raymond Hettinger [Fri, 12 Jan 2018 06:20:33 +0000 (22:20 -0800)]
OrderedDict import is no longer needed (#4890)

7 years agoLexical Analysis ref doc: Fix a typo in the string concatenation internal link (GH...
İsmail Arılık [Fri, 12 Jan 2018 06:18:54 +0000 (09:18 +0300)]
Lexical Analysis ref doc: Fix a typo in the string concatenation internal link (GH-5157)

In lexical analysis reference documentation, the internal link to
the string literal concatenation section was written as`.. _string-catenation:`.
Changed that to `.. _string-concatenation:`.

7 years agobpo-31145: Use dataclasses to create a prioritization wrapper (#5153)
Raymond Hettinger [Fri, 12 Jan 2018 06:06:34 +0000 (22:06 -0800)]
bpo-31145: Use dataclasses to create a prioritization wrapper (#5153)

7 years agobpo-32467: Let collections.abc.ValuesView inherit from Collection (#5152)
Raymond Hettinger [Fri, 12 Jan 2018 05:53:49 +0000 (21:53 -0800)]
bpo-32467: Let collections.abc.ValuesView inherit from Collection (#5152)

7 years agobpo-31113: Get rid of recursion in the compiler for normal control flow. (#3015)
Serhiy Storchaka [Thu, 11 Jan 2018 18:20:13 +0000 (20:20 +0200)]
bpo-31113: Get rid of recursion in the compiler for normal control flow. (#3015)

7 years agobpo-31993: Do not create frames for large bytes and str objects (#5114)
Serhiy Storchaka [Thu, 11 Jan 2018 11:03:20 +0000 (13:03 +0200)]
bpo-31993: Do not create frames for large bytes and str objects (#5114)

when serialize into memory buffer with C pickle implementations.

This optimization already is performed when serialize into memory
with Python pickle implementations or into a file with both
implementations.

7 years agobpo-29240: Ignore UTF-8 Mode in time module (#5148)
Victor Stinner [Thu, 11 Jan 2018 09:37:59 +0000 (10:37 +0100)]
bpo-29240: Ignore UTF-8 Mode in time module (#5148)

time.strftime() must use the current LC_CTYPE encoding, not UTF-8
if the UTF-8 mode is enabled.

Add _PyUnicode_DecodeCurrentLocale() function.

7 years agobpo-32320: Add default value support to collections.namedtuple() (#4859)
Raymond Hettinger [Thu, 11 Jan 2018 05:45:19 +0000 (21:45 -0800)]
bpo-32320: Add default value support to collections.namedtuple() (#4859)

7 years agoFix obvious typos in docstrings (#5151)
Raymond Hettinger [Thu, 11 Jan 2018 04:56:41 +0000 (20:56 -0800)]
Fix obvious typos in docstrings (#5151)

7 years agobpo-29240: readline now ignores the UTF-8 Mode (#5145)
Victor Stinner [Wed, 10 Jan 2018 21:46:15 +0000 (22:46 +0100)]
bpo-29240: readline now ignores the UTF-8 Mode (#5145)

Add new fuctions ignoring the UTF-8 mode:

* _Py_DecodeCurrentLocale()
* _Py_EncodeCurrentLocale()
* _PyUnicode_DecodeCurrentLocaleAndSize()
* _PyUnicode_EncodeCurrentLocale()

Modify the readline module to use these functions.

Re-enable test_readline.test_nonascii().

7 years agoFix when parsing tz offsets microseconds shorter than 6 (#4781)
Mario Corchero [Tue, 9 Jan 2018 21:37:26 +0000 (21:37 +0000)]
Fix when parsing tz offsets microseconds shorter than 6 (#4781)

As the remainder was directly parsed as an int, strings like
.600 were parsed as 600 microseconds rather than milliseconds.

7 years agobpo-24340: Fix estimation of the code stack size. (#5076)
Serhiy Storchaka [Tue, 9 Jan 2018 19:54:52 +0000 (21:54 +0200)]
bpo-24340: Fix estimation of the code stack size. (#5076)

7 years agobpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)
David Carlier [Tue, 9 Jan 2018 19:38:07 +0000 (19:38 +0000)]
bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)

Allow building the _uuid extension module on FreeBSD and OpenBSD.

7 years agoPost-release version bump to a4+
Ned Deily [Tue, 9 Jan 2018 15:27:57 +0000 (10:27 -0500)]
Post-release version bump to a4+

7 years agoFix several changelog items to use PEP markup.
Ned Deily [Tue, 9 Jan 2018 05:13:21 +0000 (00:13 -0500)]
Fix several changelog items to use PEP markup.

7 years agoMerge tag 'v3.7.0a4'
Ned Deily [Tue, 9 Jan 2018 15:17:17 +0000 (10:17 -0500)]
Merge tag 'v3.7.0a4'

7 years agobpo-32507: Change Windows install to include app-local UCRT (#5119)
Steve Dower [Tue, 9 Jan 2018 08:14:46 +0000 (19:14 +1100)]
bpo-32507: Change Windows install to include app-local UCRT (#5119)

7 years agoBump to 3.7.0a4 v3.7.0a4
Ned Deily [Tue, 9 Jan 2018 03:05:14 +0000 (22:05 -0500)]
Bump to 3.7.0a4

7 years agoUpdate docs for 3.7.0a4
Ned Deily [Tue, 9 Jan 2018 02:57:13 +0000 (21:57 -0500)]
Update docs for 3.7.0a4

7 years agobpo-32248: install new test_importlib directories (#5138)
Ned Deily [Tue, 9 Jan 2018 02:07:59 +0000 (21:07 -0500)]
bpo-32248: install new test_importlib directories (#5138)

7 years agobpo-31975 (PEP 565): Show DeprecationWarning in __main__ (GH-4458)
Nick Coghlan [Mon, 8 Jan 2018 02:45:02 +0000 (12:45 +1000)]
bpo-31975 (PEP 565): Show DeprecationWarning in __main__ (GH-4458)

- primary change is to add a new default filter entry for
  'default::DeprecationWarning:__main__'
- secondary change is an internal one to cope with plain
  strings in the warning module's internal filter list
  (this avoids the need to create a compiled regex object
  early on during interpreter startup)
- assorted documentation updates, including many more
  examples of configuring the warnings settings
- additional tests to ensure that both the pure Python and
  the C accelerated warnings modules have the expected
  default configuration

7 years agobpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131)
Eric V. Smith [Sun, 7 Jan 2018 19:30:17 +0000 (14:30 -0500)]
bpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131)

7 years agoFix version in AppVeyor config (GH-5124)
Zachary Ware [Sun, 7 Jan 2018 18:59:48 +0000 (12:59 -0600)]
Fix version in AppVeyor config (GH-5124)

7 years agobpo-31802: Fix importing native path module before importing os. (#4017)
Serhiy Storchaka [Sun, 7 Jan 2018 15:54:31 +0000 (17:54 +0200)]
bpo-31802: Fix importing native path module before importing os. (#4017)

7 years agobpo-30579: Allow TracebackType creation and tb_next mutation from Python (GH-4793)
Nathaniel J. Smith [Sun, 7 Jan 2018 13:30:18 +0000 (05:30 -0800)]
bpo-30579: Allow TracebackType creation and tb_next mutation from Python (GH-4793)

Third party projects may wish to hide their own internal machinery in
order to present more comprehensible tracebacks to end users
(e.g. Jinja2 and Trio both do this).

Previously such projects have had to rely on ctypes to do so:

  https://github.com/pallets/jinja/blob/fe3dadacdf4cf411d0a5b6bbd4d5234697a28af2/jinja2/debug.py#L345
  https://github.com/python-trio/trio/blob/1e86b1aee8c0c759f6f239ae53a05d0d3963c629/trio/_core/_multierror.py#L296

This provides a Python level API for creating and modifying real
Traceback objects, allowing tracebacks to be edited at runtime.

Patch by Nathaniel Smith.

7 years agoFix dataclasses docstring typo. (gh-5118)
Eric V. Smith [Sun, 7 Jan 2018 13:19:45 +0000 (08:19 -0500)]
Fix dataclasses docstring typo. (gh-5118)