Alexey Izbyshev [Tue, 20 Feb 2018 07:25:46 +0000 (10:25 +0300)]
closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
os.dup2() tests for dup3() system call availability at runtime,
but doesn't remember the result across calls, repeating
the test on each call with inheritable=False.
Since the caller of os.dup2() is expected to hold the GIL,
fix this by making the variable holding the test result static.
Gerrit Holl [Sat, 17 Feb 2018 03:48:57 +0000 (03:48 +0000)]
DOC: fix documentation for copyright and credits (GH-5706)
Adapt documentation for `copyright` and `credits` to reality. Previously, the documentation implied that all each of `copyright`,
`credits`, and `license`, would print a message to call the object in order to see the full text. In reality, only `license` exhibits this
behaviour, and `copyright` and `credit` print their full text either when printed, displayed, or called.
Terry Jan Reedy [Mon, 12 Feb 2018 19:58:26 +0000 (14:58 -0500)]
bpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_about. (GH-5639)
GUI test test_file_buttons() only looks at initial ascii-only lines,
but failed on systems where open() defaults to 'ascii' because
readline() internally reads and decodes far enough ahead to encounter
a non-ascii character in CREDITS.txt.
Zachary Ware [Sun, 11 Feb 2018 16:43:48 +0000 (10:43 -0600)]
bpo-32604: Make _xxsubinterpreters build on Windows (GH-5516)
This is not the ideal solution; this means that a test module is now
always included in the main python3x.dll. However, we're already
including xxsubtype, so why not?
Zhou Fangyi [Sat, 10 Feb 2018 06:59:29 +0000 (06:59 +0000)]
bpo-30688: Import unicodedata only when needed. (GH-5606)
Importing unicodedata in sre_parse leads to failure in compilation.
unicodedata is unused during compilation, and is not compiled when this
file is imported. The error occurs when generating posix variables,
pprint is required. The dependency chain goes on like this:
bpo-32775: Fix regular expression warnings in fnmatch. (#5583)
fnmatch.translate() no longer produces patterns which contain set
operations.
Sets starting with '[' or containing '--', '&&', '~~' or '||' will
be interpreted differently in regular expressions in future versions.
Currently they emit warnings. fnmatch.translate() now avoids producing
patterns containing such sets by accident.
Alexey Izbyshev [Tue, 6 Feb 2018 06:09:34 +0000 (09:09 +0300)]
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.
This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function.
Cheryl Sabella [Mon, 5 Feb 2018 02:03:22 +0000 (21:03 -0500)]
bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-4754)
When `__getattr__` is implemented, attribute lookup will always fall back to that,
even if the initial failure comes from `__getattribute__` or a descriptor's `__get__`
method (including property methods).
Cheryl Sabella [Fri, 2 Feb 2018 21:16:27 +0000 (16:16 -0500)]
bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265)
Modify RE examples in documentation to use raw strings to prevent DeprecationWarning.
Add text to REGEX HOWTO to highlight the deprecation. Approved by Serhiy Storchaka.
Barry Warsaw [Fri, 2 Feb 2018 20:15:58 +0000 (15:15 -0500)]
bpo-32303 - Consistency fixes for namespace loaders (#5481)
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.
oldk [Fri, 2 Feb 2018 04:20:00 +0000 (12:20 +0800)]
bpo-32674: Improve the docstring for __import__ (GH-5339)
Clarify that the level argument is used to determine whether to
perform absolute or relative imports: 0 is absolute, while a positive number
is the number of parent directories to search relative to the current module.
Stéphane Wirtel [Thu, 1 Feb 2018 07:31:07 +0000 (08:31 +0100)]
bpo-32722: Remove useless example in the Classes tutorial (#5446)
In the tutorial about the Generator expression, there is an example with
a dict comprehension and not with a generator expression, just removed
the code.
Cheryl Sabella [Wed, 31 Jan 2018 21:37:51 +0000 (16:37 -0500)]
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
The f-string example for using datetime format specifier does not match the given output.
Changed the format from %b to %B so it matches the output of "January".