]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 26 Mar 2020 16:18:55 +0000 (09:18 -0700)
committerGitHub <noreply@github.com>
Thu, 26 Mar 2020 16:18:55 +0000 (09:18 -0700)
commit9387678f8a580726aca5f836b2c50456f236ecbb
treeb0f857772644f80be638a2f9462beb61891f79e8
parentea0eeb8d3a0544334f8836c98a761b2e3df2bd94
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385)

This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method.
(cherry picked from commit e0b8101492f6c61dee831425b4d3dae39a953599)

Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
Lib/doctest.py
Lib/test/test_doctest.py
Misc/ACKS
Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst [new file with mode: 0644]