toml icon indicating copy to clipboard operation
toml copied to clipboard

Line ending backslash not trimming at start of multi-line string

Open epage opened this issue 7 years ago • 3 comments

toml: 0.9.3.1

I've narrowed down my reproduction case to this

command = [
   """\
      --arg=var"""
]

This produces the following error:

  File "p:\ops\staging\talos\master\objects\venv\talos\lib\site-packages\toml.py", line 373, in loads
    multibackslash)
  File "p:\ops\staging\talos\master\objects\venv\talos\lib\site-packages\toml.py", line 454, in _load_line
    raise TomlDecodeError("Invalid date or number")
toml.TomlDecodeError: Invalid date or number

epage avatar Jan 25 '18 18:01 epage

Duplicate of #91 .

gaborbernat avatar Jan 25 '18 23:01 gaborbernat

Hi Ed,

Thank you for reporting this issue.

~Can you confirm that it was resolved by 1b5bb9e (which fixed #91) ?~ Not sure what that issue has to do with this one, actually.

uiri avatar Jun 30 '18 20:06 uiri

Hi Ed,

It looks like this is fixed - or rather, your test case no longer produces a TomlDecodeError.

I get the following output: {'command': [' --arg=var']}

According to the spec, the line ending backslash should lead to the parser trimming the leading whitespace so I am leaving this issue open.

uiri avatar Sep 09 '18 02:09 uiri