summaryrefslogtreecommitdiff
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-35113: Fix inspect.getsource to return correct source for inner classes ↵Karthikeyan Singaravelan2020-04-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10307) * Use ast module to find class definition * Add NEWS entry * Fix class with multiple children and move decorator code to the method * Fix PR comments 1. Use node.decorator_list to select decorators 2. Remove unwanted variables in ClassVisitor 3. Simplify stack management as per review * Add test for nested functions and async calls * Fix pydoc test since comments are returned now correctly * Set event loop policy as None to fix environment related change * Refactor visit_AsyncFunctionDef and tests * Refactor to use local variables and fix tests * Add patch attribution * Use self.addCleanup for asyncio * Rename ClassVisitor to ClassFinder and fix asyncio cleanup * Return first class inside conditional in case of multiple definitions. Remove decorator for class source. * Add docstring to make the test correct * Modify NEWS entry regarding decorators * Return decorators too for bpo-15856 * Move ast and the class source code to top. Use proper Exception.
* bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364)Serhiy Storchaka2020-04-181-0/+1
| | | | Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-40257: Improve help for the typing module (GH-19546)Serhiy Storchaka2020-04-181-0/+4
| | | | | | * Show docstring for special forms. * Show docstring for special generic aliases. * Show documentation for __origin__ for generic aliases.
* bpo-40282: Allow random.getrandbits(0) (GH-19539)Antoine Pitrou2020-04-171-0/+1
|
* bpo-40286: Add randbytes() method to random.Random (GH-19527)Victor Stinner2020-04-171-0/+2
| | | | | | | | | | | | Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined.
* bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)Inada Naoki2020-04-171-0/+1
| | | It has not returned the file position after the seek.
* bpo-39793: use the same domain on make_msgid tests (#18698)Batuhan Taşkaya2020-04-161-0/+1
| | | | | * bpo-39793: use same domain on make_msgid tests * apply suggestions
* bpo-40290: Add zscore() to statistics.NormalDist. (GH-19547)Raymond Hettinger2020-04-161-0/+1
|
* bpo-35967 resolve platform.processor late (GH-12239)Jason R. Coombs2020-04-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replace flag-flip indirection with direct inspection * Use any for simpler code * Avoid flag flip and set results directly. * Resolve processor in a single function. * Extract processor handling into a namespace (class) * Remove _syscmd_uname, unused * Restore platform.processor behavior to match prior expectation (reliant on uname -p in a subprocess). * Extract '_unknown_as_blank' function. * Override uname_result to resolve the processor late. * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call. * 📜🤖 Added by blurb_it. * Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank. Co-authored-by: blurb-it[bot] <blurb-it[bot]@users.noreply.github.com>
* bpo-40270: Enable json extension in Windows sqlite extension (GH-19528)Ammar Askar2020-04-151-0/+2
|
* bpo-40257: Output object's own docstring in pydoc (GH-19479)Serhiy Storchaka2020-04-151-0/+5
|
* bpo-29255: Wait in KqueueSelector.select when no fds are registered (GH-19508)Russell Davis2020-04-151-0/+1
| | | | Also partially fixes bpo-25680 (there's still a discrepancy in behavior on Windows that needs to be fixed).
* bpo-40267: Fix message when last input character produces a SyntaxError ↵Lysandros Nikolaou2020-04-151-0/+1
| | | | | | | | (GH-19521) When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong.
* bpo-40277: Add a repr() to namedtuple's _tuplegetter to aid with ↵Ammar Askar2020-04-141-0/+2
| | | | introspection (GH-19537)
* bpo-40260: Update modulefinder to use io.open_code() and respect coding ↵Barry2020-04-141-0/+1
| | | | comments (GH-19488)
* bpo-395222: Correctly unparse unicode prefix in ast_unparse.c (GH-19512)Batuhan Taşkaya2020-04-141-0/+2
|
* bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464)Hai Shi2020-04-141-0/+2
|
* bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396)Batuhan Taşkaya2020-04-141-0/+1
|
* bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048)Sebastian Pedersen2020-04-141-0/+3
| | | | | Add the encoding in ftplib.FTP and ftplib.FTP_TLS to the constructor as keyword-only and change the default from "latin-1" to "utf-8" to follow RFC 2640.
* bpo-32894: Support unparsing of infinity numbers in ast_unparser.c (GH-17426)Batuhan Taşkaya2020-04-141-0/+1
|
* bpo-40091: Fix a hang at fork in the logging module (GH-19416)Victor Stinner2020-04-141-0/+2
| | | | | | | Fix a hang at fork in the logging module: the new private _at_fork_reinit() method is now used to reinitialize locks at fork in the child process. The createLock() method is no longer used at fork.
* bpo-40241: Add pycore_gc.h header file (GH-19494)Victor Stinner2020-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the PyGC_Head structure and the following private macros to the internal C API: * _PyGCHead_FINALIZED() * _PyGCHead_NEXT() * _PyGCHead_PREV() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * _PyGCHead_SET_PREV() * _PyGC_FINALIZED() * _PyGC_PREV_MASK * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_SHIFT * _PyGC_SET_FINALIZED() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * _Py_AS_GC(o) Keep the private _PyGC_FINALIZED() macro in the public C API for backward compatibility with Python 3.8: make it an alias to the new PyObject_GC_IsFinalized() function. Move the SIZEOF_PYGC_HEAD constant from _testcapi module to _testinternalcapi module.
* bpo-40234: Revert "bpo-37266: Daemon threads are now denied in ↵Victor Stinner2020-04-121-0/+2
| | | | | subinterpreters (GH-14049)" (GH-19456) This reverts commit 066e5b1a917ec2134e8997d2cadd815724314252.
* bpo-40246: Report a better error message for invalid string prefixes (GH-19476)Lysandros Nikolaou2020-04-121-0/+1
|
* bpo-31758: Prevent crashes when using an uninitialized ↵Oren Milman2020-04-121-0/+2
| | | | _elementtree.XMLParser object (GH-3997)
* bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355)Alex Itkes2020-04-121-0/+1
|
* bpo-39011: Preserve line endings within ElementTree attributes (GH-18468)mefistotelis2020-04-121-0/+3
| | | | | | | * bpo-39011: Preserve line endings within attributes Line endings within attributes were previously normalized to "\n" in Py3.7/3.8. This patch removes that normalization, as line endings which were replaced by entity numbers should be preserved in original form.
* closes bpo-39953: Update OpenSSL error codes table. (GH-19082)Benjamin Peterson2020-04-111-0/+1
| | | I updated the error codes using the OpenSSL 1.1.1f source tree.
* bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)Serhiy Storchaka2020-04-111-0/+3
| | | | | Patcher's __exit__() is now never called if its __enter__() is failed. Returning true from __exit__() silences now the exception.
* bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the ↵Pablo Galindo2020-04-111-0/+4
| | | | | public C-API (GH-19461) Add the functions PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively.
* bpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448)pxinwr2020-04-091-0/+1
|
* bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190)Zackery Spytz2020-04-092-0/+2
| | | Co-Authored-By: Stefan Tatschner <stefan@rumpelsepp.org>
* bpo-40082: trip_signal() uses the main interpreter (GH-19441)Victor Stinner2020-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | Fix the signal handler: it now always uses the main interpreter, rather than trying to get the current Python thread state. The following function now accepts an interpreter, instead of a Python thread state: * _PyEval_SignalReceived() * _Py_ThreadCanHandleSignals() * _PyEval_AddPendingCall() * COMPUTE_EVAL_BREAKER() * SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST() * SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS() * SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS() * SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC() Py_AddPendingCall() now uses the main interpreter if it fails to the current Python thread state. Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE() macros to static inline functions.
* bpo-40170: Remove PyIndex_Check() macro (GH-19428)Victor Stinner2020-04-081-0/+3
| | | | | Always declare PyIndex_Check() as an opaque function to hide implementation details: remove PyIndex_Check() macro. The macro accessed directly the PyTypeObject.tp_as_number member.
* bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)Victor Stinner2020-04-081-0/+4
| | | | | | | | PyType_HasFeature() now always calls PyType_GetFlags() to hide implementation details. Previously, it accessed directly the PyTypeObject.tp_flags member when the limited C API was not used. Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c.
* bpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376)Victor Stinner2020-04-081-0/+3
| | | | | Convert PyObject_CheckBuffer() macro to a function to hide implementation details: the macro accessed directly the PyTypeObject.tp_as_buffer member.
* bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)Victor Stinner2020-04-081-0/+4
| | | | | | | | | | | | The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar().
* bpo-40089: Add _at_fork_reinit() method to locks (GH-19195)Victor Stinner2020-04-071-0/+6
| | | | | | | | | | | | | | | Add a private _at_fork_reinit() method to _thread.Lock, _thread.RLock, threading.RLock and threading.Condition classes: reinitialize the lock after fork in the child process; reset the lock to the unlocked state. Rename also the private _reset_internal_locks() method of threading.Event to _at_fork_reinit(). * Add _PyThread_at_fork_reinit() private function. It is excluded from the limited C API. * threading.Thread._reset_internal_locks() now calls _at_fork_reinit() on self._tstate_lock rather than creating a new Python lock object.
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-071-0/+1
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-40149: Implement traverse in _abc._abc_data (GH-19412)Victor Stinner2020-04-071-0/+1
| | | Implement traverse and clear slots in _abc._abc_data type.
* bpo-37388: Don't check encoding/errors during finalization (GH-19409)Victor Stinner2020-04-071-0/+4
| | | | | | | | | str.encode() and str.decode() no longer check the encoding and errors in development mode or in debug mode during Python finalization. The codecs machinery can no longer work on very late calls to str.encode() and str.decode(). This change should help to call _PyObject_Dump() to debug during late Python finalization.
* bpo-40196: Fix a bug in the symtable when reporting inspecting global ↵Pablo Galindo2020-04-061-0/+2
| | | | variables (GH-19391)
* bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377)Victor Stinner2020-04-061-0/+3
| | | | | | | | Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API.
* bpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380)Batuhan Taşkaya2020-04-051-0/+1
|
* bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)Serhiy Storchaka2020-04-051-0/+2
|
* bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344)Hai Shi2020-04-041-0/+1
| | | | Fix possible refleaks in _json module, memo of PyScannerObject should be traversed.
* bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363)Serhiy Storchaka2020-04-041-0/+2
|
* bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359)Steve Dower2020-04-041-0/+1
|
* bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)Tal Einat2020-04-031-0/+2
| | | Inspect.signature failed on the test case because its isinstance call raised.
* bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)Chris Martinez2020-04-031-0/+1
| | | Fix default Python home path relative to the NuGet package