-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Labels
3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Lines 246 to 257 in ae7f621
if (loader := getattr(package, '__loader__', None)) is None: | |
try: | |
loader = package.__spec__.loader | |
except AttributeError: | |
pass | |
if hasattr(loader, 'get_data'): | |
file_contents = loader.get_data(filename) | |
file_contents = file_contents.decode(encoding) | |
# get_data() opens files as 'rb', so one must do the equivalent | |
# conversion as universal newlines would do. | |
return _newline_convert(file_contents), filename | |
with open(filename, encoding=encoding) as f: |
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error