[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

bpo-40260: revert refactor of file_info tuple by barry-scott · Pull Request #19595 · python/cpython

barry-scott

and others added 6 commits

April 12, 2020 18:23
by passing in an fp that is opened in "rb".

This fixes problems seen on Windows where the source code is not
decoded as utf-8 but as the code page default for the user, cp1252
for example.

Add three new tests to test_modulefinder.py to excercise
the decoding of source code.

Always write the test source as bytes to avoid using
locale.getpreferredencoding() as the encoding.

test_coding_default_utf8 - designed to fail if decoded with cp1252
test_coding_explicit_utf8 - designed to fail if decoded with cp1252
test_coding_explicit_cp1252 - designed to fail if decoded with utf-8

Remove the mode in file_info that is usused.

Debian relies on the subclassing ModuleFinder
and load_module call to access info in the file_info
tuple.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Apr 20, 2020

(cherry picked from commit 9b0b5d2)

Co-authored-by: Barry <barry@barrys-emacs.org>

miss-islington added a commit that referenced this pull request

Apr 20, 2020

(cherry picked from commit 9b0b5d2)

Co-authored-by: Barry <barry@barrys-emacs.org>