Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Deleting the last key under a dotted key in an inline table produces invalid TOML

Aberta
#662 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@cig13zs já está trabalhando nisso.

Desde 15/10/2026.

  • #664 de @cig13zs — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
62/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
data

Direção de pesquisa

Start by running the reproduction in the issue: tomlkit.parse on an inline table with a dotted key, then del of the inner key, then tomlkit.dumps, and check the result with tomllib.loads. The payload does not name the source file, so find where deletion from an inline table removes the item and its separating comma. Done when the output parses as valid TOML, keeps b as an empty inline table in the middle case, and the leading, trailing and sole-key cases also produce valid output.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

d = tomlkit.parse('t = {a="", b.c=1, d=1}\n'); del d["t"]["b"]["c"]; tomlkit.dumps(d) returns 't = {a="", , d=1}\n'.
tomllib.loads rejects that output ("Invalid initial character for a key part"). Expected valid TOML that still holds b as an empty table, e.g. t = {a="", b = {}, d=1}.
If b.c is the last key you get a trailing comma ({a = 1, }), if it is the first a leading one ({, a = 1}), and if it is the only key the output is {} and b is gone.

Linguagem predominante
Python
Estrelas
862
Forks
193
Merge médio
4d 2h
PRs com merge (30d)
25

Preparar o ambiente

  • Sem Dockerfile nem arquivo Docker Compose
  • Tem um modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python-poetry/tomlkit

Todas as issues de python-poetry/tomlkit

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.