Ensure custom formatwarning function can receive line as positional argument.
Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
(cherry picked from commit be7c460fb5)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close(). In IDLE, both have always been None or False since 2007.
(cherry picked from commit b9f0354efc)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Did you know an API documented as printing the pending traceback would sometimes exit the process?
You do now.
(cherry picked from commit 4173772031)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This is needed to even the run the test suite on buildbots for affected platforms; e.g.:
```
./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2
/home/embray/src/python/test-worker/3.x.test-worker/build/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2
Traceback (most recent call last):
File "./Tools/scripts/run_tests.py", line 56, in <module>
main(sys.argv[1:])
File "./Tools/scripts/run_tests.py", line 52, in main
os.execv(sys.executable, args)
PermissionError: [Errno 13] Permission denied
make: *** [Makefile:1073: buildbottest] Error 1
```
(cherry picked from commit 7a7693e9cb)
Co-authored-by: E. M. Bray <erik.m.bray@gmail.com>
Use longer timeout for accept() in the server and block on accept in the client.
The client now only sets the timeout once the socket is connected.
(cherry picked from commit 53b9e1a1c1)
Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
The standard math library (libm) may follow IEEE-754 recommendation to
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
And this triggers a name clash, found by FreeBSD developer
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
(it has to be named "sinpi", not "sinPi", cf. e.g.
https://en.cppreference.com/w/c/experimental/fpext4).
(cherry picked from commit f57cd8288d)
Co-authored-by: Dima Pasechnik <dimpase@gmail.com>
Per POSIX, `nice(3)` requires `unistd.h` and `exit(3)` requires `stdlib.h`.
Fixing the test will prevent false positives with pedantic compilers like clang.
(cherry picked from commit 90c6facebd)
Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
* Resolve string target to patch.dict during function call
* Add NEWS entry
* Remove unneeded call
* Restore original value for support.target and refactor assertions
* Add extra assertion to verify unpatched dict
(cherry picked from commit a875ea58b2)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
Document usage of the existing `--prompt` option in the command line help.
(cherry picked from commit 3208880f1c)
Co-authored-by: Holger Frey <socials@holgerfrey.de>
read() returns bytes for a file opened in binary mode,
so b'' should be used as a sentinel instead of ''.
Otherwise the loop will be infinite.
(cherry picked from commit 11fa0e48a9)
Co-authored-by: Cristian Ciupitu <cristian.ciupitu@yahoo.com>
Fix test_ssl for strict OpenSSL configuration like RHEL8 strict crypto policy.
Use older TLS version for minimum TLS version of the server SSL context if
needed, to test TLS version older than default minimum TLS version.
(cherry picked from commit 3ef6344ee5)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
`object.__new__` and `object.__init__` do take one argument each,
they just don't take extra user supplied arguments.
Patch by Sanyam Khurana.
(cherry picked from commit 5105483acb)
Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
Fix C implementation of pickle.loads to use importlib's locking mechanisms, and thereby avoid using partially-loaded modules.
(cherry picked from commit 4371c0a9c0)
Co-authored-by: tjb900 <ozburgess@gmail.com>
Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases.
Also add a missing index in re.rst.
(cherry picked from commit 4a7f44a2ed)
Co-authored-by: animalize <animalize@users.noreply.github.com>
The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error.
(cherry picked from commit 09fbcd6085)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
(cherry picked from commit ac28147e78)
Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
Previously, `debug print(` would cause the interpreter to exit on a SyntaxError whereas `print(` would properly display the error and return to the pdb prompt.
This patch fixes this by pre-compiling the code before passing it to `Pdb.run`.
https://bugs.python.org/issue35931
(cherry picked from commit 4327705cfa)
Co-authored-by: Daniel Hahler <github@thequod.de>
Based on reviewer feedback from Allen Downey, convert ``lambda`` to ``def``.
(cherry picked from commit 9abb725cea)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>