summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (#5876)Christian Heimes2018-02-251-5/+5
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-30622: Improve NPN support detection (#5859)Christian Heimes2018-02-241-3/+3
| | | | | | The ssl module now detects missing NPN support in LibreSSL. Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org> Signed-off-by: Christian Heimes <christian@python.org>
* bpo-24334: Cleanup SSLSocket (#5252)Christian Heimes2018-02-241-33/+53
| | | | | | | | | | | | | * The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory.
* [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128)Christian Heimes2018-02-241-14/+1
| | | | | | | | | | | | Previously, the ssl module stored international domain names (IDNs) as U-labels. This is problematic for a number of reasons -- for example, it made it impossible for users to use a different version of IDNA than the one built into Python. After this change, we always convert to A-labels as soon as possible, and use them for all internal processing. In particular, server_hostname attribute is now an A-label, and on the server side there's a new sni_callback that receives the SNI servername as an A-label rather than a U-label.
* bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage ↵Steve Dower2018-02-221-15/+24
| | | | now correctly convert from bytes. (GH-5761)
* bpo-31333: Re-implement ABCMeta in C (#5273)Ivan Levkivskyi2018-02-181-0/+162
| | | | This adds C versions of methods used by ABCMeta that improve performance of various ABC operations.
* bpo-20104: Expose `posix_spawn` in the os module (GH-5109)Pablo Galindo2018-01-291-1/+53
| | | | | Add os.posix_spawn to wrap the low level POSIX API of the same name. Contributed by Pablo Galindo.
* bpo-31368: Expose preadv and pwritev in the os module (#5239)Pablo Galindo2018-01-271-1/+119
|
* bpo-32433: Optimized HMAC digest (#5023)Christian Heimes2018-01-271-1/+43
| | | | | | | The hmac module now has hmac.digest(), which provides an optimized HMAC digest for short messages. hmac.digest() is up to three times faster than hmac.HMAC().digest(). Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for ↵Barry Warsaw2018-01-241-1/+32
| | | | zipimport (#5248)
* bpo-32643: Drop support for a few private Task and Future APIs. (#5293)Yury Selivanov2018-01-241-76/+1
| | | | | | | | Specifically, it's not possible to subclass Task/Future classes and override the following methods: * Future._schedule_callbacks * Task._step * Task._wakeup
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-232-3/+47
|
* bpo-9566: Fix size_t=>int downcast warnings (#5230)Victor Stinner2018-01-181-4/+4
| | | | * Use wider types (int => Py_ssize_t) to avoid integer overflows. * Fix gc.get_freeze_count(): use Py_ssize_t type rather than int, since gc_list_size() returns a Py_ssize_t.
* bpo-14976: Reentrant simple queue (#3346)Antoine Pitrou2018-01-151-0/+218
| | | | Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().
* return the new file descriptor from os.dup2 (closes bpo-32441) (#5041)Benjamin Peterson2017-12-291-3/+8
|
* bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923)Yury Selivanov2017-12-251-2/+18
|
* bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992)Yury Selivanov2017-12-231-17/+31
|
* bpo-19764: Implemented support for subprocess.Popen(close_fds=True) on ↵Segev Finer2017-12-181-1/+35
| | | | | | | | | | | | | | | | | Windows (#1218) Even though Python marks any handles it opens as non-inheritable there is still a race when using `subprocess.Popen` since creating a process with redirected stdio requires temporarily creating inheritable handles. By implementing support for `subprocess.Popen(close_fds=True)` we fix this race. In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST which is available since Windows Vista. Which allows to pass an explicit list of handles to inherit when creating a process. This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]` which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST directly.
* bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799)Andrew Svetlov2017-12-161-1/+139
|
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-1540-407/+407
| | | | arguments. (#4746)
* bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. (#4827)Yury Selivanov2017-12-131-1/+79
| | | | | | | | asyncio.get_event_loop(), and, subsequently asyncio._get_running_loop() are one of the most frequently executed functions in asyncio. They also can't be sped up by third-party event loops like uvloop. When implemented in C they become 4x faster.
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-1/+19
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-32030: Enhance Py_Main() (#4412)Victor Stinner2017-11-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)Tal Einat2017-11-031-1/+5
| | | | | | | | | When a single .c file contains several functions and/or methods with the same name, a safety _METHODDEF #define statement is generated only for one of them. This fixes the bug by using the full name of the function to avoid duplicates rather than just the name.
* bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner2017-10-241-3/+3
| | | | | | | | | | | | | | | | Fix the pthread+semaphore implementation of PyThread_acquire_lock_timed() when called with timeout > 0 and intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a signal (EINTR). See also the PEP 475. The pthread implementation of PyThread_acquire_lock() now fails with a fatal error if the timeout is larger than PY_TIMEOUT_MAX, as done in the Windows implementation. The check prevents any risk of overflow in PyThread_acquire_lock(). Add also PY_DWORD_MAX constant.
* bpo-31558: Add gc.freeze() (#3705)brainfvck2017-10-161-1/+71
| | | | | 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.
* bpo-30807: signal.setitimer() now uses _PyTime API (GH-3865)Victor Stinner2017-10-131-6/+6
| | | | | | The _PyTime API handles detects overflow and is well tested. Document that the signal will only be sent once if internal is equal to zero.
* bpo-30397: Add re.Pattern and re.Match. (#1646)Serhiy Storchaka2017-10-041-3/+3
|
* bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo(). (#3864)Serhiy Storchaka2017-10-031-9/+9
|
* bpo-31428: Prevent raising a SystemError in case the memo arg of ↵Oren Milman2017-09-121-1/+19
| | | | ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-3/+3
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Regen Moduls/clinic/_ssl.c.h (GH-3320)Zachary Ware2017-09-041-3/+3
| | | Broken in GH-2079
* bpo-30622: Change NPN detection: (#2079)Melvyn Sopacua2017-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change NPN detection: Version breakdown, support disabled (pre-patch/post-patch): - pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will be defined -> True/False Version breakdown support enabled (pre-patch/post-patch): - pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True - 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True * Refine NPN guard: - If NPN is disabled, but ALPN is available we need our callback - Make clinic's ssl behave the same way This created a working ssl module for me, with NPN disabled and ALPN enabled for OpenSSL 1.1.0f. Concerns to address: The initial commit for NPN support into OpenSSL [1], had the OPENSSL_NPN_* variables defined inside the OPENSSL_NO_NEXTPROTONEG guard. The question is if that ever made it into a release. This would need an ugly hack, something like: #if defined(OPENSSL_NO_NEXTPROTONEG) && \ !defined(OPENSSL_NPN_NEGOTIATED) # define OPENSSL_NPN_UNSUPPORTED 0 # define OPENSSL_NPN_NEGOTIATED 1 # define OPENSSL_NPN_NO_OVERLAP 2 #endif [1] https://github.com/openssl/openssl/commit/68b33cc5c7
* bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076)Serhiy Storchaka2017-09-031-4/+4
|
* bpo-31109: Convert zipimport to use Argument Clinic (GH-2990)Yaron de Leeuw2017-08-181-0/+294
|
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-0339-1312/+404
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* Regenerate Argument Clinic code for bpo-19180. (#2073)Serhiy Storchaka2017-06-101-1/+1
|
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-1029-766/+766
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* bpo-19180: Updated references for RFC 1750, RFC 3280 & RFC 4366 (GH-148)Chandan Kumar2017-06-091-1/+1
| | | | | * RFC 1750 has been been obsoleted by RFC 4086. * RFC 3280 has been obsoleted by RFC 5280. * RFC 4366 has been obsoleted by RFC 6066.
* bpo-16500: Don't use string constants for os.register_at_fork() behavior (#1834)Gregory P. Smith2017-05-291-17/+21
| | | | Instead use keyword only arguments to os.register_at_fork for each of the scenarios. Updates the documentation for clarity.
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-1/+49
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-30285: Optimize case-insensitive matching and searching (#1482)Serhiy Storchaka2017-05-091-1/+63
| | | | of regular expressions.
* bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and ↵Serhiy Storchaka2017-05-051-12/+37
| | | | _sre.unicode_tolower(). (#1468)
* bpo-30103: Allow Uuencode in Python using backtick as zero instead of space ↵Xiang Zhang2017-05-031-7/+11
| | | | | | (#1326)
* restore *data* parameter of binascii.b2a_base64 to positional-only (#1352)Xiang Zhang2017-05-011-3/+3
|
* bpo-10076: Compiled regular expression and match objects now are copyable. ↵Serhiy Storchaka2017-04-161-47/+5
| | | | (#1000)
* bpo-29204: Emit warnings for already deprecated ElementTree features. (#773)Serhiy Storchaka2017-03-301-1/+30
| | | | | | | | Element.getiterator() and the html parameter of XMLParser() were deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly). Now using them emits a deprecation warning. * Don’t need check_warnings any more.
* bpo-25996: Added support of file descriptors in os.scandir() on Unix. (#502)Serhiy Storchaka2017-03-301-2/+2
| | | | os.fwalk() is sped up by 2 times by using os.scandir().
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-4/+5
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* bpo-20185: Convert the resource moduel to Argument Clinic. (#545)Serhiy Storchaka2017-03-121-0/+164
| | | Based on patch by Vajrasky Kok.