doc8 reports unnecessary D002 and D004 on Windows line ending

Bug #1756704 reported by Lex Li
This bug affects 12 people
Affects Status Importance Assigned to Milestone

Bug Description

It seems that such warnings come from Windows line ending `\r\n`,

'D002 Trailing whitespace'
'D004 Found literal carriage return'

doc8 should properly handle Windows line endings and do not report on such, because not all text files are of UNIX/Linux line ending `\n`.

(Linked to reStructuredText extension for VSCode

Lex Li (lextm)
affects: manila → python-doc8 (Ubuntu)
description: updated
affects: python-doc8 (Ubuntu) → doc8
Lex Li (lextm)
description: updated
Revision history for this message
Mateusz Łoskot (mloskot) wrote :

I confirm this issue.

Revision history for this message
Laurent Garcin (laurent-garcin) wrote :

I also confirm this issue.

Revision history for this message
Rebecca Heineman (becky-e) wrote :

I confirm this issue. It's very troublesome since I do development primarily on a Windows box and all my text files are CR/LF (Although when I check out my files on macOS or Linux they are LF only), but this is quite annoying, especially in Visual Studio Code.

Revision history for this message
Deepak Maram (mskdeepak) wrote :

I can confirm this issue.

Changed in doc8:
status: New → Confirmed
Revision history for this message
Carlos Eduardo (silvacarlose) wrote :

I am also able to confirm this issue. I've worked it around in the following way:

1) Installed a linux subsystem in my Windows machine
2) Installed dos2unix
3) Ran dos2unix in ever single file I was having this issue

When I executed the docs generate command again all the issues disappeared.

More rerefence for docs2unix usage:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers