]> granicus.if.org Git - python/log
python
7 years agobpo-30375: Correct the stacklevel of regex compiling warnings. (#1595)
Serhiy Storchaka [Tue, 16 May 2017 12:16:15 +0000 (15:16 +0300)]
bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595)

Warnings emitted when compile a regular expression now always point
to the line in the user code.  Previously they could point into inners
of the re module if emitted from inside of groups or conditionals.

7 years agobpo-29898: Fix incorrect env variable name (GH-1576)
Berker Peksag [Tue, 16 May 2017 09:36:45 +0000 (12:36 +0300)]
bpo-29898: Fix incorrect env variable name (GH-1576)

It should read PYTHONLEGACYWINDOWSSTDIO as stated
in section "Add legacy mode" in PEP 528.

7 years agoRemove unused variable in test_urllibnet. (#1598)
Senthil Kumaran [Tue, 16 May 2017 06:08:07 +0000 (23:08 -0700)]
Remove unused variable in test_urllibnet. (#1598)

7 years ago bpo-29651 - Cover edge case of square brackets in urllib docs (#1128)
Howie Benefiel [Tue, 16 May 2017 04:48:16 +0000 (23:48 -0500)]
 bpo-29651 - Cover edge case of square brackets in urllib docs (#1128)

7 years agobpo-30339: test_multiprocessing_main_handling timeout (#1593)
Victor Stinner [Mon, 15 May 2017 16:14:42 +0000 (18:14 +0200)]
bpo-30339: test_multiprocessing_main_handling timeout (#1593)

test_multiprocessing_main_handling: increase the test_source timeout
from 10 seconds to 60 seconds, since the test fails randomly on busy
buildbots.

7 years agobpo-30357: test_thread now uses threading_cleanup() (#1592)
Victor Stinner [Mon, 15 May 2017 15:55:32 +0000 (17:55 +0200)]
bpo-30357: test_thread now uses threading_cleanup() (#1592)

test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.

Co-Authored-By: Grzegorz Grzywacz <grzegorz.grzywacz@nazwa.pl>
7 years agobpo-30329: Catch Windows error 10022 on shutdown() (#1538)
Victor Stinner [Mon, 15 May 2017 15:33:45 +0000 (17:33 +0200)]
bpo-30329: Catch Windows error 10022 on shutdown() (#1538)

Catch the Windows socket WSAEINVAL error (code 10022) in imaplib and
poplib on shutdown(SHUT_RDWR): An invalid operation was attempted

This error occurs sometimes on SSL connections.

7 years agobpo-29196: Removed old-deprecated classes Plist, Dict and _InternalDict (#488)
Serhiy Storchaka [Mon, 15 May 2017 10:21:31 +0000 (13:21 +0300)]
bpo-29196: Removed old-deprecated classes Plist, Dict and _InternalDict (#488)

in the plistlib module.  Dict values in the result of functions
readPlist() and readPlistFromBytes() are now exact dicts.

7 years agobpo-9850: Document macpath deprecation in Misc/NEWS (#1590)
Victor Stinner [Mon, 15 May 2017 09:39:10 +0000 (11:39 +0200)]
bpo-9850: Document macpath deprecation in Misc/NEWS (#1590)

7 years agobpo-9850: Deprecate the macpath module (#1540)
Victor Stinner [Mon, 15 May 2017 09:01:21 +0000 (11:01 +0200)]
bpo-9850: Deprecate the macpath module (#1540)

Co-Authored-By: Chi Hsuan Yen <yan12125@gmail.com>.
7 years agobpo-30242: resolve some undefined behaviours in struct (#1418)
Xiang Zhang [Mon, 15 May 2017 04:04:26 +0000 (12:04 +0800)]
bpo-30242: resolve some undefined behaviours in struct (#1418)

7 years agobpo-30110: fix resource leak in test_asyncio.test_events (#1413)
Xiang Zhang [Mon, 15 May 2017 03:56:40 +0000 (11:56 +0800)]
bpo-30110: fix resource leak in test_asyncio.test_events (#1413)

7 years agobpo-30224: remove outdated checks in struct (#1374)
Xiang Zhang [Mon, 15 May 2017 03:53:51 +0000 (11:53 +0800)]
bpo-30224: remove outdated checks in struct (#1374)

7 years agobpo-30354: Update data model documentation for super() (GH-1561)
csabella [Mon, 15 May 2017 03:42:00 +0000 (20:42 -0700)]
bpo-30354: Update data model documentation for super() (GH-1561)

The data model section of the language reference was written well
before the zero-argument form of super() was added.

To avoid giving the impression that they're doing something
unusual, this updates the description of `__new__` and `__init__`
to use the zero-argument form.

Patch by Cheryl Sabella.

7 years agobpo-29763: Clean up _pth tests (GH-954)
Zachary Ware [Sun, 14 May 2017 20:49:46 +0000 (15:49 -0500)]
bpo-29763: Clean up _pth tests (GH-954)

7 years agobpo-30358: Document sort argument of profile.runctx() (GH-1566)
csabella [Sun, 14 May 2017 07:02:38 +0000 (03:02 -0400)]
bpo-30358: Document sort argument of profile.runctx() (GH-1566)

7 years agobpo-30299: Display a bytecode when compile a regex in debug mode. (#1491)
Serhiy Storchaka [Sun, 14 May 2017 06:05:13 +0000 (09:05 +0300)]
bpo-30299: Display a bytecode when compile a regex in debug mode. (#1491)

`re.compile(..., re.DEBUG)` now displays the compiled bytecode in
human readable form.

7 years agobpo-30340: Enhanced regular expressions optimization. (#1542)
Serhiy Storchaka [Sun, 14 May 2017 05:32:33 +0000 (08:32 +0300)]
bpo-30340: Enhanced regular expressions optimization. (#1542)

This increased the performance of matching some patterns up to 25 times.

7 years agoMove Codecov's configuration file under .github (GH-1494)
morrme [Sat, 13 May 2017 20:34:06 +0000 (15:34 -0500)]
Move Codecov's configuration file under .github (GH-1494)

7 years agobpo-30178: Add Jim Fasarakis-Hilliard to Misc/ACKS (GH-1572)
Mariatta [Sat, 13 May 2017 16:59:08 +0000 (09:59 -0700)]
bpo-30178: Add Jim Fasarakis-Hilliard to Misc/ACKS (GH-1572)

7 years agobpo-30178: Indent methods and attributes of MimeType class (GH-1306)
Jim Fasarakis-Hilliard [Sat, 13 May 2017 16:34:27 +0000 (19:34 +0300)]
bpo-30178: Indent methods and attributes of MimeType class (GH-1306)

7 years agobpo-28974: `object.__format__(x, '')` is now equivalent to `str(x)` (#506)
Serhiy Storchaka [Sat, 13 May 2017 09:40:52 +0000 (12:40 +0300)]
bpo-28974: `object.__format__(x, '')` is now equivalent to `str(x)` (#506)

rather than `format(str(self), '')`.

7 years agobpo-30341: Improve _PyTrash_thread_destroy_chain() a little bit (#1545)
Xiang Zhang [Sat, 13 May 2017 05:36:14 +0000 (13:36 +0800)]
bpo-30341: Improve _PyTrash_thread_destroy_chain() a little bit (#1545)

* add a comment about why we need to increase trash_delete_nesting
* move increase and decrese outside of the loop

7 years agoPCbuild/build.bat: Add note about using msbuild response file. (#1551)
Charles [Fri, 12 May 2017 23:23:15 +0000 (06:23 +0700)]
PCbuild/build.bat: Add note about using msbuild response file. (#1551)

Using a response file will eliminate the headache associated with batch argument/quote processing.

For example I unsucessfully compiled python with visualcpptools when specifying VSInstallDir in the batch file (cannot find vcruntime.h)

```batch
build.bat -p x64 -e -M --no-tkinter  "/p:VCInstallDir=%VCInstallDir%"
```

but it build successfully when specifying it in a response file

msbuild.rsp:
```
/p:VCInstallDir=%VCInstallDir%
```

7 years agobpo-30291 Changes to launcher so as to allow py -3-32, -2.7-64, 3.10, etc.
Steve (Gadget) Barnes [Fri, 12 May 2017 23:21:26 +0000 (00:21 +0100)]
bpo-30291 Changes to launcher so as to allow py -3-32, -2.7-64, 3.10, etc.

bpo-30291 Changes to launcher so as to allow py -3-32, -2.7-64, 3.10, etc.

7 years agoIndented Handler sections for improved clarity. (#1554)
Vinay Sajip [Fri, 12 May 2017 08:38:13 +0000 (09:38 +0100)]
Indented Handler sections for improved clarity. (#1554)

Indented parts of the Handler class documentation for improved presentation, analogous to a recent similar change for the Logger class.

7 years agoComment as to why docs are built against Python 3.6 (#1550)
Brett Cannon [Thu, 11 May 2017 17:45:34 +0000 (10:45 -0700)]
Comment as to why docs are built against Python 3.6 (#1550)

7 years agobpo-30308: Code coverage for argument in random.shuffle (#1504)
csabella [Thu, 11 May 2017 15:19:35 +0000 (11:19 -0400)]
bpo-30308: Code coverage for argument in random.shuffle (#1504)

* bpo-30308: Code coverage for argument in random.shuffle

* bpo-30308: Code coverage for argument in random.shuffle

* bpo-30308: Code coverage for argument in random.shuffle

7 years agobpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)
INADA Naoki [Thu, 11 May 2017 12:18:38 +0000 (21:18 +0900)]
bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)

when there are no more `await` or `yield (from)` before return in coroutine,
cancel was ignored.

example:

    async def coro():
        asyncio.Task.current_task().cancel()
        return 42
    ...
    res = await coro()  # should raise CancelledError

7 years ago#30190: fix invalid escape sequence warnings (#1534)
Giampaolo Rodola [Wed, 10 May 2017 18:13:20 +0000 (20:13 +0200)]
#30190: fix invalid escape sequence warnings (#1534)

7 years agobpo-28787: Fix out of tree --with-dtrace builds (#135)
stratakis [Wed, 10 May 2017 15:08:15 +0000 (17:08 +0200)]
bpo-28787: Fix out of tree --with-dtrace builds (#135)

* bpo-28787: Fix out of tree --with-dtrace builds

* Unsilence directory creation

* Add Misc/NEWS and Misc/ACKS entries

7 years agobpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480)
Xiang Zhang [Wed, 10 May 2017 10:19:41 +0000 (18:19 +0800)]
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480)

7 years agobpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490)
Serhiy Storchaka [Wed, 10 May 2017 03:05:20 +0000 (06:05 +0300)]
bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490)

Now allowed several subsequential inline modifiers at the start of the
pattern (e.g. '(?i)(?s)...').  In verbose mode whitespaces and comments
now are allowed before and between inline modifiers (e.g.
'(?x) (?i) (?s)...').

7 years agobpo-30320: test_eintr now uses pthread_sigmask() (#1523)
Victor Stinner [Wed, 10 May 2017 00:37:42 +0000 (02:37 +0200)]
bpo-30320: test_eintr now uses pthread_sigmask() (#1523)

Rewrite sigwaitinfo() and sigtimedwait() unit tests for EINTR using
pthread_sigmask() to fix a race condition between the child and the
parent process.

Remove the pipe which was used as a weak workaround against the race
condition.

sigtimedwait() is now tested with a child process sending a signal
instead of testing the timeout feature which is more unstable
(especially regarding to clock resolution depending on the platform).

7 years agoPCbuild/build.bat: pass command line parameters when building PGO (#1510)
Charles [Tue, 9 May 2017 21:58:48 +0000 (04:58 +0700)]
PCbuild/build.bat: pass command line parameters when building PGO (#1510)

Custom msbuild properties passed as command line need to be passed too when calling `Build` when doing PGO build.

7 years agobpo-30285: Optimize case-insensitive matching and searching (#1482)
Serhiy Storchaka [Tue, 9 May 2017 20:37:14 +0000 (23:37 +0300)]
bpo-30285: Optimize case-insensitive matching and searching (#1482)

of regular expressions.

7 years agobpo-30024: Circular imports involving absolute imports with binding (#1264)
Serhiy Storchaka [Tue, 9 May 2017 19:31:05 +0000 (22:31 +0300)]
bpo-30024: Circular imports involving absolute imports with binding (#1264)

a submodule to a name are now supported.

7 years agobpo-30273: update distutils.sysconfig for venv's created from Python (#1515)
Jeremy Kloth [Tue, 9 May 2017 15:24:13 +0000 (09:24 -0600)]
bpo-30273: update distutils.sysconfig for venv's created from Python (#1515)

compiled out-of-tree (builddir != srcdir). (see also bpo-15366)

7 years agobpo-30258: regrtest: Fix run_tests_multiprocess() (#1479)
Victor Stinner [Tue, 9 May 2017 09:34:01 +0000 (11:34 +0200)]
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479)

If the child process exited with a non-zero code, don't strip the
last line of stdout anymore.

Add also a sanity check in accumulate_result().

7 years agobpo-29990: Fix range checking in GB18030 decoder (#1495)
Xiang Zhang [Tue, 9 May 2017 03:38:32 +0000 (11:38 +0800)]
bpo-29990: Fix range checking in GB18030 decoder (#1495)

When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.

7 years agobpo-30289: remove Misc/python-config.sh when make distclean (#1498)
Xiang Zhang [Tue, 9 May 2017 02:32:13 +0000 (10:32 +0800)]
bpo-30289: remove Misc/python-config.sh when make distclean (#1498)

7 years agobpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (...
Pierre Quentel [Mon, 8 May 2017 12:08:34 +0000 (14:08 +0200)]
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991)

7 years agoFix a trivial typo in global section (#1497)
Jim Fasarakis-Hilliard [Mon, 8 May 2017 11:36:29 +0000 (14:36 +0300)]
Fix a trivial typo in global section (#1497)

7 years agoCloses bpo-30168: indent methods in Logger Class (#1295)
Jim Fasarakis-Hilliard [Sun, 7 May 2017 18:40:18 +0000 (21:40 +0300)]
Closes bpo-30168: indent methods in Logger Class (#1295)

7 years agoRevert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484)
Serhiy Storchaka [Sat, 6 May 2017 11:46:01 +0000 (14:46 +0300)]
Revert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484)

7 years agobpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367)
Jelle Zijlstra [Fri, 5 May 2017 21:27:12 +0000 (14:27 -0700)]
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367)

Thanks to Jelle Zijlstra for the patch.

7 years agobpo-29243: Fix Makefile with respect to --enable-optimizations (#1478)
torsava [Fri, 5 May 2017 15:35:50 +0000 (17:35 +0200)]
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478)

* bpo-29243: Fix Makefile with respect to --enable-optimizations

When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.

Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.

* !squash

7 years agobpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849)
masklinn [Fri, 5 May 2017 08:15:12 +0000 (10:15 +0200)]
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849)

7 years agobpo-30279: Remove unused Python/thread_foobar.h (#1473)
Masayuki Yamamoto [Fri, 5 May 2017 08:04:13 +0000 (17:04 +0900)]
bpo-30279: Remove unused Python/thread_foobar.h (#1473)

Python/thread_foobar.h is the template code that is threading adaptation
for new platforms, also hasn't been used on actual platforms.
Python/thread_*.h give concrete examples of adaptation instead of the
template code.

7 years agobpo-30264: ExpatParser closes the source on error (#1451)
Victor Stinner [Fri, 5 May 2017 07:46:47 +0000 (09:46 +0200)]
bpo-30264: ExpatParser closes the source on error (#1451)

ExpatParser.parse() of xml.sax.xmlreader now always closes the
source: close the file object or the urllib object if source is a
string (not an open file-like object). The change fixes a
ResourceWarning on parsing error.

Add test_parse_close_source() unit test.

7 years agobpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and _sre.unicode_tolower...
Serhiy Storchaka [Fri, 5 May 2017 07:42:46 +0000 (10:42 +0300)]
bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and _sre.unicode_tolower(). (#1468)

7 years agobpo-30243: Fixed the possibility of a crash in _json. (#1420)
Serhiy Storchaka [Fri, 5 May 2017 07:08:49 +0000 (10:08 +0300)]
bpo-30243: Fixed the possibility of a crash in _json. (#1420)

It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed.

7 years agobpo-30215: Make re.compile() locale agnostic. (#1361)
Serhiy Storchaka [Fri, 5 May 2017 05:53:40 +0000 (08:53 +0300)]
bpo-30215: Make re.compile() locale agnostic. (#1361)

Compiled regular expression objects with the re.LOCALE flag no longer
depend on the locale at compile time.  Only the locale at matching
time affects the result of matching.

7 years agoMake code coverage less strict (GH-1438)
Brett Cannon [Thu, 4 May 2017 21:58:54 +0000 (14:58 -0700)]
Make code coverage less strict (GH-1438)

Set the target to be 90% since there is enough OS-specific code and things that require manual testing that we will never hit 100%. Also turn off the status checks since they are so inconsistent in terms of flagging a PR as passing/failing that they aren't useful and can actually block merging from a phone.

7 years agobpo-30273: Update sysconfig (#1464)
Victor Stinner [Thu, 4 May 2017 21:29:09 +0000 (23:29 +0200)]
bpo-30273: Update sysconfig (#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8e9f0de6c4133825a5710984a3cd5e102b (bpo-23404).

AST_H_DIR was hardcoded to "Include", so replace the removed variable
by its content.

Remove also ASDLGEN variable from sysconfig example since this
variable was also removed.

7 years agobpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319)
Antoine Pitrou [Thu, 4 May 2017 14:44:53 +0000 (16:44 +0200)]
bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319)

* bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver

* Tweak comment

7 years agobpo-30263: regrtest: log system load (#1452)
Victor Stinner [Thu, 4 May 2017 13:21:12 +0000 (15:21 +0200)]
bpo-30263: regrtest: log system load (#1452)

* bpo-30263: regrtest: log system load

* regrtest: log the number of CPUs

Log the number of CPUs in the header. --verbose now imply --header.

7 years agobpo-29956: Improve the math.exp() related documentation. (#1073)
Serhiy Storchaka [Thu, 4 May 2017 09:25:09 +0000 (12:25 +0300)]
bpo-29956: Improve the math.exp() related documentation. (#1073)

7 years agobpo-30166: Import command-line parsing modules only when needed. (#1293)
Serhiy Storchaka [Thu, 4 May 2017 05:17:47 +0000 (08:17 +0300)]
bpo-30166: Import command-line parsing modules only when needed. (#1293)

7 years agobpo-30225: Fix is_valid_fd() on macOS Tiger (#1443)
Victor Stinner [Wed, 3 May 2017 22:45:56 +0000 (00:45 +0200)]
bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443)

is_valid_fd() now uses fstat() instead of dup() on macOS to return 0
on a pipe when the other side of the pipe is closed. fstat() fails
with EBADF in that case, whereas dup() succeed.

7 years agobpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)
Serhiy Storchaka [Wed, 3 May 2017 21:03:23 +0000 (00:03 +0300)]
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)

7 years agoAdd myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425)
Christian Heimes [Wed, 3 May 2017 18:17:54 +0000 (20:17 +0200)]
Add myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoExplicitly mention what should (not) be discussed on GitHub (GH-1437)
Brett Cannon [Wed, 3 May 2017 17:51:55 +0000 (10:51 -0700)]
Explicitly mention what should (not) be discussed on GitHub (GH-1437)

7 years agobpo-28315: Improve code examples in docs (GH-1372)
UltimateCoder [Wed, 3 May 2017 16:46:45 +0000 (22:16 +0530)]
bpo-28315: Improve code examples in docs (GH-1372)

Replace
   File "<stdin>", line 1, in ?
with
   File "<stdin>", line 1, in <module>

7 years agobpo-23404: make touch becomes make regen-all (#1405)
Victor Stinner [Wed, 3 May 2017 16:21:48 +0000 (18:21 +0200)]
bpo-23404: make touch becomes make regen-all (#1405)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.

7 years agobpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)
Xiang Zhang [Wed, 3 May 2017 03:16:21 +0000 (11:16 +0800)]
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)

7 years agoFix tests: getsockname() can return None on OS X on unbound sockets (#1400)
Antoine Pitrou [Tue, 2 May 2017 21:48:26 +0000 (23:48 +0200)]
Fix tests: getsockname() can return None on OS X on unbound sockets (#1400)

7 years agobpo-30232: Regenerate configure (#1396)
Victor Stinner [Tue, 2 May 2017 20:35:58 +0000 (22:35 +0200)]
bpo-30232: Regenerate configure (#1396)

Run autoconf.

7 years agobpo-30232: Support Git worktree in configure.ac (#1391)
Victor Stinner [Tue, 2 May 2017 19:42:48 +0000 (21:42 +0200)]
bpo-30232: Support Git worktree in configure.ac (#1391)

Don't test if .git/HEAD file exists, but only if the .git file (or
directory) exists.

7 years agoRemove outdated tests in test_isinstance (GH-1393)
Jim Fasarakis-Hilliard [Tue, 2 May 2017 17:17:18 +0000 (20:17 +0300)]
Remove outdated tests in test_isinstance (GH-1393)

There is no need to test for new-style classes versus classic classes in Python 3.

7 years agobpo-28556: Routine updates to typing (#1366)
Ivan Levkivskyi [Tue, 2 May 2017 17:14:07 +0000 (19:14 +0200)]
bpo-28556: Routine updates to typing (#1366)

- Add NoReturn type
- Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard)
- Minor bug-fixes

7 years agobpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)
Antoine Pitrou [Tue, 2 May 2017 15:20:00 +0000 (17:20 +0200)]
bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)

* bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux

* Add NEWS entry

7 years agoFix typo in selectors.rst (#1383)
Tong SHEN [Tue, 2 May 2017 13:27:57 +0000 (21:27 +0800)]
Fix typo in selectors.rst (#1383)

decriptor -> descriptor

7 years agobpo-30228: FileIO seek() and tell() set seekable (#1384)
Victor Stinner [Tue, 2 May 2017 13:10:39 +0000 (15:10 +0200)]
bpo-30228: FileIO seek() and tell() set seekable (#1384)

FileIO.seek() and FileIO.tell() method now set the internal seekable
attribute to avoid one syscall on open() (in buffered or text mode).

The seekable property is now also more reliable since its value is
set correctly on memory allocation failure.

7 years agobpo-30199: test_ssl closes all asyncore channels (#1381)
Victor Stinner [Tue, 2 May 2017 11:12:02 +0000 (13:12 +0200)]
bpo-30199: test_ssl closes all asyncore channels (#1381)

AsyncoreEchoServer of test_ssl now calls
asyncore.close_all(ignore_all=True) to ensure that
asyncore.socket_map is cleared once the test completes, even if
ConnectionHandler was not correctly unregistered.

Fix the following warning:

Warning -- asyncore.socket_map was modified by test_ssl
  Before: {}
  After:  {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}

7 years agobpo-30132: distutils BuildExtTestCase use temp_cwd (#1380)
Victor Stinner [Tue, 2 May 2017 11:11:50 +0000 (13:11 +0200)]
bpo-30132: distutils BuildExtTestCase use temp_cwd (#1380)

BuildExtTestCase of test_distutils now uses support.temp_cwd() in
setUp() to remove files created in the current working in all
BuildExtTestCase unit tests, not only test_build_ext().

Move also tearDown() just after setUp().

7 years agoClean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition ...
Nathaniel J. Smith [Tue, 2 May 2017 05:43:31 +0000 (22:43 -0700)]
Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition (#1355)

7 years agobpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331)
Giampaolo Rodola [Mon, 1 May 2017 16:18:56 +0000 (18:18 +0200)]
bpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331)

* #30190 / unittest / assertAlmostEqual(delta=...) / error msg: show the difference between the 2 numbers in case of failure

* safe_repr() diff

* also show difference when passing 'places' argument

* refactoring

* update Misc/NEWS

7 years agorestore *data* parameter of binascii.b2a_base64 to positional-only (#1352)
Xiang Zhang [Mon, 1 May 2017 05:12:07 +0000 (13:12 +0800)]
restore *data* parameter of binascii.b2a_base64 to positional-only (#1352)

7 years agobpo-29679: Implement @contextlib.asynccontextmanager (#360)
Jelle Zijlstra [Mon, 1 May 2017 01:25:58 +0000 (18:25 -0700)]
bpo-29679: Implement @contextlib.asynccontextmanager (#360)

7 years agobpo-30208: DOC: fix small typos in IDLE (#1354)
csabella [Sat, 29 Apr 2017 22:28:36 +0000 (18:28 -0400)]
bpo-30208: DOC: fix small typos in IDLE (#1354)

7 years agobpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (...
Serhiy Storchaka [Sat, 29 Apr 2017 04:06:49 +0000 (07:06 +0300)]
bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285)

7 years agoCheck that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332)
Neil Schemenauer [Fri, 28 Apr 2017 16:56:48 +0000 (09:56 -0700)]
Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332)

7 years agobpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)
Serhiy Storchaka [Fri, 28 Apr 2017 16:17:26 +0000 (19:17 +0300)]
bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

* Update docstrings.

7 years agoImprove the grammar in windows.rst (GH-1330)
Wieland Hoffmann [Fri, 28 Apr 2017 16:12:57 +0000 (18:12 +0200)]
Improve the grammar in windows.rst (GH-1330)

7 years agobpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340)
Victor Stinner [Fri, 28 Apr 2017 13:07:10 +0000 (15:07 +0200)]
bpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340)

On clang, only compile dtoa.c with -fno-strict-aliasing, use strict
aliasing to compile all other C files.

7 years agobpo-30174: Remove duplicate definition from pickletools (#1301)
Jelle Zijlstra [Thu, 27 Apr 2017 16:05:26 +0000 (09:05 -0700)]
bpo-30174: Remove duplicate definition from pickletools (#1301)

There were two almost identical definitions of bytes1.

7 years agobpo-30175: Skip client cert tests of test_imaplib (#1320)
Victor Stinner [Thu, 27 Apr 2017 15:30:13 +0000 (17:30 +0200)]
bpo-30175: Skip client cert tests of test_imaplib (#1320)

* bpo-30175: Skip client cert tests of test_imaplib

The IMAP server cyrus.andrew.cmu.edu doesn't accept our randomly
generated client x509 certificate anymore.

* bpo-30188: Catch EOFError in NetworkedNNTPTests

test_nntplib fails randomly with EOFError in
NetworkedNNTPTests.setUpClass(). Catch EOFError to skip tests in that
case.

7 years agobpo-27200: Fix several doctests (GH-604)
Marco Buttu [Thu, 27 Apr 2017 12:23:34 +0000 (14:23 +0200)]
bpo-27200: Fix several doctests (GH-604)

7 years agoUse the correct name for ISO in Unicode HOWTO. (#1312)
Jesse Gonzalez [Thu, 27 Apr 2017 05:12:17 +0000 (00:12 -0500)]
Use the correct name for ISO in Unicode HOWTO. (#1312)

7 years agobpo-28415: Note 0 conversion different between Python and C (#885)
Louie Lu [Thu, 27 Apr 2017 03:36:35 +0000 (11:36 +0800)]
bpo-28415: Note 0 conversion different between Python and C (#885)

7 years agobpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1296)
Dong-hee Na [Wed, 26 Apr 2017 16:16:21 +0000 (01:16 +0900)]
bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1296)

7 years agobpo-30101: Add support for curses.A_ITALIC. (#1015)
Eijebong [Wed, 26 Apr 2017 15:17:12 +0000 (17:17 +0200)]
bpo-30101: Add support for curses.A_ITALIC. (#1015)

7 years agobpo-30131: test_logging now joins queue threads (#1298)
Victor Stinner [Wed, 26 Apr 2017 13:56:25 +0000 (15:56 +0200)]
bpo-30131: test_logging now joins queue threads (#1298)

QueueListenerTest of test_logging now closes the multiprocessing
Queue and joins its thread to prevent leaking dangling threads to
following tests.

Add also @support.reap_threads to detect earlier if a test leaks
threads (and try to "cleanup" these threads).

7 years agotimemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)
Victor Stinner [Wed, 26 Apr 2017 11:51:48 +0000 (13:51 +0200)]
timemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)

bpo-28769 changed PyUnicode_AsUTF8() return type from const char* to
char* in Python 3.7, but tm_zone field type of the tm structure is
char* on FreeBSD.

Cast PyUnicode_AsUTF8() to char* in gettmarg() to fix the warning:

    Modules/timemodule.c:443:20: warning: assigning to 'char *'
    from 'const char *' discards qualifiers

7 years agobpo-29974: Improve typing.TYPE_CHECKING example (GH-982)
Mathias Rav [Wed, 26 Apr 2017 10:49:45 +0000 (06:49 -0400)]
bpo-29974: Improve typing.TYPE_CHECKING example (GH-982)

* Fix PEP 8 (SomeType instead of some_type)
* Add a function parameter annotation
* Explain, using wording from PEP 484 and PEP 526,
  why one annotation is in quotes and another is not.

Suggested by Ivan Levkevskyi.

7 years agobpo-28698: Fix c_wchar_p doc example (GH-1160)
Louie Lu [Wed, 26 Apr 2017 08:15:05 +0000 (16:15 +0800)]
bpo-28698: Fix c_wchar_p doc example (GH-1160)

7 years agobpo-30052: Link `bytes` & `bytearray` to stdtypes not functions (GH-1271)
csabella [Wed, 26 Apr 2017 05:47:01 +0000 (01:47 -0400)]
bpo-30052: Link `bytes` & `bytearray` to stdtypes not functions  (GH-1271)

Builtin container types have two potential link targets in the docs:

- their entry in the list of builtin callables
- their type documentation

This change brings `bytes` and `bytearray` into line with other
container types by having cross-references default to linking to
their type documentation, rather than their builtin callable entry.

7 years agobpo-30107: Make SuppressCrashReport quiet on macOS (#1279)
Victor Stinner [Tue, 25 Apr 2017 22:55:08 +0000 (00:55 +0200)]
bpo-30107: Make SuppressCrashReport quiet on macOS (#1279)

On macOS, SuppressCrashReport now redirects /usr/bin/defaults command
stderr into a pipe to not pollute stderr. It fixes a
test_io.test_daemon_threads_shutdown_stderr_deadlock() failure when
the CrashReporter domain doesn't exists. Message logged into stderr:

2017-04-24 16:57:21.432 defaults[41046:2462851]
The domain/default pair of (com.apple.CrashReporter, DialogType) does not exist

7 years agobpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926)
Jim Fasarakis-Hilliard [Tue, 25 Apr 2017 18:26:36 +0000 (21:26 +0300)]
bpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926)