Fix parsing of variable without a value by bbc2 · Pull Request #158 · theskumar/python-dotenv

@bbc2

In Python, `\s` also matches newlines.  This would cause newlines to be
consumed by the equal sign matcher, resulting in the next line being
considered as a value.

For instance, the following would be parsed as `[("FOO", "BAR=b")]`
instead of [("FOO", ""), ("BAR", "b")].

```bash
FOO=
BAR=b
```

Fixes theskumar#157.

@bbc2 bbc2 deleted the fix-empty-var-bug branch

December 23, 2018 17:32

johnbergvall pushed a commit to johnbergvall/python-dotenv that referenced this pull request

Aug 13, 2021
In Python, `\s` also matches newlines.  This would cause newlines to be
consumed by the equal sign matcher, resulting in the next line being
considered as a value.

For instance, the following would be parsed as `[("FOO", "BAR=b")]`
instead of [("FOO", ""), ("BAR", "b")].

```bash
FOO=
BAR=b
```

Fixes theskumar#157.