summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42146: Fix memory leak in subprocess.Popen() in case of uid/gid overflow ↵Alexey Izbyshev2020-10-261-0/+13
| | | | | | | | | | | (GH-22966) Fix memory leak in subprocess.Popen() in case of uid/gid overflow Also add a test that would catch this leak with `--huntrleaks`. Alas, the test for `extra_groups` also exposes an inconsistency in our error reporting: we use a custom ValueError for `extra_groups`, but propagate OverflowError for `user` and `group`.
* bpo-42043: Add support for zipfile.Path subclasses (#22716)Jason R. Coombs2020-10-251-106/+206
| | | | | * bpo-42043: Add support for zipfile.Path inheritance as introduced in zipp 3.2.0. * Add blurb.
* bpo-41919: Avoid resource leak in test_io (GH-22973)Hai Shi2020-10-251-12/+13
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-41490: ``path`` and ``contents`` to aggressively close handles (#22915)Jason R. Coombs2020-10-253-0/+79
| | | | | | | | | * bpo-41490: ``path`` method to aggressively close handles * Add blurb * In ZipReader.contents, eagerly evaluate the contents to release references to the zipfile. * Instead use _ensure_sequence to ensure any iterable from a reader is eagerly converted to a list if it's not already a sequence.
* bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 ↵Serhiy Storchaka2020-10-241-0/+18
| | | | (GH-22870)
* bpo-38976: Add support for HTTP Only flag in MozillaCookieJar (#17471)Jacob Neil Taylor2020-10-231-0/+5
| | | | | Add support for HTTP Only flag in MozillaCookieJar Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40592: shutil.which will not return None anymore if ; is the last char ↵Christopher Marchfelder2020-10-231-0/+17
| | | | | | in PATHEXT (GH-20088) shutil.which will not return None anymore for empty str in PATHEXT Empty PATHEXT will now be defaulted to _WIN_DEFAULT_PATHEXT
* bpo-36876: Fix the C analyzer tool. (GH-22841)Eric Snow2020-10-2320-4314/+0
| | | | | | | The original tool wasn't working right and it was simpler to create a new one, partially re-using some of the old code. At this point the tool runs properly on the master. (Try: ./python Tools/c-analyzer/c-analyzer.py analyze.) It take ~40 seconds on my machine to analyze the full CPython code base. Note that we'll need to iron out some OS-specific stuff (e.g. preprocessor). We're okay though since this tool isn't used yet in our workflow. We will also need to verify the analysis results in detail before activating the check in CI, though I'm pretty sure it's close. https://bugs.python.org/issue36876
* bpo-42057: Add regression test to master. (GH-22893)Mark Shannon2020-10-221-0/+6
|
* bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155)Batuhan Taskaya2020-10-211-0/+24
| | | | | * bpo-41747: Ensure all dataclass methods uses their parents' qualname Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-23706: Add newline parameter to pathlib.Path.write_text (GH-22420) ↵Максим2020-10-211-0/+20
| | | | | | | | | (GH-22420) * Add _newline_ parameter to `pathlib.Path.write_text()` * Update documentation of `pathlib.Path.write_text()` * Add test case for `pathlib.Path.write_text()` calls with _newline_ parameter passed Automerge-Triggered-By: GH:methane
* bpo-41586: Attempt to make the pipesize tests more robust. (GH-22839)Gregory P. Smith2020-10-212-43/+71
| | | | Several buildbots are failing on these, likely due to an inability to set the pipe size to the desired test value.
* bpo-38324: Fix test__locale.py Windows failures (GH-20529)TIGirardi2020-10-201-0/+4
| | | | Use wide-char _W_* fields of lconv structure on Windows Remove "ps_AF" from test__locale.known_numerics on Windows
* bpo-41491: plistlib: accept hexadecimal integer values in xml plist files ↵Ronald Oussoren2020-10-201-0/+13
| | | | (GH-22764)
* bpo-4356: Add key function support to the bisect module (GH-20556)Raymond Hettinger2020-10-201-0/+57
|
* bpo-38912: fix close before connect callback in test_asyncio SSL tests ↵Justin Turner Arthur2020-10-201-0/+2
| | | | | (GH-22691) Reduces the rate at which the ENV CHANGED failure occurs in test_asyncio SSL tests (due to unclosed transport), but does not 100% resolve it.
* bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and ↵Ruben Vorderman2020-10-192-1/+59
| | | | | | | | | | | | | | | | | F_SETPIPE_SZ to fcntl. (GH-21921) * Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module * Add pipesize parameter for subprocess.Popen class This will allow the user to control the size of the pipes. On linux the default is 64K. When a pipe is full it blocks for writing. When a pipe is empty it blocks for reading. On processes that are very fast this can lead to a lot of wasted CPU cycles. On a typical Linux system the max pipe size is 1024K which is much better. For high performance-oriented libraries such as xopen it is nice to be able to set the pipe size. The workaround without this feature is to use my_popen_process.stdout.fileno() in conjuction with fcntl and 1031 (value of F_SETPIPE_SZ) to acquire this behavior.
* bpo-27321 Fix email.generator.py to not replace a non-existent header. ↵Mark Sapiro2020-10-191-0/+35
| | | | | | | | | | | (GH-18074) This PR replaces #1977. The reason for the replacement is two-fold. The fix itself is different is that if the CTE header doesn't exist in the original message, it is inserted. This is important because the new CTE could be quoted-printable whereas the original is implicit 8bit. Also the tests are different. The test_nonascii_as_string_without_cte test in #1977 doesn't actually test the issue in that it passes without the fix. The test_nonascii_as_string_without_content_type_and_cte test is improved here, and even though it doesn't fail without the fix, it is included for completeness. Automerge-Triggered-By: @warsaw
* bpo-42089: Sync with current cpython branch of importlib_metadata (GH-22775)Barry Warsaw2020-10-192-6/+15
| | | | | ~~The only differences are in the test files.~~ Automerge-Triggered-By: @jaraco
* bpo-41471: Ignore invalid prefix lengths in system proxy settings on macOS ↵Ronald Oussoren2020-10-191-0/+12
| | | | (GH-22762)
* bpo-42051: Reject XML entity declarations in plist files (#22760)Ronald Oussoren2020-10-191-0/+18
|
* bpo-19270: Fixed sched.scheduler.cancel to cancel correct event (GH-22729)Bar Harel2020-10-191-0/+11
|
* bpo-40492: Fix --outfile with relative path when the program changes it ↵Anthony Sottile2020-10-181-1/+15
| | | | working dir (GH-19910)
* bpo-28660: Make TextWrapper break long words on hyphens (GH-22721)Irit Katriel2020-10-181-0/+72
|
* bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731)scaramallion2020-10-181-0/+3
|
* bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message ↵Max Bernstein2020-10-171-0/+12
| | | | (GH-19940)
* bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)Hai Shi2020-10-164-29/+15
| | | | * Move the codecs' (un)register operation to testcases. * Remove _codecs._forget_codec() and _PyCodec_Forget()
* bpo-41984: GC track all user classes (GH-22701)Brandt Bucher2020-10-152-5/+24
|
* bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters ↵Hai Shi2020-10-141-1/+13
| | | | (GH-22219)
* bpo-41939: always enable test_site.test_license_exists_at_url (GH-22688)Ned Deily2020-10-141-2/+0
|
* bpo-41739: Fix test_logging.test_race_between_set_target_and_flush() (GH-22655)Victor Stinner2020-10-111-8/+13
| | | | | | The test now waits until all threads complete to avoid leaking running threads. Also, use regular threads rather than daemon threads.
* bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)Saiyang Gou2020-10-091-2/+2
| | | | | There are two different `SimpleQueue` types imported (from `multiprocessing.queues` and `queue`) in `Lib/test/test_genericalias.py`, the second one shadowing the first one, making the first one not actually tested. Fix by using different names. Automerge-Triggered-By: @gvanrossum
* bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)Serhiy Storchaka2020-10-091-10/+52
| | | | | | Remove complex special methods __int__, __float__, __floordiv__, __mod__, __divmod__, __rfloordiv__, __rmod__ and __rdivmod__ which always raised a TypeError.
* bpo-41979: Accept star-unpacking on with-item targets (GH-22611)Batuhan Taskaya2020-10-091-1/+7
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39337: Add a test case for normalizing of codec names (GH-19069)Hai Shi2020-10-081-0/+25
|
* bpo-41970: Avoid test failure in test_lib2to3 if the module is already ↵Pablo Galindo2020-10-081-1/+2
| | | | | | | imported (GH-22595) … Automerge-Triggered-By: @pablogsal
* Revert "bpo-26680: Incorporate is_integer in all built-in and standard ↵Raymond Hettinger2020-10-076-93/+0
| | | | | library numeric types (GH-6121)" (GH-22584) This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
* bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)Mikhail Golubev2020-10-071-0/+40
| | | | | This special marker annotation is intended to help in distinguishing proper PEP 484-compliant type aliases from regular top-level variable assignments.
* bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)Batuhan Taskaya2020-10-0618-251/+343
| | | | | The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions. For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
* bpo-41905: Add abc.update_abstractmethods() (GH-22485)Ben Avrahami2020-10-062-0/+186
| | | | This function recomputes `cls.__abstractmethods__`. Also update `@dataclass` to use it.
* bpo-41944: No longer call eval() on content received via HTTP in the ↵Florian Bruhin2020-10-061-1/+2
| | | | | | | | | | | UnicodeNames tests (GH-22575) Similarly to GH-22566, those tests called eval() on content received via HTTP in test_named_sequences_full. This likely isn't exploitable because unicodedata.lookup(seqname) is called before self.checkletter(seqname, None) - thus any string which isn't a valid unicode character name wouldn't ever reach the checkletter method. Still, it's probably better to be safe than sorry.
* bpo-41944: No longer call eval() on content received via HTTP in the CJK ↵Serhiy Storchaka2020-10-061-14/+8
| | | | codec tests (GH-22566)
* bpo-41939: Fix test_site.test_license_exists_at_url() (#22559)Victor Stinner2020-10-051-0/+2
| | | | Call urllib.request.urlcleanup() to reset the global urllib.request._opener.
* bpo-41909: Enable previously disabled recursion checks. (GH-22536)Serhiy Storchaka2020-10-041-0/+10
| | | | | | | | | | | Enable recursion checks which were disabled when get __bases__ of non-type objects in issubclass() and isinstance() and when intern strings. It fixes a stack overflow when getting __bases__ leads to infinite recursion. Originally recursion checks was disabled for PyDict_GetItem() which silences all errors including the one raised in case of detected recursion and can return incorrect result. But now the code uses PyDict_GetItemWithError() and PyDict_SetDefault() instead.
* bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)Batuhan Taskaya2020-10-041-0/+6
| | | Also document that eval() does this (the same way).
* bpo-41840: Report module-level globals as both local and global in the ↵Pablo Galindo2020-10-031-2/+16
| | | | symtable module (GH-22391)
* bpo-40564: Avoid copying state from extant ZipFile. (GH-22371)Jason R. Coombs2020-10-031-0/+33
| | | bpo-40564: Avoid copying state from extant ZipFile.
* bpo-41826: Fix compiler warnings in test_peg_generator (GH-22455)Pablo Galindo2020-10-031-16/+17
| | | Co-authored-by: Skip Montanaro
* bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a ↵scoder2020-10-031-0/+8
| | | | default namespace was defined. (GH-22474)
* bpo-26680: Incorporate is_integer in all built-in and standard library ↵Robert Smallshire2020-10-016-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | numeric types (GH-6121) * bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer(). The int.is_integer() method always returns True. * bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True. * bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int. This default implementation is intended to reduce the workload for subclass implementers. It is not robust in the presence of infinities or NaNs and may have suboptimal performance for other types. * bpo-26680: Adds Rational.is_integer which returns True if the denominator is one. This implementation assumes the Rational is represented in it's lowest form, as required by the class docstring. * bpo-26680: Adds Integral.is_integer which always returns True. * bpo-26680: Adds tests for Fraction.is_integer called as an instance method. The tests for the Rational abstract base class use an unbound method to sidestep the inability to directly instantiate Rational. These tests check that everything works correct as an instance method. * bpo-26680: Updates documentation for Real.is_integer and built-ins int and float. The call x.is_integer() is now listed in the table of operations which apply to all numeric types except complex, with a reference to the full documentation for Real.is_integer(). Mention of is_integer() has been removed from the section 'Additional Methods on Float'. The documentation for Real.is_integer() describes its purpose, and mentions that it should be overridden for performance reasons, or to handle special values like NaN. * bpo-26680: Adds Decimal.is_integer to the Python and C implementations. The C implementation of Decimal already implements and uses mpd_isinteger internally, we just expose the existing function to Python. The Python implementation uses internal conversion to integer using to_integral_value(). In both cases, the corresponding context methods are also implemented. Tests and documentation are included. * bpo-26680: Updates the ACKS file. * bpo-26680: NEWS entries for int, the numeric ABCs and Decimal. Co-authored-by: Robert Smallshire <rob@sixty-north.com>