| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
|
|
| |
The timeit doc references Tim Peters introduction to the Chapter 18,
Algorithms, of the second edition. The first editiion was before timeit.
The third edition instead has Chapter 1, Data Structures and Algorithms,
without Tim's introduction.
|
|
|
| |
Include the invalid type in the error message.
|
| |
|
| |
|
|
|
| |
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The invalid assignment rules are very delicate since the parser can
easily raise an invalid assignment when a keyword argument is provided.
As they are very deep into the grammar tree, is very difficult to
specify in which contexts these rules can be used and in which don't.
For that, we need to use a different version of the rule that doesn't do
error checking in those situations where we don't want the rule to raise
(keyword arguments and generator expressions).
We also need to check if we are in left-recursive rule, as those can try
to eagerly advance the parser even if the parse will fail at the end of
the expression. Failing to do this allows the parser to start parsing a
call as a tuple and incorrectly identify a keyword argument as an
invalid assignment, before it realizes that it was not a tuple after all.
|
|
|
|
|
|
|
|
|
| |
Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.
Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.
_PyMem_IsPtrFreed() argument is now constant.
|
| |
|
|
|
|
| |
* bpo-43643: Sync with python/importlib_resources@c17a610aad.
* Sync with python/importlib_resources@89fd5e961a.
|
|
|
|
| |
the first parser pass (GH-26253)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove 'zombie' frames. We won't need them once we are allocating fixed-size frames.
* Add co_nlocalplus field to code object to avoid recomputing size of locals + frees + cells.
* Move locals, cells and freevars out of frame object into separate memory buffer.
* Use per-threadstate allocated memory chunks for local variables.
* Move globals and builtins from frame object to per-thread stack.
* Move (slow) locals frame object to per-thread stack.
* Move internal frame functions to internal header.
|
| |
|
|
|
|
|
|
|
|
| |
(GH-26184)
Issue should be fixed in bpo-43757
Co-Authored-by: Tzu-ping Chung <uranusjr@gmail.com>
|
| |
|
|
|
|
| |
(GH-12131)
|
|
|
|
|
| |
Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to
handle the PYTHONUNBUFFERED environment variable and configure C
stdio streams like stdout (make the stream unbuffered).
|
| |
|
| |
|
| |
|
|
|
|
| |
coroutine methods (GH-20870)
|
|
|
| |
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The newest gcc emmits this warning:
```
/Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
| ^~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
2869 | LEAVE_PYTHON
| ^~~~~~~~~~~~
/Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
243 | (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
| ^
/Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’
272 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
| ^~~~~~~~~~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
2869 | LEAVE_PYTHON
```
that's because the macro packs together two statements at the same level
as the "if". The warning is misleading but is very noisy so it makes
sense to fix it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The newest version of gcc complains about passing un-initialized arrays
as constant pointers:
```
/Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’:
/Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
272 | (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
95 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
| ^~~~~~~~~~~~~~
/Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’}
272 | (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
95 | XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
| ^~~~~~~~~~~~~~
In file included from /Modules/expat/xmltok.c:1657:
/Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here
92 | char buf[ENCODING_MAX];
```
|
|
|
|
| |
expressions (GH-26210)
|
| |
|
|
|
|
|
|
|
| |
* bpo-4928 Document NamedTemporaryFile non-deletion after SIGKILL
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
|
|
| |
Automerge-Triggered-By: GH:vsajip
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Laura Gutierrez Funderburk <58710704+lgfunderburk@users.noreply.github.com>
|
| |
|
|
|
|
| |
Remove Programs/test_frozenmain.h Makefile target: it ran make
in parallel which caused build errors on LTO+PGO builds.
|
|
|
|
|
|
|
|
|
| |
* Add test_frozenmain to test_embed
* Add Programs/test_frozenmain.py
* Add Programs/freeze_test_frozenmain.py
* Add Programs/test_frozenmain.h
* Add make regen-test-frozenmain
* Add test_frozenmain command to Programs/_testembed
* _testembed.c: add error(msg) function
|
|
|
|
|
|
|
| |
files (GH-25058)
`shutil.unpack_archive()` tries to read the whole file into memory, making no use of any kind of smaller buffer. Process crashes for really large files: I.e. archive: ~1.7G, unpacked: ~10G. Before the crash it can easily take away all available RAM on smaller systems. Had to pull the code form `zipfile.Zipfile.extractall()` to fix this
Automerge-Triggered-By: GH:gpshead
|
|
|
|
|
| |
For IPv4 mapped IPv6 addresses, defer privacy check to the mapped IPv4 address. Solves bug where public mapped IPv4 addresses are considered private by the IPv6 check.
Automerge-Triggered-By: GH:gpshead
|
|
|
|
|
|
| |
It was always meant to be released for parallelization.
This now matches the other similar code in the module.
Thanks michaelforney for noticing!
|
| |
|
| |
|
|
|
| |
Automerge-Triggered-By: GH:iritkatriel
|
|
|
|
|
| |
This error was fixed recently in `Doc/whatsnew/3.10.rst`.
Automerge-Triggered-By: GH:iritkatriel
|
| |
|
| |
|
| |
|
|
|
|
| |
targets (GH-26156)
|