Commit graph

100710 commits

Author SHA1 Message Date
Barry Warsaw deae6b451f
bpo-32248 - Implement importlib.resources (#4911)
Port importlib_resources to importlib.resources
2017-12-30 15:18:06 -05:00
Andrew Svetlov ffcb4c0165
bpo-32418: Postfix, raise NotImplementdError and close resources in tests (#5052) 2017-12-30 18:52:56 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 1634fc289a bpo-32418: Add get_loop() method on Server, AbstractServer classes (#4997)
* Add abstract get_loop() method to Server, AbstractServer classes.
* Add test cases for get_loop() method in Server, AbstractServer classes
* Add documentation for get_loop() method
2017-12-30 17:09:32 +02:00
Andrew Svetlov fc35932afd
Fix typo (#5049) 2017-12-30 15:40:27 +02:00
Serhiy Storchaka 02b9ef2775
bpo-32439: Clean up the code for compiling comparison expressions. (#5029) 2017-12-30 09:47:42 +02:00
Yury Selivanov f111b3dcb4
bpo-23749: Implement loop.start_tls() (#5039) 2017-12-30 00:35:36 -05:00
Benjamin Peterson bbdb17d19b
return the new file descriptor from os.dup2 (closes bpo-32441) (#5041) 2017-12-29 13:13:06 -08:00
Eric V. Smith 03220fdb26
bpo-32427: Expose dataclasses.MISSING object. (#5045) 2017-12-29 13:59:58 -05:00
Benjamin Peterson e325608740
remove unused import (#5040) 2017-12-28 23:24:40 -08:00
Benjamin Peterson e5f7dccefa
make PatternCompiler use the packaged grammar if possible (more bpo-24960) (#5034) 2017-12-28 17:54:12 -08:00
oldk e5681b9822 bpo-32440: Update the docs URL to https in help() (GH-5030)
In pydoc.py, the reference to Python' documentation was in http.
The link has been updated to use https.
2017-12-28 06:37:46 -08:00
gfyoung 531dd7e27e Fix minor spelling error in test_sys_settrace.py. (#5025) 2017-12-28 10:28:25 +02:00
Serhiy Storchaka 53f9135667
bpo-32416: Refactor tests for the f_lineno setter and add new tests. (#4991) 2017-12-27 00:38:56 +02:00
Serhiy Storchaka 13a6c098c2
bpo-32259: Make a TypeError message when unpack non-iterable more specific. (#4903) 2017-12-26 12:30:41 +02:00
Andrew Svetlov a8f4e15f3d
bpo-26133: Fix typos (#5010)
* Fix typos
* Change warning text
* Add test
2017-12-26 11:53:38 +02:00
Yury Selivanov e0aef4f3cd
bpo-31721: Allow Future._log_traceback to only be set to False (#5009) 2017-12-25 16:16:10 -05:00
INADA Naoki 3070b71e5e
bpo-32422: Reduce lru_cache memory usage (GH-5008) 2017-12-26 02:03:24 +09:00
Yury Selivanov 0cf16f9ea0
bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923) 2017-12-25 10:48:15 -05:00
Serhiy Storchaka 3dfbaf51f0
bpo-32372: Move __debug__ optimization to the AST level. (#4925) 2017-12-25 12:47:50 +02:00
Serhiy Storchaka 1b3029ac83
bpo-29084: Exclude C API for OrderedDict from the limited C API. (#4900) 2017-12-25 02:08:42 +02:00
Andrew Svetlov 4f146f9ed1
bpo-26133: Clear signals list on interpreter finalizing (#5002) 2017-12-24 13:50:03 +02:00
INADA Naoki 4856b0f34a
bpo-32402: io: Add missing NULL check. (GH-4971)
_PyUnicode_FromId() may return NULL.

Reported by coverity scan: CID 1426868, 1426867.
2017-12-24 10:29:19 +09:00
Yury Selivanov 719ccbca69
bpo-32415: Fix "error is already set" (#4999) 2017-12-23 16:29:26 -05:00
Andrew Svetlov a330f483e2
Fix check for run_in_executor on closed loop. (#4996) 2017-12-23 23:03:27 +02:00
Yury Selivanov a8fb079789
bpo-32415: Add more tests (#4995) 2017-12-23 15:42:27 -05:00
Andrew Svetlov 0f47fa2c89 bpo-32357: Use PySet_GET_SIZE macro in _is_coroutine() from _asynciomodule.c (#4990) 2017-12-23 15:06:46 -05:00
Yury Selivanov ca9b36cd1a
bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992) 2017-12-23 15:04:15 -05:00
Yury Selivanov 558aa30f79
bpo-32357: Fix tests in refleak mode (#4989) 2017-12-23 12:44:29 -05:00
Mariatta c0919c27c6
bpo-26439: Convert %s in Lib/ctypes/_aix.py to f-strings. (GH-4986) 2017-12-22 23:39:03 -08:00
Benjamin Peterson d11e8e0d11
correct wording (#4983) 2017-12-22 20:48:13 -08:00
Benjamin Peterson 8a5877165e
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (#4977)
This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist.
2017-12-22 12:18:33 -08:00
Benjamin Peterson 62ed6be8da
remove the dynload_next.c file (closes bpo-32386) (#4957) 2017-12-21 21:43:09 -08:00
Victor Stinner 424315fa86
bpo-29240: Skip test_readline.test_nonascii() (#4968)
Skip the test which fails on FreeBSD with POSIX locale.

Skip the test to fix FreeBSD buildbots, until a fix can be found, so
the buildbots can catch other regressions.
2017-12-22 00:09:26 +01:00
Victor Stinner 550ee051d6
bpo-20891: Skip test_embed.test_bpo20891() (#4967)
Skip the test failing randomly because of known race condition.

Skip the test to fix macOS buildbots until a decision is made on the
proper fix for the race condition.
2017-12-22 00:05:05 +01:00
Victor Stinner 9bee329130
bpo-32030: Add _Py_FindEnvConfigValue() (#4963)
Add a new _Py_FindEnvConfigValue() function: code shared between
Windows and Unix implementations of _PyPathConfig_Calculate() to read
the pyenv.cfg file.

_Py_FindEnvConfigValue() now uses _Py_DecodeUTF8_surrogateescape()
instead of using a Python Unicode string, the Python API must not be
used early during Python initialization. Same change in Unix
search_for_exec_prefix(): use _Py_DecodeUTF8_surrogateescape().

Cleanup also encode_current_locale(): PyMem_RawFree/PyMem_Free can be
called with NULL.

Fix also "NUL byte" => "NULL byte" typo.
2017-12-21 16:49:13 +01:00
Victor Stinner 9dd762013f
bpo-32030: Add _Py_EncodeLocaleRaw() (#4961)
Replace Py_EncodeLocale() with _Py_EncodeLocaleRaw() in:

* _Py_wfopen()
* _Py_wreadlink()
* _Py_wrealpath()
* _Py_wstat()
* pymain_open_filename()

These functions are called early during Python intialization, only
the RAW memory allocator must be used.
2017-12-21 16:20:32 +01:00
Andrew Svetlov 4a02543cf9
bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown (#4956) 2017-12-21 17:06:46 +02:00
Victor Stinner e47e698da6
bpo-32030: Add _Py_EncodeUTF8_surrogateescape() (#4960)
Py_EncodeLocale() now uses _Py_EncodeUTF8_surrogateescape(), instead
of using temporary unicode and bytes objects. So Py_EncodeLocale()
doesn't use the Python C API anymore.
2017-12-21 15:45:16 +01:00
Коренберг Марк fbd605151f bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (#4867) 2017-12-21 14:16:17 +02:00
Sebastian Pucilowski a8d25a1645 Fix trivial typo in pickle.rst (#4955) 2017-12-21 11:00:49 +02:00
Paul Ganssle 09dc2f508c bpo-15873: Implement [date][time].fromisoformat (#4699)
Closes bpo-15873.
2017-12-21 00:33:49 -05:00
INADA Naoki 507434fd50
bpo-15216: io: TextIOWrapper.reconfigure() accepts encoding, errors and newline (GH-2343) 2017-12-21 09:59:53 +09:00
Victor Stinner 31e99080f6
bpo-32030: Fix usage of memory allocators (#4953)
* _Py_InitializeCore() doesn't call _PyMem_SetupAllocators() anymore
  if the PYTHONMALLOC environment variable is not set.
* pymain_cmdline() now sets the allocator to the default, instead of
  setting the allocator in subfunctions.
* Py_SetStandardStreamEncoding() now calls
  _PyMem_SetDefaultAllocator() to get a known allocator, to be able
  to release the memory with the same allocator.
2017-12-20 23:41:38 +01:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 83cb778b4a correct the typos (#4950) 2017-12-20 23:36:10 +02:00
Victor Stinner 9cfc00262c
bpo-32030: Complete _PyCoreConfig_Read() (#4946)
* Add _PyCoreConfig.install_signal_handlers
* Remove _PyMain.config: _PyMainInterpreterConfig usage is now
  restricted to pymain_init_python_main().
* Rename _PyMain.core_config to _PyMain.config
* _PyMainInterpreterConfig_Read() now creates the xoptions dictionary
   from the core config
* Fix _PyMainInterpreterConfig_Read(): don't replace xoptions and
  argv if they are already set.
2017-12-20 19:36:46 +01:00
Andrew Svetlov 51eb1c6b9c
bpo-29970: Make ssh_handshake_timeout None by default (#4939)
* Make ssh_handshake_timeout None by default.
* Raise ValueError if ssl_handshake_timeout is used without ssl.
* Raise ValueError if ssl_handshake_timeout is not positive.
2017-12-20 20:24:43 +02:00
Antoine Pitrou a7a751dd7b
bpo-32306: Clarify c.f.Executor.map() documentation (#4947)
The built-in map() function collects function arguments lazily, but concurrent.futures.Executor.map() does so eagerly.
2017-12-20 19:06:20 +01:00
Serhiy Storchaka 6b91a59721
bpo-32385: Clean up the C3 MRO algorithm implementation. (#4942)
Use tuples and raw arrays instead of lists.
2017-12-20 19:21:02 +02:00
Victor Stinner ca719ac42b
bpo-32030: Add _PyCoreConfig.warnoptions (#4936)
Merge _PyCoreConfig_ReadEnv() into _PyCoreConfig_Read(), and
_Py_CommandLineDetails usage is now restricted to pymain_cmdline().

Changes:

* _PyCoreConfig: Add nxoption, xoptions, nwarnoption and warnoptions
* Add _PyCoreConfig.program: argv[0] or ""
* Move filename, command, module and xoptions from
  _Py_CommandLineDetails to _PyMain. xoptions _Py_OptList becomes
  (int, wchar_t**) list.
* Add pymain_cmdline() function
* Rename copy_argv() to copy_wstrlist(). Rename clear_argv() to
  clear_wstrlist(). Remove _Py_OptList structure: use (int,
  wchar_t**) list instead.
* Rename pymain_set_flag_from_env() to pymain_get_env_flag()
* Rename pymain_set_flags_from_env() to pymain_get_env_flags()
* _PyMainInterpreterConfig_Read() now creates the warnoptions from
  _PyCoreConfig.warnoptions
* Inline pymain_add_warning_dev_mode() and
  pymain_add_warning_bytes_flag() into config_init_warnoptions()
* Inline pymain_get_program_name() into _PyCoreConfig_Read()
* _Py_CommandLineDetails: Replace warning_options with nwarnoption
  and warnoptions. Replace env_warning_options with nenv_warnoption
  and env_warnoptions.
* pymain_warnings_envvar() now has a single implementation for
  Windows and Unix: use config_get_env_var_dup() to also get the
  variable as wchar_t* on Unix.
2017-12-20 18:00:19 +01:00
Antoine Pitrou 1f1a34c314
bpo-32379: Faster MRO computation for single inheritance (#4932)
* bpo-32379: Faster MRO computation for single inheritance
2017-12-20 15:58:21 +01:00