Skip to content

Parsing fails if Windows style CRLF line endings are used #12

@knyri

Description

@knyri

First off: this is excellent and has saved me a lot of time. Thank you for making it and making it public.

I came across this issue when making the linux equivalent of an existing windows installer.

Works fine after converting the CRLF to LF. This is on Ubuntu 16.04.

My guess is that read only looks for LF and the trailing CR is causing it to fail the section regex test.

Example INI:

[smtp]
host=example.com
port=25
authentication=true
use_tls=true
from_email=ex@example.com
username=ex
password=expass

Save it with CRLF line endings and read_ini setup.ini -p setup -b 0 will fail with

Error: Invalid line:
1: [smtp]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions