You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#149 introduced a regression especially for Windows users. If your toml file contains only windows line endings ("\r\n"), you may get mixed line endings when you read, change and write the toml file.
Example:
toml_path = str(tmpdir / "pyproject.toml")
with open(toml_path, "wb+") as f:
f.write(b"a = 1\r\nb = 2\r\n")
f = TOMLFile(toml_path)
content = f.read()
content["c"] = 3
f.write(content)
with open(toml_path, "rb") as f:
print(f.read())
Output: b'a = 1\r\nb = 2\r\nc = 3\n' (the last line ending is "\n" instead of "\r\n")
The text was updated successfully, but these errors were encountered:
#149 introduced a regression especially for Windows users. If your toml file contains only windows line endings (
"\r\n"
), you may get mixed line endings when you read, change and write the toml file.Example:
Output:
b'a = 1\r\nb = 2\r\nc = 3\n'
(the last line ending is"\n"
instead of"\r\n"
)The text was updated successfully, but these errors were encountered: