This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author trey
Recipients trey
Date 2020-11-13.20:00:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605297630.46.0.898037335486.issue42354@roundup.psfhosted.org>
In-reply-to
Content
The below code worked on Python 3.5, 3.6, 3.7, and 3.8, but it now crashes on Python 3.9.


from contextlib import contextmanager


@contextmanager
def open_files(names):
    yield names  # This would actually return file objects


with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
    print(first, rest)


The error shown is:

    with open_files(['file1.txt', 'file2.txt']) as (first, *rest):
                                                                 ^
SyntaxError: invalid syntax
History
Date User Action Args
2020-11-13 20:00:30treysetrecipients: + trey
2020-11-13 20:00:30treysetmessageid: <1605297630.46.0.898037335486.issue42354@roundup.psfhosted.org>
2020-11-13 20:00:30treylinkissue42354 messages
2020-11-13 20:00:30treycreate