Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.
For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.
On Windows, set temporarily the LC_CTYPE locale to the user preferred
encoding to ensure that it uses the ANSI code page, to be consistent
with locale.getpreferredencoding().
For command line option, `option` is better than `parameter`.
(cherry picked from commit 0983fcd0d5)
Co-authored-by: NAKAMURA Osamu <osamu0329nakamura@users.noreply.github.com>
Fix two unlikely reference leaks in _hashopenssl. The leaks only occur in
out-of-memory cases. Thanks to Charalampos Stratakis.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue36179
(cherry picked from commit b7bc283ab6)
Co-authored-by: Christian Heimes <christian@python.org>
For C++ extensions, distutils tries to replace the C compiler with the
C++ compiler, but it assumes that C compiler is the first element after
any environment variables set. On AIX, linking goes through ld_so_aix,
so it is the first element and the compiler is the next element. Thus
the replacement is faulty:
ld_so_aix gcc ... -> g++ gcc ...
Also, it assumed that self.compiler_cxx had only 1 element or that
there were the same number of elements as the linker has and in the
same order. This might not be the case, so instead concatenate
everything together.
(cherry picked from commit 800d5cd750)
Co-authored-by: Kevin Adler <kadler@us.ibm.com>
* bpo-20906: Corrections & revisions to Unicode HOWTO
* bpo-34484: don't describe range as a Private Use Area
(cherry picked from commit 97c288df61)
Co-authored-by: Andrew Kuchling <amk@amk.ca>
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>