-
-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Description
I found that I could no longer install atlassian-python-api via Poetry (python-poetry/poetry#4278).
Tracked it down to quoting on the table name, created a PR for that: atlassian-api/atlassian-python-api#819.
Not entirely sure what TOML Kit should do here since I am not sure if it is valid TOML or not.
Repro from the Poetry issue:
In [1]: from tomlkit.toml_file import TOMLFile
In [2]: file = TOMLFile('pyproject.toml')
In [3]: content = file.read()
In [4]: content['tool']
---------------------------------------------------------------------------
KeyAlreadyPresent Traceback (most recent call last)
<ipython-input-4-e3abb1390203> in <module>
----> 1 content['tool']
~/.pyenv/versions/3.9.6/envs/pyperf/lib/python3.9/site-packages/tomlkit/container.py in __getitem__(self, key)
557 # so we need a proxy to retrieve the proper objects
558 # from the parent container
--> 559 return OutOfOrderTableProxy(self, idx)
560
561 item = self._body[idx][1]
~/.pyenv/versions/3.9.6/envs/pyperf/lib/python3.9/site-packages/tomlkit/container.py in __init__(self, container, indices)
697 table_idx = len(self._tables) - 1
698 for k, v in item.value.body:
--> 699 self._internal_container.append(k, v)
700 self._tables_map[k] = table_idx
701 if k is not None:
~/.pyenv/versions/3.9.6/envs/pyperf/lib/python3.9/site-packages/tomlkit/container.py in append(self, key, item)
167
168 for k, v in item.value.body:
--> 169 current.append(k, v)
170
171 return self
~/.pyenv/versions/3.9.6/envs/pyperf/lib/python3.9/site-packages/tomlkit/items.py in append(self, key, _item)
920 _item = item(_item)
921
--> 922 self._value.append(key, _item)
923
924 if isinstance(key, Key):
~/.pyenv/versions/3.9.6/envs/pyperf/lib/python3.9/site-packages/tomlkit/container.py in append(self, key, item)
173 raise TOMLKitError("Redefinition of an existing table")
174 elif not item.is_super_table():
--> 175 raise KeyAlreadyPresent(key)
176 elif isinstance(item, AoT):
177 if not isinstance(current, AoT):
KeyAlreadyPresent: Key "REPORTS" already exists.
Metadata
Metadata
Assignees
Labels
No labels