cpython/Lib
Nathaniel J. Smith 925dc7fb1d
bpo-39606: allow closing async generators that are already closed (GH-18475)
The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a
agen.aclose() coroutine object. It accidentally also prevented you
from calling aclose() at all on an async generator that was already
closed or exhausted. This commit fixes it so we're only blocking the
actually illegal cases, while allowing the legal cases.

The new tests failed before this patch. Also confirmed that this fixes
the test failures we were seeing in Trio with Python dev builds:
  https://github.com/python-trio/trio/pull/1396


https://bugs.python.org/issue39606
2020-02-13 00:15:38 -08:00
..
asyncio bpo-34793: Drop old-style context managers in asyncio.locks (GH-17533) 2020-02-01 13:12:52 +02:00
collections bpo-36321: Fix misspelled attribute name in namedtuple() (GH-16858) 2019-10-20 10:19:47 -07:00
concurrent bpo-39349: Add *cancel_futures* to Executor.shutdown() (GH-18057) 2020-02-02 13:49:00 +01:00
ctypes bpo-16575: Disabled checks for union types being passed by value. (GH-17960) 2020-01-12 08:54:00 +00:00
curses [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620) 2019-06-05 18:22:31 +03:00
dbm
distutils bpo-39586: Deprecate distutils bdist_msi command (GH-18415) 2020-02-10 14:26:40 +01:00
email bpo-38708: email: Fix a potential IndexError when parsing Message-ID (GH-17504) 2019-12-08 17:37:34 -08:00
encodings bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (#17418) 2019-12-02 14:25:21 -08:00
ensurepip bpo-37449: Move ensurepip off of pkgutil and to importlib.resources (GH-15109) 2019-09-13 09:01:20 -07:00
html bpo-37328: remove deprecated HTMLParser.unescape (GH-14186) 2019-08-27 11:48:06 +09:00
http bpo-35292: Avoid calling mimetypes.init when http.server is imported (GH-17822) 2020-01-08 10:28:14 -08:00
idlelib bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449) 2020-02-10 20:08:58 -05:00
importlib bpo-39595: Improve zipfile.Path performance (#18406) 2020-02-11 21:58:47 -05:00
json bpo-39377: json: Remove the encoding option. (GH-18075) 2020-01-20 13:54:00 +09:00
lib2to3 bpo-39313: Add an option to RefactoringTool for using exec as a function (GH-17967) 2020-01-12 14:13:31 -08:00
logging bpo-39292: Add missing syslog facility codes. (GH-17945) 2020-01-10 19:37:48 +00:00
msilib Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
multiprocessing bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158) 2020-01-28 21:34:23 +11:00
pydoc_data Python 3.9.0a3 2020-01-24 22:05:07 +01:00
site-packages
sqlite3 bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190) 2019-09-17 09:20:56 +03:00
test bpo-39606: allow closing async generators that are already closed (GH-18475) 2020-02-13 00:15:38 -08:00
tkinter bpo-39152: add missing ttk.Scale.configure return value (GH-17815) 2020-01-05 11:23:58 -05:00
turtledemo Mark files as executable that are meant as scripts. (GH-15354) 2019-09-09 07:16:33 -07:00
unittest bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175) 2020-02-03 07:06:50 +00:00
urllib bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619) 2020-01-05 14:14:31 +02:00
venv bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290) 2020-02-05 08:16:58 +00:00
wsgiref bpo-8138: Initialize wsgiref's SimpleServer as single-threaded (GH-12977) 2019-05-24 20:24:42 +03:00
xml bpo-20928: support base-URL and recursive includes in etree.ElementInclude (#5723) 2019-11-25 16:36:25 +01:00
xmlrpc bpo-38786: Add parsing of https links to pydoc (GH-17143) 2019-11-13 18:13:52 +02:00
__future__.py
__phello__.foo.py
_aix_support.py bpo-38021: Modify AIX platform_tag so it covers PEP 425 needs (GH-17303) 2019-12-16 00:17:53 +10:00
_bootlocale.py
_collections_abc.py bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
_compat_pickle.py bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131) 2019-08-25 23:45:40 +10:00
_compression.py
_markupbase.py
_osx_support.py
_py_abc.py bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
_pydecimal.py
_pyio.py closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17112) 2019-11-12 14:51:34 -08:00
_sitebuiltins.py
_strptime.py Fix outdated comment in _strptime.py (GH-17929) 2020-01-12 12:53:00 -08:00
_threading_local.py bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
_weakrefset.py
abc.py
aifc.py bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169) 2019-06-18 00:00:24 +02:00
antigravity.py
argparse.py Defer import of shutil which only needed for help and usage (GH-17334) 2019-11-21 22:51:45 -08:00
ast.py bpo-39158: ast.literal_eval() doesn't support empty sets (GH-17742) 2020-01-02 22:21:18 -07:00
asynchat.py Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
asyncore.py bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621) 2019-09-01 12:12:52 +03:00
base64.py bpo-39351: Remove base64.encodestring() (GH-18022) 2020-01-16 10:24:16 +01:00
bdb.py Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
binhex.py bpo-39353: binascii.crc_hqx() is no longer deprecated (GH-18276) 2020-01-30 09:56:40 +01:00
bisect.py bpo-38626: Add comment explaining why __lt__ is used. (GH-16978) 2019-10-28 21:38:50 -07:00
bz2.py bpo-39357: Update bz2 docstring: remove buffering (GH-18036) 2020-01-17 13:50:39 +01:00
cProfile.py [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620) 2019-06-05 18:22:31 +03:00
calendar.py bpo-28292: Mark calendar.py helper functions as private. (GH-15113) 2019-08-04 13:14:03 -07:00
cgi.py bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (#10638) 2019-09-11 12:05:53 +01:00
cgitb.py
chunk.py
cmd.py
code.py Fix documentation in code.py (GH-17988) 2020-01-15 01:17:25 +05:30
codecs.py bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278) 2019-05-31 22:44:00 +03:00
codeop.py bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py (GH-13135) 2019-12-06 06:27:38 -08:00
colorsys.py
compileall.py bpo-38470: Fix test_compileall.test_compile_dir_maxlevels() (GH-16789) 2019-10-15 11:26:13 +02:00
configparser.py
contextlib.py [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620) 2019-06-05 18:22:31 +03:00
contextvars.py
copy.py bpo-38293: Allow shallow and deep copying of property objects (GH-16438) 2020-01-12 09:41:49 -08:00
copyreg.py
crypt.py closes bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599) 2019-10-07 21:22:17 -07:00
csv.py
dataclasses.py bpo-34776: Fix dataclasses to support __future__ "annotations" mode (#9518) 2019-12-09 15:54:20 +01:00
datetime.py bpo-38155: Add __all__ to datetime module (GH-16203) 2019-09-19 14:34:41 +01:00
decimal.py
difflib.py bpo-38738: Fix formatting of True and False. (GH-17083) 2019-11-12 16:57:03 +02:00
dis.py bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) 2019-09-28 07:49:15 -07:00
doctest.py bpo-36406: Handle namespace packages in doctest (GH-12520) 2019-12-13 10:06:53 -08:00
enum.py bpo-38045: Improve the performance of _decompose() in enum.py (GH-16483) 2019-11-26 14:36:02 -08:00
filecmp.py Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
fileinput.py bpo-37330: open() no longer accept 'U' in file mode (GH-16959) 2019-10-28 15:40:08 +01:00
fnmatch.py
formatter.py
fractions.py bpo-39350: Fix fractions for int subclasses (GH-18375) 2020-02-07 23:42:51 +01:00
ftplib.py bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959) 2020-01-13 20:34:34 +01:00
functools.py bpo-17005: Add a class to perform topological sorting to the standard library (GH-11583) 2020-01-23 15:29:52 +00:00
genericpath.py bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (#17160) 2019-11-18 21:54:00 -08:00
getopt.py
getpass.py Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
gettext.py
glob.py bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360) 2020-02-06 10:26:37 +02:00
gzip.py bpo-39389: gzip: fix compression level metadata (GH-18077) 2020-01-21 13:25:24 +02:00
hashlib.py bpo-38153: Normalize hashlib algorithm names (GH-16083) 2019-09-13 14:31:19 +01:00
heapq.py bpo-29984: Improve 'heapq' test coverage (GH-992) 2019-05-31 21:13:57 -07:00
hmac.py bpo-33604: Raise TypeError on missing hmac arg. (GH-16805) 2019-10-17 20:30:42 -07:00
imaplib.py bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203) 2020-01-07 18:28:10 +01:00
imghdr.py
imp.py bpo-37330: open() no longer accept 'U' in file mode (GH-16959) 2019-10-28 15:40:08 +01:00
inspect.py bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412) 2020-01-28 21:47:03 +09:00
io.py
ipaddress.py bpo-32820: Simplify __format__ implementation for ipaddress. (GH-16378) 2019-09-27 20:02:58 +03:00
keyword.py
linecache.py Fix linecache.py add lazycache to __all__ and use dict.clear to clear the cache (GH-4641) 2020-01-25 21:07:40 -05:00
locale.py bpo-38536: locale: Remove trailing space in formatted currency (GH-16864) 2020-01-20 12:45:50 +09:00
lzma.py
mailbox.py
mailcap.py
mimetypes.py bpo-39299: Add more tests for mimetypes and its cli. (GH-17949) 2020-01-13 20:09:36 +05:30
modulefinder.py
netrc.py
nntplib.py bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035) 2020-01-23 00:59:43 +03:00
ntpath.py bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967) 2019-11-15 09:49:21 -08:00
nturl2path.py
numbers.py
opcode.py bpo-39320: Handle unpacking of **values in compiler (GH-18141) 2020-01-27 09:57:45 +00:00
operator.py bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
optparse.py
os.py bpo-39567: Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob(). (GH-18372) 2020-02-12 12:11:34 +02:00
pathlib.py bpo-39567: Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob(). (GH-18372) 2020-02-12 12:11:34 +02:00
pdb.py bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127) 2019-11-12 14:42:47 -08:00
pickle.py bpo-39426: Fix outdated default and highest protocols in docs (GH-18154) 2020-01-24 02:03:22 -08:00
pickletools.py
pipes.py
pkgutil.py
platform.py bpo-35389: platform.platform() calls libc_ver() without executable (GH-14418) 2019-06-27 09:04:28 +02:00
plistlib.py bpo-36409: Remove old plistlib API deprecated in 3.4 (GH-15615) 2019-09-05 10:11:35 +02:00
poplib.py bpo-39259: poplib now rejects timeout = 0 (GH-17912) 2020-01-10 15:34:05 +01:00
posixpath.py
pprint.py bpo-37376: pprint support for SimpleNamespace (GH-14318) 2019-06-26 16:13:18 -07:00
profile.py [3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620) 2019-06-05 18:22:31 +03:00
pstats.py bpo-37958: Adding get_profile_dict to pstats (GH-15495) 2020-01-15 14:51:54 -08:00
pty.py bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824) 2020-02-05 11:15:00 +11:00
py_compile.py
pyclbr.py Fix typos in docs and docstrings (GH-13745) 2019-06-03 01:12:33 +02:00
pydoc.py bpo-21016: pydoc and trace use sysconfig (GH-18476) 2020-02-12 13:02:29 +01:00
queue.py bpo-37394: Fix pure Python implementation of the queue module (GH-14351) 2019-06-25 02:53:30 +01:00
quopri.py bpo-15999: Clean up of handling boolean arguments. (GH-15610) 2019-09-01 12:16:51 +03:00
random.py bpo-38881: choices() raises ValueError when all weights are zero (GH-17362) 2019-11-23 02:22:13 -08:00
re.py bpo-36548: Improve the repr of re flags. (GH-12715) 2019-05-31 10:39:47 +03:00
reprlib.py
rlcompleter.py
runpy.py bpo-38722: Runpy use io.open_code() (GH-17234) 2019-11-18 11:11:13 -08:00
sched.py
secrets.py
selectors.py
shelve.py
shlex.py Add docstring for shlex.split (GH-16740) 2019-10-31 10:23:20 +00:00
shutil.py bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407) 2020-02-13 07:47:42 +00:00
signal.py
site.py Fix typo in site module (GH-17597) 2019-12-14 10:37:58 +00:00
smtpd.py bpo-35800: Deprecate smtpd.MailmanProxy (GH-11675) 2019-10-12 10:24:26 -07:00
smtplib.py bpo-39329: Add timeout parameter for smtplib.LMTP constructor (GH-17998) 2020-01-14 22:42:09 +01:00
sndhdr.py
socket.py Fix host in address of socket.create_server example. (GH-17706) 2020-01-11 10:46:30 +05:30
socketserver.py Fix typo in Lib/socketserver.py (GH-17024) 2019-11-16 19:14:45 +01:00
sre_compile.py
sre_constants.py
sre_parse.py bpo-37723: Fix performance regression on regular expression parsing. (GH-15030) 2019-07-31 21:50:39 +03:00
ssl.py bpo-37463: match_hostname requires quad-dotted IPv4 (GH-14499) 2019-07-02 11:39:42 -07:00
stat.py bpo-38109: Add missing constants to Lib/stat.py (GH-16665) 2019-10-10 09:34:46 +02:00
statistics.py bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111) 2019-11-11 23:35:06 -08:00
string.py bpo-38208: Simplify string.Template by using __init_subclass__(). (GH-16256) 2019-10-21 09:36:21 +03:00
stringprep.py
struct.py
subprocess.py bpo-39489: Remove COUNT_ALLOCS special build (GH-18259) 2020-02-03 15:17:15 +01:00
sunau.py bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169) 2019-06-18 00:00:24 +02:00
symbol.py
symtable.py
sysconfig.py bpo-38021: Modify AIX platform_tag so it covers PEP 425 needs (GH-17303) 2019-12-16 00:17:53 +10:00
tabnanny.py
tarfile.py bpo-18819: tarfile: only set device fields for device files (GH-18080) 2020-02-12 11:56:02 -08:00
telnetlib.py bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
tempfile.py bpo-39019: Implement missing __class_getitem__ for SpooledTemporaryFile (GH-17560) 2019-12-30 16:08:08 +00:00
textwrap.py bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469) 2019-06-29 21:20:03 -07:00
this.py
threading.py bpo-15999: Clean up of handling boolean arguments. (GH-15610) 2019-09-01 12:16:51 +03:00
timeit.py
token.py
tokenize.py bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686) 2019-05-30 15:06:32 -07:00
trace.py bpo-21016: pydoc and trace use sysconfig (GH-18476) 2020-02-12 13:02:29 +01:00
traceback.py bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952) 2019-08-08 08:42:54 +03:00
tracemalloc.py bpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545) 2019-10-15 14:00:16 +02:00
tty.py
turtle.py Fix typos in docs and docstrings (GH-13745) 2019-06-03 01:12:33 +02:00
types.py
typing.py bpo-39491: Mention Annotated in get_origin() docstring (GH-18379) 2020-02-06 17:15:12 -08:00
uu.py bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (#17418) 2019-12-02 14:25:21 -08:00
uuid.py bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369) 2020-02-05 22:43:09 +02:00
warnings.py bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618) 2020-01-05 14:15:27 +02:00
wave.py Fix a typo in wave module docstring (GH-17009) 2019-11-04 22:32:10 -06:00
weakref.py bpo-38761: Register WeakSet as a MutableSet (GH-17104) 2019-11-10 20:12:04 -08:00
webbrowser.py Fix typo from base to based (GH-18055) 2020-01-19 05:29:42 -05:00
xdrlib.py
zipapp.py
zipfile.py bpo-39595: Improve zipfile.Path performance (#18406) 2020-02-11 21:58:47 -05:00
zipimport.py bpo-39033: Fix NameError in zipimport during hash validation (GH-17588) 2019-12-16 09:34:12 +10:00