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
In [1]: import tomlkit
In [2]: tomlkit.loads("[one]\n\n[]")
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-2-f7be5b211081> in <module>
----> 1 tomlkit.loads("[one]\n\n[]")
~/Projects/tomlkit/tomlkit/api.py in loads(string)
32 Alias for parse().
33 """
---> 34 return parse(string)
35
36
~/Projects/tomlkit/tomlkit/api.py in parse(string)
49 Parses a string into a TOMLDocument.
50 """
---> 51 return Parser(string).parse()
52
53
~/Projects/tomlkit/tomlkit/parser.py in parse(self)
158
159 while not self.end():
--> 160 key, value = self._parse_table()
161 if isinstance(value, Table) and value.is_aot_element():
162 # This is just the first table in an AoT. Parse the rest of the array
~/Projects/tomlkit/tomlkit/parser.py in _parse_table(self, parent_name, parent)
1160 else:
1161 if self._current == "[":
-> 1162 is_aot_next, name_next = self._peek_table()
1163
1164 if self._is_child(name, name_next):
~/Projects/tomlkit/tomlkit/parser.py in _peek_table(self)
1221 table_name = self.extract()
1222
-> 1223 return is_aot, table_name
1224
1225 def _parse_aot(self, first, name_first): # type: (Table, str) -> AoT
UnboundLocalError: local variable 'table_name' referenced before assignment
An empty table name by itself results in expected EmptyTableNameError.
The text was updated successfully, but these errors were encountered:
The following file:
[one] []
crashes the parser:
An empty table name by itself results in expected
EmptyTableNameError
.The text was updated successfully, but these errors were encountered: