classification
Title: doctest fails if you have inconsistent lineendings
Type: Stage: commit review
Components: Library (Lib) Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, lregebro, terry.reedy
Priority: normal Keywords: patch

Created on 2010-04-20 16:40 by lregebro, last changed 2012-01-14 01:29 by terry.reedy.

Files
File name Uploaded Description Edit
doctest_lineendings.patch lregebro, 2010-04-20 16:40 review
Messages (5)
msg103735 - (view) Author: Lennart Regebro (lregebro) Date: 2010-04-20 16:40
If the doctest file has both Windows and unix lineendings you get an error. Yeah, I know, it's not a serious bug, but it's also easy to fix.

Attached patch with test. Seems to not be an issue on Python 3.
msg106737 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-05-29 20:38
Looks good to me. Is there’s no disagreement on this being a bug fix rather than a new feature, it could go before the rc.
msg112905 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-04 21:48
I would call this a bug and still 2.7 eligible. The patch amounts to opening the file to be tested in universal newline mode + a corresponding test. If Python will run files with mixed line endings, doctest should test them.
msg148279 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-24 16:41
The string in the test does not have mixed line endings, and the accompanying comment talks about testing files with CRLF on Unix.

Terry, do you want to (update and) commit this?
msg151211 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-01-14 01:29
By 'update', do you mean to change

+Due to the way releases are made on different platforms, we sometimes test
+files on a *nix system with Windows file endings. Unfortunately, that leaves
+some of the test files broken:

to something like

+Issue8473: Make sure doctest works with mixed line endings.
+When this test is run on *nix, it has the side effect of making sure
+that doctest can handle Windows line endings on *nix.

Or just leave the last two lines off?

And also change '/r/n/r/n' x 2 to '/r/n/n' and '/n/r/n'.
History
Date User Action Args
2012-01-14 01:29:47terry.reedysetmessages: + msg151211
2011-11-24 16:41:30eric.araujosetmessages: + msg148279
2010-08-04 21:48:02terry.reedysetversions: - Python 2.6, Python 2.5
nosy: + terry.reedy

messages: + msg112905

stage: commit review
2010-05-29 20:38:54eric.araujosetpriority: normal
2010-05-29 20:38:27eric.araujosetpriority: normal -> (no value)

nosy: + eric.araujo
messages: + msg106737

components: + Library (Lib), - Extension Modules, Tests
2010-04-20 16:40:16lregebrocreate