Commit Graph

24698 Commits

Author SHA1 Message Date
Victor Stinner 279657bac2
[3.7] bpo-29571: Fix test_re.test_locale_flag() (GH-12178)
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().
2019-03-05 16:17:43 +01:00
Miss Islington (bot) f780443399
fixed duplicated method name of test_getuserbase() (GH-12140)
(cherry picked from commit 45d8d2469a)

Co-authored-by: native-api <ivan_pozdeev@mail.ru>
2019-03-03 15:09:10 -08:00
Miss Islington (bot) b94874f7e2
bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)
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>
2019-03-01 09:40:10 -08:00
Miss Islington (bot) 2632474957
bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition (GH-12053)
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>
2019-02-26 08:48:52 -08:00
Miss Islington (bot) 6163210089
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
(cherry picked from commit a40681dd5d)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2019-02-22 06:03:26 -08:00
Miss Islington (bot) 7121a6eeb7 bpo-36060: Document how collections.ChainMap() determines iteration order (GH-11969) (GH-11978)
(cherry picked from commit 86f093f71a)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-02-21 09:47:46 -08:00
Miss Islington (bot) e8bf04de4b
bpo-36037: Fix test_ssl for strict OpenSSL policy (GH-11940)
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>
2019-02-19 09:24:16 -08:00
Miss Islington (bot) 64ca728223
bpo-31506: Clarify error messages for object.__new__ and object.__init__ (GH-11641)
`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>
2019-02-19 05:47:13 -08:00
Miss Islington (bot) a8834905df
Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)
(cherry picked from commit 8d01eb49fc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-02-19 04:16:36 -08:00
Miss Islington (bot) 35de9bbbab
Fix a misnamed test for lists. (GH-11933)
(cherry picked from commit f522a57ec7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-02-19 04:12:16 -08:00
Miss Islington (bot) 3129432845 bpo-34572: change _pickle unpickling to use import rather than retrieving from sys.modules (GH-9047) (GH-11921)
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>
2019-02-18 15:52:32 +00:00
Miss Islington (bot) 0e379d43ac
bpo-34294: re module, fix wrong capturing groups in rare cases. (GH-11546)
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>
2019-02-18 05:48:23 -08:00
Miss Islington (bot) a01065a358
bpo-35942: Improve the error message if __fspath__ returns invalid types in path_converter (GH-11831)
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>
2019-02-18 03:05:52 -08:00
Miss Islington (bot) a7f929db60
bpo-35992: Use PySequence_GetItem only if sq_item is not NULL (GH-11857)
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>
2019-02-17 15:33:04 -08:00
Miss Islington (bot) 6f352199e4
bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)
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>
2019-02-15 13:19:44 -08:00
Miss Islington (bot) 04a39399ef
bpo-35994: add sub dir for sub2_tree in os.walk test if symlink is not supported (GH-11853)
https://bugs.python.org/issue35994
(cherry picked from commit 3e028b2d40)

Co-authored-by: pxinwr <peixing.xin@windriver.com>
2019-02-14 21:23:07 -08:00
Miss Islington (bot) 7e618f3154
bpo-35633: test_lockf() fails with "PermissionError: [Errno 13] Permission denied" on AIX (GH-11424)
[bpo-35633](https://bugs.python.org/issue35633): Fix a test regression introduced with [bpo-35189](https://bugs.python.org/issue35189) (PEP 475: fnctl functions are not retried if interrupted (EINTR)).

Not only a blocking IO error needs to be ignored - permission errors also need to be ignored.

p.s. - iirc as a "test" only correction a NEWS item is not required. If this is not correct - just mention, and I'll add a NEWS blurb.

https://bugs.python.org/issue35633
(cherry picked from commit b94d4bed67)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2019-02-14 10:41:37 -08:00
Miss Islington (bot) 009220eae2
bpo-35505: Skip test_imap4_host_default_value if localhost listens on IMAP port (GH-11823)
Make test_imap4_host_default_value independent on whether the
local IMAP server is running.
(cherry picked from commit 3dc67d0316)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2019-02-12 10:54:31 -08:00
Miss Islington (bot) 0a834c18cd bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815) (GH-11826)
(cherry picked from commit b01786c881)

Co-authored-by: Christopher Hunt <chrahunt@gmail.com>
2019-02-12 07:11:48 -05:00
Miss Islington (bot) 58f05ce059 bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824)
(cherry picked from commit a31f4cc881)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-02-11 17:09:22 -08:00
Miss Islington (bot) 6f0f764820
Make sure the BaseManager in test_multiprocessing is cleaned up correctly (GH-11653)
(cherry picked from commit 7b2a37b728)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-02-09 09:53:51 -08:00
Miss Islington (bot) 36ed5b3c4e
Do not retain references to processes and managers in TestSyncManagerTypes (GH-11801)
Keeping references to processes and managers between tests makes them count as dangling processes.
(cherry picked from commit 613f729e5d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-02-09 09:26:16 -08:00
Miss Islington (bot) 48769a28ad bpo-35615: Fix crashes when copying a Weak{Key,Value}Dictionary. (GH-11384) (GH-11785)
Protect dict iterations by wrapping them with _IterationGuard in the
following methods:

- WeakValueDictionary.copy()
- WeakValueDictionary.__deepcopy__()
- WeakKeyDictionary.copy()
- WeakKeyDictionary.__deepcopy__()
(cherry picked from commit 96d37dbcd2)

Co-authored-by: Fish <ltfish@users.noreply.github.com>
2019-02-07 20:09:16 +00:00
Antoine Pitrou 15526f5be7
[3.7] bpo-35917: Test multiprocessing manager classes and shareable types (GH-11772) (GH-11780)
multiprocessing: provide unittests for manager classes and shareable types.
(cherry picked from commit 2848d9d299)

Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
2019-02-07 11:34:12 +00:00
Steve Dower 44467e8ea4
bpo-35872 and bpo-35873: Clears __PYVENV_LAUNCHER__ variable (GH-11745)
After reading __PYVENV_LAUNCHER__ we now set sys._base_executable value for later use.
Make the same changes for macOS to avoid extra platform checks.
2019-02-04 07:20:19 -08:00
Miss Islington (bot) 63a69ef4a2
bpo-29734: nt._getfinalpathname handle leak (GH-740)
Make sure that failure paths call CloseHandle outside of the function that failed
(cherry picked from commit b82bfac436)

Co-authored-by: Mark Becwar <mark@thebecwar.com>
2019-02-02 13:29:07 -08:00
Miss Islington (bot) 56f84117a7
bpo-1104: msilib.SummaryInfo.GetProperty() truncates the string by one character (GH-4517)
Add one char to MsiSummaryInfoGetProperty() output
Based on the patch in bpo-1104 by Anthony Tuininga (atuining) and Mark McMahon (markm).
(cherry picked from commit 2de576e16d)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2019-02-02 09:36:48 -08:00
Miss Islington (bot) 03082a836b
bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700)
(cherry picked from commit a1f9a3332b)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-01-30 14:14:35 -08:00
Miss Islington (bot) 1c79891026 bpo-35717: Fix KeyError exception raised when using enums and compile (GH-11523) (GH-11669)
https://bugs.python.org/issue17467
(cherry picked from commit 1fd06f1eca)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-01-30 18:36:51 +01:00
Miss Islington (bot) b2b023c657 bpo-35780: Fix errors in lru_cache() C code (GH-11623) (GH-11682) 2019-01-26 03:23:40 -05:00
Miss Islington (bot) 6a9c0fca3f
bpo-35797: Fix default executable used by the multiprocessing module (GH-11676)
(cherry picked from commit 4e02f8f8b4)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-01-25 15:14:41 -08:00
Steve Dower 128efcade6
bpo-35683: Improve Azure Pipelines steps (GH-11493) 2019-01-22 12:31:30 -08:00
Miss Islington (bot) d1dd6be613
bpo-35772: Fix test_tarfile on ppc64 (GH-11606)
Fix sparse file tests of test_tarfile on ppc64le with the tmpfs
filesystem.

Fix the function testing if the filesystem supports sparse files:
create a file which contains data and "holes", instead of creating a
file which contains no data.

tmpfs effective block size is a page size (tmpfs lives in the page
cache). RHEL uses 64 KiB pages on aarch64, ppc64 and ppc64le, only
s390x and x86_64 use 4 KiB pages, whereas the test punch holes of
4 KiB.

test.pythoninfo: Add resource.getpagesize().
(cherry picked from commit b2385458ce)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-01-21 01:44:30 -08:00
Miss Islington (bot) 6ca7183b35
bpo-35045: Accept TLSv1 default in min max test (GH-11510)
Make ssl tests less strict and also accept TLSv1 as system default. The
changes unbreaks test_min_max_version on Fedora 29.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 34de2d312b)

Co-authored-by: Christian Heimes <christian@python.org>
2019-01-18 07:29:08 -08:00
Dong-hee Na c2647f2e45 bpo-35283: Add pending deprecation warning for Thread.isAlive (GH-11604)
Add a pending deprecated warning for the threading.Thread.isAlive() method.
2019-01-18 15:09:43 +01:00
Miss Islington (bot) a261b73761 bpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)
(cherry picked from commit 17f05bbc78)

Co-authored-by: Timo Furrer <tuxtimo@gmail.com>
2019-01-17 17:32:59 +03:00
Miss Islington (bot) be5de958e9
bpo-35746: Fix segfault in ssl's cert parser (GH-11569)
Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
distribution points with empty DP or URI correctly. A malicious or buggy
certificate can result into segfault.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue35746
(cherry picked from commit a37f52436f)

Co-authored-by: Christian Heimes <christian@python.org>
2019-01-15 15:03:36 -08:00
Miss Islington (bot) 97d6a56d9d
bpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)
Handle the case of an empty module name in PYTHONBREAKPOINT.

Fixes a regression introduced in bpo-34756.
(cherry picked from commit 3607ef43c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-01-15 03:45:57 -08:00
Miss Islington (bot) 26122de1a8
bpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)
Previously, calling the strftime() method on a datetime object with a
trailing '%' in the format string would result in an exception. However,
this only occured when the datetime C module was being used; the python
implementation did not match this behavior. Datetime is now PEP-399
compliant, and will not throw an exception on a trailing '%'.
(cherry picked from commit 454b3d4ea2)

Co-authored-by: MichaelSaah <mike.saah@gmail.com>
2019-01-14 02:41:33 -08:00
Miss Islington (bot) d39c192559
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.
(cherry picked from commit 44cc4822bb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-01-11 23:40:09 -08:00
Miss Islington (bot) 1cbd17c698
bpo-24746: Fix doctest failures when running the testsuite with -R (GH-11501)
(cherry picked from commit c5dc60ea85)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-01-10 08:02:26 -08:00
Miss Islington (bot) 53cf5f084b
bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (GH-10639)
(cherry picked from commit cbb1645993)

Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
2019-01-09 05:56:40 -08:00
Miss Islington (bot) 9a413faa87
bpo-35560: Remove assertion from format(float, "n") (GH-11288)
Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.
(cherry picked from commit 3f7983a25a)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-01-07 07:26:20 -08:00
Miss Islington (bot) 65ed9f31cf
test_threading_local: add missing "import sys" (GH-8049)
(cherry picked from commit a0bb51e44c)

Co-authored-by: cclauss <cclauss@me.com>
2019-01-06 14:32:52 -08:00
Miss Islington (bot) 75bf2b1e23
Fix typo in test module usage message (GH-11374)
A minor typo in the output of `python -m test -h`.
A space was missing in between two words.
howmuch -> how much
(cherry picked from commit 7108aab49c)

Co-authored-by: sth <sth.dev@tejp.de>
2018-12-30 21:59:08 -08:00
Miss Islington (bot) 5d2e4b1ff2
bpo-35214: Skip test_io tests that'd cause a huge malloc under msan (GH-11385)
* skip test_constructor under msan.

* fix the others as well.

* reuse existing related news entry.

* typo fix
(cherry picked from commit e5796c42c6)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-12-30 20:39:28 -08:00
Miss Islington (bot) 89e7979f06
Fix typos in test_faulthandler skipIfs for ubsan. (GH-11386)
(cherry picked from commit d6f45b23a5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-12-30 20:34:03 -08:00
Miss Islington (bot) e404299057
Cleanup test_faulthandler sanitizer skip logic. (GH-11381)
Also skip the same tests when using the undefined behavior sanitizer
as they much with the output.

Updates a regex in another test to use multi-line mode so that the ubsan
buildbot should pass again rather than also adding a skip to that one.
(cherry picked from commit 30e023256a)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-12-30 18:28:11 -08:00
Miss Islington (bot) 01b9664740 bpo-35214: MSan workarounds for socket, time, and test_faulthandler. (GH-11375) (GH-11378)
Add Clang Memory Sanitizer build instrumentation to work around
false positives from the socket and time modules as well as skipping
a couple test_faulthandler tests.
(cherry picked from commit b474e6774d)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-12-30 17:59:19 -08:00
Miss Islington (bot) fe06646d18
bpo-35602: Make sure the transport is always closed in SelectorEventLoopUnixSockSendfileTests (GH-11338)
There is a race condition in SelectorEventLoopUnixSockSendfileTests that causes the prepare() method return a non connected server protocol, making the cleanup() method skips the correct handling of the transport. This commit makes prepare() always return a connected server protocol that can always be cleaned up correctly.
(cherry picked from commit d51324a2f5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-12-29 11:38:24 -08:00