Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejects table name consisting of an empty string #258

Closed
ghost opened this issue Jan 23, 2023 · 0 comments · Fixed by #265
Closed

Rejects table name consisting of an empty string #258

ghost opened this issue Jan 23, 2023 · 0 comments · Fixed by #265

Comments

@ghost
Copy link

ghost commented Jan 23, 2023

The tomlkit parser rejects the following valid TOML document:

['']
x = 1

The parser raises an exception:

tomlkit.exceptions.EmptyTableNameError: Empty table name at line 1 col 3

The TOML 1.0.0 spec says about table names:

Naming rules for tables are the same as for keys (see definition of Keys above).

and about keys:

A bare key must be non-empty, but an empty quoted key is allowed (though discouraged).

From these statements, it follows that an empty quoted key is a valid table name.

This testcase is part of toml-test: https://github.com/BurntSushi/toml-test/blob/master/tests/valid/table/empty-name.toml

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 a pull request may close this issue.

0 participants