Commit Graph

23854 Commits

Author SHA1 Message Date
jlacoline ea2ef5d0ca bpo-31632: fix set_protocol() in _SSLProtocolTransport (#3817) (#3817) 2017-10-19 13:49:57 -04:00
Łukasz Langa ce9e625445 bpo-31457: Don't omit inner ``process()`` calls with nested LogAdapters (#4044)
This used to be the case on Python 2.  Commit
212b590e11 changed the implementation for Python
3, making the `log()` method of LogAdapter call `logger._log()` directly.  This
makes nested log adapters not execute their ``process()`` method.  This patch
fixes the issue.

Also, now proxying `name`, too, to make `repr()` work with nested log adapters.

New tests added.
2017-10-19 10:24:55 -07:00
Łukasz Langa 0b6a118a45 bpo-31457: Make the `LoggerAdapter.manager` property settable (#4042)
Due to a bug in the initial fix, the setter was in fact creating a different
property.  This is now fixed.
2017-10-18 17:28:51 -07:00
Victor Stinner 884d13a55f time.clock() now emits a DeprecationWarning (GH-4020)
bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.

Replace time.clock() with time.perf_counter() in tests and demos.

Remove also hasattr(time, 'monotonic') in test_time since time.monotonic()
is now always available since Python 3.5.
2017-10-17 14:46:45 -07:00
Zane Bitter de86073a76 bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014) 2017-10-18 00:29:39 +03:00
Riccardo Coccioli 6cfa927ceb bpo-31334: Fix timeout in select.poll.poll() (GH-3277)
Always pass -1, or INFTIM where defined, to the poll() system call when
a negative timeout is passed to the poll.poll([timeout]) method in the
select module. Various OSes throw an error with arbitrary negative
values.
2017-10-17 12:45:07 -07:00
Pablo Galindo 2c15b29aea bpo-31786: Make functions in the select module blocking when timeout is a small negative value. (#4003) 2017-10-17 17:14:41 +03:00
brainfvck c75edabbb6 bpo-31558: Add gc.freeze() (#3705)
Freeze all the objects tracked by gc - move them to a permanent generation
and ignore all the future collections. This can be used before a POSIX
fork() call to make the gc copy-on-write friendly or to speed up collection.
2017-10-16 12:49:41 -07:00
Serhiy Storchaka 676db4bbf2 bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007) 2017-10-16 10:38:14 +03:00
Victor Stinner a505ecdc50 bpo-31676: Fix test_imp.test_load_source() side effect (#3871)
test_load_source() now replaces the current __name__ module with a
temporary module to prevent side effects.
2017-10-13 13:47:49 -07:00
Victor Stinner ccef823939 bpo-25588: Fix regrtest when run inside IDLE (#3962)
When regrtest in run inside IDLE, sys.stdout and sys.stderr are not
TextIOWrapper objects and have no file descriptor associated:
sys.stderr.fileno() raises io.UnsupportedOperation.

Disable faulthandler and don't replace sys.stdout in that case.
2017-10-13 12:59:12 -07:00
INADA Naoki b22273ec5d bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872)
Pattern `[a-z]` with `IGNORECASE` flag can match to some non-ASCII characters.

Straightforward solution for this is using `IGNORECASE | ASCII` flag.
But users may subclass `Template` and override only `idpattern`. So we want to
avoid changing `Template.flags`.

So this commit uses local flag `-i` for `idpattern` and change `[a-z]` to `[a-zA-Z]`.
2017-10-13 16:02:23 +09:00
Serhiy Storchaka de07210077 bpo-30058: Fixed buffer overflow in select.kqueue.control(). (#1095) 2017-10-12 22:17:46 +03:00
Éric Araujo 03b9537dc5 bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966) 2017-10-12 12:28:55 -04:00
Oren Milman 39ecb9c71b bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of Element.text and Element.tail (#3924) 2017-10-10 23:26:24 +03:00
Victor Stinner 6e3d6b5dc2 bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929)
bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM
exceptions.
2017-10-09 09:52:32 -07:00
Oren Milman 0ccc0f6c74 bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (#3840) 2017-10-08 11:17:46 +03:00
Serhiy Storchaka f07e2b64df bpo-31642: Restore blocking "from" import by setting None in sys.modules. (#3834) 2017-10-08 10:44:10 +03:00
Zachary Ware 73ffd3f203 bpo-31724: Skip test_xmlrpc_net (GH-3921)
With the upgrade of buildbot.python.org from Buildbot 0.8.x to 0.9.x,
the xmlrpc interface has been removed.  This test is now skipped until
it can be rewritten to query a suitable substitute.
2017-10-08 01:31:23 -05:00
Serhiy Storchaka 79ba471488 bpo-31655: Validate keyword names in SimpleNamespace constructor. (#3909) 2017-10-07 22:59:35 +03:00
Yury Selivanov b8ab9d3fc8 bpo-31708: Allow async generator expressions in synchronous functions (#3905) 2017-10-06 02:58:28 -04:00
Yury Selivanov faa135acbf bpo-31709: Drop support for asynchronous __aiter__. (#3903) 2017-10-06 02:08:57 -04:00
Benjamin Peterson 86566702f3 weaken pthread_getcpuclockid test (more bpo-31596) (#3904)
There just isn't much we can assert in a portable way.
2017-10-05 22:50:42 -07:00
Jelle Zijlstra ac317700ce bpo-30406: Make async and await proper keywords (#1669)
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
2017-10-05 23:24:46 -04:00
Barry Warsaw 36c1d1f1e5 PEP 553 built-in breakpoint() function (bpo-31353) (#3355)
Implement PEP 553, built-in breakpoint() with support from sys.breakpointhook(), along with documentation and tests.  Closes bpo-31353
2017-10-05 12:11:18 -04:00
Victor K 4d07189788 bpo-31556: asyncio.wait_for can cancel futures faster with timeout <= 0 (#3703) 2017-10-05 12:04:39 -04:00
Victor Stinner 11045c9d8a bpo-31178: Mock os.waitpid() in test_subprocess (#3896)
Fix test_exception_errpipe_bad_data() and
test_exception_errpipe_normal() of test_subprocess: mock os.waitpid()
to avoid calling the real os.waitpid(0, 0) which is an unexpected
side effect of the test.
2017-10-05 06:32:53 -07:00
pdox e14679c784 closes bpo-31596: Add an interface for pthread_getcpuclockid(3) (#3756) 2017-10-05 00:01:56 -07:00
Serhiy Storchaka 77732be801 bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667) 2017-10-04 20:25:40 +03:00
Serhiy Storchaka 0b5e61ddca bpo-30397: Add re.Pattern and re.Match. (#1646) 2017-10-04 20:09:49 +03:00
Serhiy Storchaka 27c623c845 bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and split() (#3866)
when pass a string larger than 2 GiB.

Decrease memory requirements for Tcl's bigmem tests.
2017-10-03 22:39:55 +03:00
diana 543386b7f0 bpo-31657: Add test coverage for the __debug__ case (GH-3450)
Update the compile tests for optimization levels to also check that
__debug__ blocks are included or excluded based on the optimization
level.
Patch by Diana Clarke.
2017-10-03 09:46:56 -07:00
Serhiy Storchaka 85c0b8941f bpo-31619: Fixed a ValueError when convert a string with large number of underscores (#3827)
to integer with binary base.
2017-10-03 14:13:44 +03:00
Thomas Moreau e8c368df22 bpo-31540: Allow passing multiprocessing context to ProcessPoolExecutor (#3682) 2017-10-03 11:53:17 +02:00
Victor Stinner e6cfdefa0c bpo-31510: Fix multiprocessing test_many_processes() on macOS (#3857)
On macOS, a process can exit with -SIGKILL if it is killed "early"
with SIGTERM.
2017-10-02 08:27:34 -07:00
Antoine Pitrou 1023dbbcb7 bpo-31516: current_thread() should not return a dummy thread at shutdown (#3673)
bpo-31516: current_thread() should not return a dummy thread at shutdown
2017-10-02 16:42:15 +02:00
Cornelius Diekmann e6f62f69f0 bpo-31158: Fix nondeterministic read in test_pty (#3808)
* bpo-31158: Fix nondeterministic read in test_pty

* Reuse existing readline implementation from io.

Thx to @pitrou

* Updated comment

Ideally, this commit is fixuped into the previous commit. Since there is
already a comment on github, I won't rebase.
2017-10-02 02:39:55 -07:00
Oren Milman 7dc46d8cf5 bpo-31592: Fix an assertion failure in Python parser in case of a bad unicodedata.normalize(). (#3767) 2017-09-30 20:16:24 +03:00
Serhiy Storchaka f4ea642cb6 bpo-31627: Make test_mailbox be lenient to empty hostname. (#3821) 2017-09-30 17:10:57 +03:00
scoder 101a5e84ac bpo-31648: Improve ElementPath (#3835)
* Allow whitespace inside of ElementPath predicates.
* Add ElementPath predicate support for text comparison of the current node, like "[.='text']".
2017-09-30 16:35:21 +03:00
INADA Naoki 9811e80fd0 bpo-31581: Reduce the number of imports for functools (GH-3757) 2017-09-30 16:13:02 +09:00
James Sexton b24cd055ec bpo-30806 netrc.__repr__() is broken for writing to file (GH-2491)
netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc
2017-09-30 16:10:31 +09:00
Łukasz Langa 574562c5dd bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` (#3830)
This was possible before.  GH-1560 introduced a regression after 3.6.2 got
released where only sequences were accepted now.  This commit addresses this
problem.
2017-09-29 14:33:34 -07:00
Oren Milman 01c6a8859e bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a bad zlib.decompress() (GH-3784)
While a rare potential failure (it requires swapping out zlib.decompress() itself and forcing it to return a non-bytes object), this change prevents a potential C-level assertion failure and instead substitutes it with an exception.

Thanks to Oren Milman for the patch.
2017-09-29 11:34:31 -07:00
Zhiming Wang d87b105ca7 bpo-31638: Add compression support to zipapp (GH-3819)
Add optional argument `compressed` to `zipapp.create_archive`, and add
option `--compress` to the command line interface of `zipapp`.
2017-09-29 18:31:52 +01:00
Benjamin Peterson 288d1daada remove support for BSD/OS (closes bpo-31624) (#3812) 2017-09-28 22:44:27 -07:00
Antoine Pitrou a106aec2ed bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796)
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid.
2017-09-28 23:03:06 +02:00
Oren Milman d780b2d588 bpo-31478: Fix an assertion failure in random.seed() in case a seed has a bad __abs__() method. (#3596) 2017-09-28 10:50:01 +03:00
Oren Milman 5837d0418f bpo-31588: Validate return value of __prepare__() methods (GH-3764)
Class execution requires that __prepare__() methods return
a proper execution namespace. Check for that immediately
after calling __prepare__(), rather than passing it through
to the code execution machinery and potentially triggering
SystemError (in debug builds) or a cryptic TypeError
(in release builds).

Patch by Oren Milman.
2017-09-28 00:04:37 +10:00
Serhiy Storchaka c740e4fe8a bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() iterators. (#1557) 2017-09-26 21:47:56 +03:00