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

Regression: impossible to dump multiline strings with leading newline

Aberta
#655 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@shivampwm2020 já está trabalhando nisso.

Desde 14/10/2026.

  • #656 de @shivampwm2020 — aberto

Avaliação

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

Direção de pesquisa

Start with the reproduction: tomlkit.string(...) with escape=False passed to tomlkit.dumps, comparing the output with and without the leading newline. The behaviour change came from pull request #551, and open pull request #656 already proposes moving it under the escape flag, so read that diff first. Done means the aligned-strings example dumps without the extra newline, and the maintainers have agreed on the fix since #656 is still open.

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

Descrição

Pull request #551 changed the behaviour of raw, non-escaped string values. Running

import tomlkit
s = tomlkit.string(
  "\n  aligned\n  strings\n",
  multiline=True,
  literal=True,
  escape=False,
)
print(tomlkit.dumps(s))

used to output

'''
  aligned
  strings
'''

as expected, but now outputs

'''

  aligned
  strings
'''

(note the extra newline). In fact, it is now impossible to produce the desired output.

Proposed fix: hide the behaviour change of #551 under the escape flag.

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.