Skip to content

Fix CRLF recovery after invalid dotenv statements - #722

Open
widechaos wants to merge 1 commit into
theskumar:mainfrom
widechaos:fix-parser-crlf-recovery
Open

widechaos wants to merge 1 commit into
theskumar:mainfrom
widechaos:fix-parser-crlf-recovery

Conversation

@widechaos

Copy link
Copy Markdown

Parsing a CRLF stream after a malformed statement consumes only the carriage return. The leftover newline is then attached to the next binding and counted again, shifting subsequent warning line numbers.

Consume CRLF as a single newline during error recovery, just as the normal parser path already does. Added a regression with two malformed lines separated by valid bindings, covering LF, CR and CRLF.

Validation: the regression fails on the original parser for CRLF; all 291 tests and the tox lint environment pass with the fix.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant