Commit Graph

42572 Commits

Author SHA1 Message Date
Victor Stinner 44862df2ee
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
2017-11-20 07:14:07 -08:00
Riccardo Magliocchetti 04dee27208 Remove duplicated import from datetime tests (#4444) 2017-11-20 10:48:56 +02:00
Vinay Sajip e96ba183c4
bpo-30904: Removed duplicated Host: header. (#4465) 2017-11-19 18:36:17 +00:00
xdegaye ebfaa71c2e
bpo-32031: Fix pydoc `test_mixed_case_module_names_are_lower_cased` (GH-4441)
When there is a symlink in the directory path of the standard library.
2017-11-18 18:20:21 +01:00
xdegaye d34d8fc24f
bpo-29185: Fix `test_distutils` failures on Android (GH-4438)
* Run gzip with separate command line options (Android understands  '-f9' as the name of a file).
* Creation of a hard link is controled by SELinux on Android.
2017-11-18 18:17:16 +01:00
xdegaye 9001d1f438
bpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH-4387) 2017-11-18 18:10:53 +01:00
Andrew Svetlov 51d546ae4d
bpo-32069: Drop legacy SSL transport (#4451)
* Drop legacy SSL transport

* Drop unused import

* Fix Windows tests

* Drop never executed on Python 3.4+ code
2017-11-18 18:54:05 +02:00
Henk-Jaap Wagenaar f02f5e5c3e bpo-31867: Remove duplicates in default mimetypes. (#4388) 2017-11-17 12:10:19 +02:00
Serhiy Storchaka cede8c9edb
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
The log_rounds parameter for Blowfish has been replaced with the rounds parameter.
2017-11-16 13:22:51 +02:00
Victor Stinner ccb0442a33
bpo-32043: New "developer mode": "-X dev" option (#4413)
Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.

Changes:

* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
   than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()
2017-11-16 03:20:31 -08:00
Serhiy Storchaka 05cb728d68
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
2017-11-16 12:38:26 +02:00
Serhiy Storchaka 3daaafb700
bpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407) 2017-11-16 09:44:43 +02:00
Serhiy Storchaka 0a2abdfca2
bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)
from collections.abc rather than collections.
2017-11-16 09:16:24 +02:00
Victor Stinner a7368ac636
bpo-32030: Enhance Py_Main() (#4412)
Parse more env vars in Py_Main():

* Add more options to _PyCoreConfig:

  * faulthandler
  * tracemalloc
  * importtime

* Move code to parse environment variables from _Py_InitializeCore()
  to Py_Main(). This change fixes a regression from Python 3.6:
  PYTHONUNBUFFERED is now read before calling pymain_init_stdio().
* _PyFaulthandler_Init() and _PyTraceMalloc_Init() now take an
  argument to decide if the module has to be enabled at startup.
* tracemalloc_start() is now responsible to check the maximum number
  of frames.

Other changes:

* Cleanup Py_Main():

  * Rename some pymain_xxx() subfunctions
  * Add pymain_run_python() subfunction

* Cleanup Py_NewInterpreter()
* _PyInterpreterState_Enable() now reports failure
* init_hash_secret() now considers pyurandom() failure as an "user
  error": don't fail with abort().
* pymain_optlist_append() and pymain_strdup() now sets err on memory
  allocation failure.
2017-11-15 18:11:45 -08:00
Yury Selivanov 43605e6bfa
bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409 2017-11-15 17:14:28 -05:00
Antoine Pitrou 4bd41c9b52
bpo-32025: Add time.thread_time() (#4410)
* bpo-32025: Add time.thread_time()

* Add missing #endif

* Add NEWS blurb

* Add docs and whatsnew

* Address review comments

* Review comments
2017-11-15 22:52:21 +01:00
Dong-hee Na 762b9571c9 bpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408) 2017-11-15 13:30:59 -05:00
Serhiy Storchaka f8a4c03ede
bpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650) 2017-11-15 17:53:28 +02:00
Serhiy Storchaka 00987f6230
bpo-32011: Revert "Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (#4381)
Simplify the reverted code.

This reverts commit e9bbe8b87b.
2017-11-15 17:41:05 +02:00
Serhiy Storchaka ddbce13786
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400) 2017-11-15 17:39:37 +02:00
Serhiy Storchaka edad8eebee
bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (#4289)
* Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
* Setting sys.tracebacklimit to None now causes using the default limit.
* Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
  the limit LONG_MAX rather than the default limit.
* Fixed integer overflows in the case of more than 2**31 traceback items on
  Windows.
* Fixed output errors handling.
2017-11-15 17:38:52 +02:00
Serhiy Storchaka 6545256df9
bpo-32032: Test both implementations of module-level pickle API. (#4401) 2017-11-15 14:01:08 +02:00
sanjayp 2ae4ad7ca4 Changed lambda to str.strip in _strip_spaces in logging.config (#4332) 2017-11-15 09:28:11 +00:00
Serhiy Storchaka 9165f77d5f
bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382) 2017-11-15 08:49:40 +02:00
Andrey Egorov e1d62e0b7c bpo-32015: Asyncio looping during simultaneously socket read/write an… (#4386)
* bpo-32015: Asyncio cycling during simultaneously socket read/write and reconnection

* Tests fix

* Tests fix

* News add

* Add new unit tests
2017-11-14 11:18:59 +02:00
Serhiy Storchaka 9b6c60cbce
bpo-31979: Simplify transforming decimals to ASCII (#4336)
in int(), float() and complex() parsers.

This also speeds up parsing non-ASCII numbers by around 20%.
2017-11-13 21:23:48 +02:00
Yury Selivanov ce12629c84
bpo-28369: Enhance transport socket check in add_reader/writer (#4365) 2017-11-13 13:38:22 -05:00
xdegaye d7d4fea4a3
bpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375) 2017-11-12 18:02:06 +01:00
xdegaye 6a55d09573
bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374) 2017-11-12 17:57:04 +01:00
xdegaye 92c2ca7633
bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)
Access to mkfifo(), mknod() and hard link creation is controled
by SELinux on Android.
Also remove test.support.android_not_root.
2017-11-12 17:31:07 +01:00
xdegaye e0582a37c8
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160) 2017-11-12 16:50:48 +01:00
xdegaye 1588be66d7
bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334) 2017-11-12 12:45:59 +01:00
benfogle 9703f092ab bpo-31976: Fix race condition when flushing a file is slow. (#4331) 2017-11-10 22:03:40 +01:00
Yury Selivanov 4652bf2acc
Rewrite asyncio test to be more meaningful (#4363) 2017-11-10 15:34:17 -05:00
Brian Curtin 9f914a01af
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
The openfp functions of aifp, sunau, and wave had pointed to the open
function of each module since 1993 as a matter of backwards
compatibility. In the case of aifc.openfp, it was both undocumented
and untested. This change begins the formal deprecation of those
openfp functions, with their removal coming in 3.9.

This additionally adds a TODO in test_pyclbr around using aifc.openfp,
though it shouldn't be changed until removal in 3.9.
2017-11-10 11:38:25 -05:00
Serhiy Storchaka 5e0df74b3b
bpo-31999: Fix test_venv in case the zlib module is not available. (#4359) 2017-11-10 12:09:39 +02:00
Serhiy Storchaka a1718bc7e0
bpo-31998: Fix test_zipapp in case the zlib module is not available. (#4358) 2017-11-10 12:09:24 +02:00
Paul Ganssle 191e993365 bpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python (#4176) 2017-11-09 13:34:29 -08:00
Antoine Pitrou 0a2ff23fe6
Silence error output in test_concurrent_futures (bpo-21423) (#4347)
* Silence error output in test_concurrent_futures (bpo-21423)
2017-11-09 15:33:43 +01:00
Victor Stinner 8c663fd60e
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.

Same change for MB and GB which become MiB and GiB.

Change the output of Tools/iobench/iobench.py.

Round also the size of the documentation from 5.5 MB to 5 MiB.
2017-11-08 14:44:44 -08:00
James b5d9e08114 bpo-31884 subprocess: add Windows constants for process priority (#4150) 2017-11-08 06:18:59 -08:00
Sanyam Khurana 7973e279a2 bpo-21862: Add -m option to cProfile for profiling modules (#4297)
* bpo-21862: Add -m option to cProfile for profiling modules
2017-11-08 11:50:56 +01:00
Simon Willison 4fc4defd1c Remove unused var from CheckCancelOperation test (GH-4317)
It looks like this was copied from one of the previous tests, which did use it.
2017-11-08 00:06:55 +03:00
Suren Nihalani c62f0cb3b1 bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (#3813) 2017-11-07 20:35:23 +03:00
Barry Warsaw c060c7e3d1
Fix a typo (#4323) 2017-11-07 09:05:15 -08:00
Antoine Pitrou 921e9432a1
bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)
* bpo-31970: Reduce performance overhead of asyncio debug mode.
2017-11-07 17:23:29 +01:00
Antoine Pitrou 22b1128559
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319) 2017-11-07 17:03:28 +01:00
Serhiy Storchaka 39a156c505
Fix the sizeof test for dicts with shared keys. (#4311)
By accident the size of the empty dict keys object matched the
size of values array.
2017-11-07 15:08:09 +02:00
Marat Sharafutdinov 69cfed1cd7 Add asyncio.Handle.cancelled() method (#2388) 2017-11-07 12:06:05 +03:00
Anders Lorentsen a22a127458 bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) 2017-11-06 16:47:43 -08:00
Oren Milman edb13ae48c bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958) 2017-11-06 16:09:49 -08:00
Oren Milman e56ab746a9 bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (#3968) 2017-11-06 16:01:47 -08:00
Nir Soffer ad455cd924 bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)
blocksize was hardcoded to 8192, preventing efficient upload when using
file-like body. Add blocksize argument to __init__, so users can
configure the blocksize to fit their needs.

I tested this uploading data from /dev/zero to a web server dropping the
received data, to test the overhead of the HTTPConnection.send() with a
file-like object.

Here is an example 10g upload with the default buffer size (8192):

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 17.53 seconds (584.00m/s)

real	0m17.574s
user	0m8.887s
sys	0m5.971s

Same with 512k blocksize:

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 6.60 seconds (1551.15m/s)

real	0m6.641s
user	0m3.426s
sys	0m2.162s

In real world usage the difference will be smaller, depending on the
local and remote storage and the network.

See https://github.com/nirs/http-bench for more info.
2017-11-06 13:16:37 -08:00
luzpaz a5293b4ff2 Fix miscellaneous typos (#4275) 2017-11-05 15:37:50 +02:00
Serhiy Storchaka d4d79bc1ff
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
This speeds up it to 20-40%.
2017-11-04 14:16:35 +02:00
Antoine Pitrou 63ff4131af
bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)
* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor

* Fix docstring
2017-11-04 11:05:49 +01:00
Serhiy Storchaka ee1a9a2b78
bpo-9678: Fix determining the MAC address in the uuid module. (#4264)
* Using ifconfig on NetBSD and OpenBSD.
* Using arp on Linux, FreeBSD, NetBSD and OpenBSD.

Based on patch by Takayuki Shimizukawa.
2017-11-04 09:37:32 +02:00
Jack O'Connor dcfb0e3c04 bpo-31933: fix blake2 multi-byte params on big endian platforms (#4250)
All Blake2 params have to be encoded in little-endian byte order. For
the two multi-byte integer params, leaf_length and node_offset, that
means that assigning a native-endian integer to them appears to work on
little-endian platforms, but gives the wrong result on big-endian. The
current libb2 API doesn't make that very clear, and @sneves is working
on new API functions in the GH issue above. In the meantime, we can work
around the problem by explicitly assigning little-endian values to the
parameter block.

See https://github.com/BLAKE2/libb2/issues/12.
2017-11-03 20:02:41 +01:00
Serhiy Storchaka a7723d8b09
bpo-31924: Fix test_curses on NetBSD 8. (#4228) 2017-11-03 20:29:33 +02:00
Antoine Pitrou cbe1756e3e
bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed (#3247)
* bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed

* Avoid mucking with process state in test.
Add a warning if the semaphore process died, as semaphores may then be leaked.

* Add NEWS entry
2017-11-03 14:31:38 +01:00
Antoine Pitrou fc6b348b12
bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary (#3246)
* bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary.

* Fix test on Windows

* Add NEWS entry

* Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker.

* Fix comment

* Make sure the test doesn't muck with process state

* Also test previously-started processes

* Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst

* Avoid masking SIGTERM in forkserver.  It's not necessary and causes a race condition in test_many_processes.
2017-11-03 13:34:22 +01:00
Victor Stinner c29b585fd4
bpo-31784: Implement PEP 564: add time.time_ns() (#3989)
Add new time functions:

* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()

Add new _PyTime functions:

* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()

Other changes:

* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
  _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
  behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
  _PyTime_t
2017-11-02 07:28:27 -07:00
Vincent Michel e314853d57 bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) 2017-11-02 15:47:04 +03:00
Serhiy Storchaka 4f469c0966
bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220) 2017-11-01 20:48:49 +02:00
Serhiy Storchaka 7e68790f3d
bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. (#3826)
Skip a test for unget_wch()/get_wch() on OpenBSD since they are broken
in ncurses 5.7.
2017-11-01 16:03:40 +02:00
jimmylai d1e34031f6 [asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed." (#3295)
* call remove_done_callback in finally section

* [asyncio] bpo-30423 bug: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed."
2017-11-01 15:54:45 +02:00
Serhiy Storchaka 894ebd065e
bpo-31919: Fix building the curses module on OpenIndiana. (#4211) 2017-11-01 14:34:20 +02:00
Victor Stinner 280c22a82a
Fix test_socket.test_create_connection() (#4206)
bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.
2017-10-31 19:48:14 -07:00
Victor Stinner afd055a59f
pythoninfo: add Py_DEBUG (#4198) 2017-10-31 08:41:10 -07:00
Victor Stinner e1a470bd6a
test_capi.test__testcapi() becomes more verbose (#4197)
Write the name of each subtest on a new line to help debugging when
a test does crash Python.
2017-10-31 08:40:59 -07:00
Serhiy Storchaka db91e0fe24
bpo-31897: Convert unexpected errors when read bogus binary plists into InvalidFileException. (#4171) 2017-10-31 14:05:53 +02:00
Serhiy Storchaka baac01e629
bpo-31891: Fix building the curses module on NetBSD. (#4165) 2017-10-31 13:56:44 +02:00
Victor Stinner 19f68301a1
bpo-31629: Add support.SaveSignals (#4183)
test_curses now saves/restores signals. On FreeBSD, the curses module
sets handlers of some signals, but don't restore old handlers when
the module is deinitialized.
2017-10-31 03:14:01 -07:00
Alex Gaynor f0f62cc61e
Remove tiny bit of deadcode from wsgiref.validate (#3996) 2017-10-31 00:07:36 -04:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
Serhiy Storchaka a2314283ff
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
2017-10-29 02:11:54 +03:00
Terry Jan Reedy 5a4bbcd479
bpo-31836: Test_code_module now passes with sys.ps1, ps2 set (#4070) 2017-10-27 21:45:19 -04:00
Terry Jan Reedy e86172d63a
IDLE -- Restrict shell prompt manipulaton to the shell. (#4143)
Editor and output windows only see an empty last prompt line.
This simplifies the code and fixes a minor bug when newline is inserted.
Sys.ps1, if present, is read on Shell start-up, but is not set or changed.
2017-10-27 20:26:12 -04:00
Serhiy Storchaka ed6554c487 bpo-31860: Make the font sample in the IDLE font configuration dialog editable. (#4106)
Changes persist while IDLE remains open
2017-10-27 20:22:44 -04:00
Serhiy Storchaka 7351f9e5a9 bpo-31174: Improve the code of test_tools.test_unparse. (#4146) 2017-10-27 15:35:11 +03:00
Lovesh Harchandani afad147b59 bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812)
TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.
2017-10-27 08:04:33 +01:00
Ivan Levkivskyi 8c83c23fa3 bpo-28936: Detect lexically first syntax error first (#4097)
Lexically first global and nonlocal syntax errors at given scope should be detected first.
2017-10-27 00:28:35 +03:00
Alexander Belopolsky 66c88ce30c Closes bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)
Patch by Mark Gollahon.
2017-10-26 15:34:11 -04:00
Vitor Pereira 52ad72dd0a bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589) 2017-10-26 21:49:19 +03:00
xdegaye 56d1f5ca32 bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327) 2017-10-26 15:09:06 +02:00
Serhiy Storchaka 41c56940c6 bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)
BytesWarning no longer emitted when the fromlist argument of
__import__() or the __all__ attribute of the module contain bytes
instances.
2017-10-26 10:41:59 +03:00
Benjamin Peterson 4eaf7f9490 fixes bpo-31866: remove code pertaining to AtheOS support (#4115)
We stop support this OS in 2007 with commit
19fab761b7. Let's finish.
2017-10-25 23:55:14 -07:00
Mario Corchero 32318930da Closes bpo-31800: Support for colon when parsing time offsets (#4015)
Add support to strptime to parse time offsets with a colon between the hour and the minutes.
2017-10-25 20:35:41 -04:00
Serhiy Storchaka 0f261583ba bpo-31664: Fix test_crypt for the openwall implementation of crypt. (#4116) 2017-10-25 16:30:13 +03:00
Nick Coghlan d7ac06126d bpo-31845: Fix reading flags from environment (GH-4105)
The startup refactoring means command line settings
are now applied after settings are read from the
environment.

This updates the way command line settings are applied
to account for that, ensures more settings are first read
from the environment in _PyInitializeCore, and adds a
simple test case covering the flags that are easy to check.
2017-10-25 12:11:26 +10:00
Serhiy Storchaka 3557b05c5a bpo-31690: Allow the inline flags "a", "L", and "u" to be used as group flags for RE. (#3885) 2017-10-24 23:31:42 +03:00
Alexander Belopolsky fdd9b217c6 Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). (#4079)
Calendar.itermonthdates() will now consistently raise an exception when a date falls outside of the 0001-01-01 through 9999-12-31 range. To support applications that cannot tolerate such exceptions, the new methods itermonthdays3() and itermonthdays4() are added. The new methods return tuples and are not restricted by the range supported by datetime.date.

Thanks @serhiy-storchaka for suggesting the itermonthdays4() method and for the review.
2017-10-24 13:17:10 -04:00
Serhiy Storchaka eab3ff72eb bpo-31664: Add support for the Blowfish method in crypt. (#3854) 2017-10-24 19:36:17 +03:00
Thomas Kluyver e968bc7357 bpo-30639: Lazily compute repr for error (#2132) 2017-10-24 08:42:36 -04:00
Victor Stinner 8e482bea21 bpo-31174: Fix test_tools.test_unparse (#4102)
test_unparse.DirectoryTestCase now stores the names sample to always
test the same files. It prevents false alarms when hunting reference
leaks.
2017-10-24 03:33:36 -07:00
Victor Stinner 01b5aab7bf bpo-31827: Remove os.stat_float_times() (GH-4061) 2017-10-24 02:02:00 -07:00
Serhiy Storchaka 3b66ebe772 bpo-31847: Fix commented out tests in test_syntax. (#4084)
SyntaxError now is raised instead of SyntaxWarning.
2017-10-24 00:27:14 +03:00
xdegaye 66caacf2f0 bpo-30817: Fix PyErr_PrintEx() when no memory (#2526) 2017-10-23 18:08:41 +02:00
Serhiy Storchaka 4ffd4653a7 bpo-31752: Fix possible crash in timedelta constructor called with custom integers. (#3947)
Bad remainder in divmod() in intermediate calculations caused an assertion failure.
2017-10-23 17:12:28 +03:00
andyclegg 7fed7bd8bb bpo-31756: subprocess.run should alias universal_newlines to text (#4049)
Improve human friendliness of the Popen API: Add text=False as a
keyword-only argument to subprocess.Popen along with a Popen
attribute .text_mode and set this based on the
encoding/errors/universal_newlines/text arguments.

The universal_newlines parameter and attribute are maintained for
backwards compatibility.
2017-10-22 19:01:19 -07:00
Mark Shannon ae3087c638 Move exc state to generator. Fixes bpo-25612 (#1773)
Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
2017-10-22 23:41:51 +02:00
Cheryl Sabella 91dc64ba3f bpo-20825: Containment test for ip_network in ip_network. 2017-10-22 23:39:49 +02:00
Serhiy Storchaka bcbdd2f8db bpo-28286: Add tests for the mode argument of GzipFile. (#4074) 2017-10-22 13:18:21 +03:00
Antoine Pitrou daeefd2e04 bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed or None. (#4073) 2017-10-22 11:40:31 +02:00
Serhiy Storchaka 73c4708630 Fix bytes warnings in test_struct (added in bpo-29802). (#4068) 2017-10-21 21:59:23 +03:00
Oren Milman db60a5bfa5 bpo-31781: Prevent crashes when calling methods of an uninitialized zipimport.zipimporter object (GH-3986) 2017-10-20 13:42:35 -07:00
Serhiy Storchaka 56cb465cc9 bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)
and in codecs.escape_decode() when decode an escaped non-ascii byte.
2017-10-20 17:08:15 +03:00
Antoine Pitrou 525f40d231 bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051)
* bpo-31819: Add AbstractEventLoop.sock_recv_into()

* Add NEWS

* Add doc
2017-10-19 15:46:40 -04:00
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
Ron 032a6480e3 Update TestCase.assertAlmostEqual and assertNotAlmostEqual docstrings. (GH-3998)
The word "difference" from missing the sentence.
This clarifies that it compares the difference between the two objects.
2017-10-18 10:01:23 -07:00
Terry Jan Reedy 27288de085 bpo-30928: Update idlelib/NEWS.txt to 2017 Oct 17. (#4025) 2017-10-17 19:02:49 -04:00
Terry Jan Reedy e2e42274ee bpo-13802: Use non-Latin characters in IDLE's Font settings sample. (#3960)
Even if one selects a font that defines a limited subset of the unicode
Basic Multilingual Plane, tcl/tk will use other fonts that define a
character. The expanded example give users of non-Latin characters
a better idea of what they might see in the IDLE shell and editors.

To make room for the expanded sample, frames on the Font tab are
re-arranged. The Font/Tabs help explains a bit about the additions.
2017-10-17 18:56:16 -04: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
Mario Corchero 552be9d7e6 bpo-30541: Add new method to seal mocks (GH61923)
The new method allows the developer to control when to stop the
feature of mocks that automagically creates new mocks when accessing
an attribute that was not declared before

Signed-off-by: Mario Corchero <mariocj89@gmail.com>
2017-10-17 04:35:11 -07:00
Ned Deily c730223d18 Update NEWS and topics for 3.7.0a2 2017-10-16 23:41:55 -04: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
Pablo Galindo 0df19055c9 bpo-31776: Missing "raise from None" in Lib/xml/etree/ElementPath.py (#3978) 2017-10-16 11:24:22 +03:00
Serhiy Storchaka 676db4bbf2 bpo-31792: Restore os.environ in test_buffer when import numpy. (#4007) 2017-10-16 10:38:14 +03:00
Terry Jan Reedy 620f70eed6 bpo-25588: Document autotest in idle_test/README.txt. (#4000)
Follow-up to Victor's patch that enabled autotest to run in IDLE's Shell.
2017-10-14 21:31:14 -04: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 02e82a0596 bpo-31709: Update importlib magic (#3906) 2017-10-06 10:18:10 -04: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
INADA Naoki c1c47c166b bpo-31671: re: Convert RegexFlag to int before compile (GH-3862)
sre_compile does bit test (e.g. `flags & SRE_FLAG_IGNORECASE`) in loop.
`IntFlag.__and__` and `IntFlag.__new__` made it slower.

So this commit convert it to normal int before passing flags to `sre_compile()`.
2017-10-05 17:19:26 +09:00
Jakub Stasiak af810b35b4 closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (#3771) 2017-10-05 00:10:09 -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
INADA Naoki bf477a99e0 bpo-31677: email: Remove re.IGNORECASE flag (GH-3868)
While there is not real bug in this case, using re.IGNORECASE without re.ASCII
leads unexpected behavior.
Instead of adding re.ASCII, this commit removes re.IGNORECASE flag because
it's easier and simpler.

This commit removes dead copy of the pattern in email.util module too.
While the pattern is same, it is compiled separately because it had different flags.
2017-10-04 12:47:38 +09: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
Victor Stinner 4337a0d995 bpo-11063: Fix _uuid module on macOS (#3855)
On macOS, use uuid_generate_time() instead of
uuid_generate_time_safe() of libuuid, since uuid_generate_time_safe()
is not available.
2017-10-02 07:57:59 -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
INADA Naoki b75a228af8 bpo-31659: Use simple slicing to format PEM cert (GH-3849)
DER_cert_to_PEM_cert() used textwrap.fill() to format PEM.
But it's library to wrap lines on word boundary, while PEM is
base64 encoded string.

Additionally, importing textwrap is little slow.
2017-10-02 16:33:42 +09:00
Terry Jan Reedy 5961e7c156 IDLE: make filetypes a tuple constant. (#3847)
Save a bit of code, plus non-tuples get converted anyway to tuples by tkinter for the tk call.
2017-10-01 19:01:27 -04:00
Terry Jan Reedy d6bb65f378 bpo-31460: Simplify the API of IDLE's Module Browser. (#3842)
Passing a widget instead of an flist with a root widget opens the option of
creating a browser frame that is only part of a window. Passing a full file
name instead of pieces assumed to come from a .py file opens the possibility
of browsing python files that do not end in .py.
2017-09-30 19:54:28 -04:00
Terry Jan Reedy bfebfd81de bpo-31649: Make IDLE's _htest, _utest parameters keyword-only. (#3839) 2017-09-30 17:37:53 -04: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
Sorin Sbarnea 90f1d98959 bpo-25351: avoid activate failure on strict shells (GH-3804) 2017-09-29 12:48:11 +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
Barry Warsaw db50ba7c72 Trivial readability improvement (#3791) 2017-09-27 11:12:30 -04: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
Serhiy Storchaka 114454e9f6 bpo-28293: Don't completely dump the regex cache when full. (#3768) 2017-09-26 19:47:36 +03:00
Serhiy Storchaka 81108375d9 bpo-30152: Reduce the number of imports for argparse. (#1269) 2017-09-26 00:55:55 +03:00
Stefan Grönke f1502d097c bpo-31569: correct PCBuild/ case to PCbuild/ in build scripts and docs (GH-3711) 2017-09-25 17:58:10 +01:00
Victor Stinner e6d9fcbb8d bpo-31170: Write unit test for Expat 2.2.4 UTF-8 bug (#3570)
Non-regression tests for the Expat 2.2.3 UTF-8 decoder bug.
2017-09-25 01:27:34 -07:00
Oren Milman 57c2561c8c bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in case of a bad __dict__. (#3254) 2017-09-25 11:09:11 +03:00
Oren Milman 5d3e80021a bpo-31566: Fix an assertion failure in _warnings.warn() in case of a bad __name__ global. (#3717) 2017-09-24 21:28:42 +03:00
Oren Milman 91fb0afe18 bpo-31285: Fix an assertion failure and a SystemError in warnings.warn_explicit. (#3219) 2017-09-24 21:27:12 +03:00
Serhiy Storchaka 2fad102354 bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (#3667)
Defer removing old behavior to 3.8.
Document new feature of selection_set() and friends.
2017-09-24 14:34:09 +03:00
Serhiy Storchaka c247caf33f bpo-30346: An iterator produced by the itertools.groupby() iterator (#1569)
now becames exhausted after advancing the groupby iterator.
2017-09-24 13:36:11 +03:00
Oren Milman 2b382dd612 bpo-31505: Fix an assertion failure in json, in case _json.make_encoder() received a bad encoder() argument. (#3643) 2017-09-24 12:07:12 +03:00
Cheryl Sabella cd99e79dc7 bpo-31459: Rename IDLE's module browser from Class Browser to Module Browser. (#3704)
The original module-level class and method browser became a module
browser, with the addition of module-level functions, years ago.
Nested classes and functions were added yesterday.  For back-
compatibility, the virtual event <<open-class-browser>>, which
appears on the Keys tab of the Settings dialog, is not changed.
Patch by Cheryl Sabella.
2017-09-23 16:46:01 -04:00
Terry Jan Reedy 99167f85b7 bpo-31559: Remove test order dependence in idle_test.test_browser. (#3708)
Order dependence caused leak-test buildbots to fail when running test_idle repeatedly.
2017-09-23 14:19:23 -04:00
Cheryl Sabella 058de11360 bpo-1612262: IDLE: Class Browser shows nested functions, classes (#2573)
Original patches for code and tests by Guilherme Polo and
Cheryl Sabella, respectively.
2017-09-22 16:08:44 -04:00
Neil Schemenauer 0a1ff24acf bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#3372)
* Maintain a list of BufferedWriter objects.  Flush them on exit.

In Python 3, the buffer and the underlying file object are separate
and so the order in which objects are finalized matters.  This is
unlike Python 2 where the file and buffer were a single object and
finalization was done for both at the same time.  In Python 3, if
the file is finalized and closed before the buffer then the data in
the buffer is lost.

This change adds a doubly linked list of open file buffers.  An atexit
hook ensures they are flushed before proceeding with interpreter
shutdown.  This is addition does not remove the need to properly close
files as there are other reasons why buffered data could get lost during
finalization.

Initial patch by Armin Rigo.

* Use weakref.WeakSet instead of WeakKeyDictionary.

* Simplify buffered double-linked list types.

* In _flush_all_writers(), suppress errors from flush().

* Remove NEWS entry, use blurb.

* Take more care when flushing file buffers from atexit.

The previous implementation was not careful enough to avoid
causing issues in multi-threaded cases.  Check for buf->ok
and buf->finalizing before actually doing the flush.  Also,
increase the refcnt to ensure the object does not disappear.
2017-09-22 10:17:30 -07:00
Barry Warsaw 35425d638c bpo-31389 Add an optional `header` argument to pdb.set_trace() (#3438)
* Give pdb.set_trace() an optional `header` argument

* What's new.

* Give pdb.set_trace() an optional `header` argument

* What's new.
2017-09-22 12:29:42 -04:00
Serhiy Storchaka b3a77964ea bpo-27541: Reprs of subclasses of some classes now contain actual type name. (#3631)
Affected classes are bytearray, array, deque, defaultdict, count and repeat.
2017-09-21 14:24:13 +03:00
Igor Filatov 9adda0cdf8 bpo-31351: Set return code in ensurepip when pip fails (GH-3626)
Previously ensurepip would always report success, even if the
pip installation failed.
2017-09-21 20:07:45 +10:00
Serhiy Storchaka a96c96f5da bpo-31500: IDLE: Scale default fonts on HiDPI displays. (#3639) 2017-09-21 11:20:06 +03:00
Anthony Sottile aaf6fc0982 bpo-26510: make argparse subparsers required by default (#3027)
This fixes a regression from Python 2.  To get optional subparsers,
use the new parameter ``add_subparsers(required=False)``.

Patch by Anthony Sottile.
2017-09-20 17:35:27 -04:00
Terry Jan Reedy d6e2f26f3f bpo-31500: Removed fixed size of IDLE config dialog. (#3664)
This one line of Serhiy Storchacka's bpo-31500 patch for is needed for other issues.
2017-09-19 19:01:45 -04:00
Rohit Balasubramanian 9e7b9b21fe bpo-31507 Add docstring to parseaddr function in email.utils.parseaddr (gh-3647) 2017-09-19 15:10:49 -04:00
Victor Stinner 9abee722d4 bpo-31479: Always reset the signal alarm in tests (#3588)
* bpo-31479: Always reset the signal alarm in tests

Use "try: ... finally: signal.signal(0)" pattern to make sure that
tests don't "leak" a pending fatal signal alarm.

* Move two more alarm() calls into the try block

Fix also typo: replace signal.signal(0) with signal.alarm(0)

* Move another signal.alarm() into the try block
2017-09-19 09:36:54 -07:00
Victor Stinner a92941ff12 pythoninfo: ignore OSError(ENOSYS) on getrandom() (#3655) 2017-09-19 07:37:24 -07:00
Oren Milman 865e4b4f63 bpo-31293: Fix crashes in truediv and mul of a timedelta by a float with a bad as_integer_ratio() method. (#3227) 2017-09-19 15:58:11 +03:00