Deleting the last key under a dotted key in an inline table produces invalid TOML
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 62/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 862
- Forks
- 193
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 25
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-poetry/tomlkit
-
Speed up array appendsEvtl. vergeben @harshitgupta31415 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 42/100
python-poetry/tomlkit#665 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
AttributeError on an out-of-order table under an indented header (4+ levels)Evtl. vergeben @cig13zs hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 18/100
python-poetry/tomlkit#661 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Regression: impossible to dump multiline strings with leading newlineEvtl. vergeben @shivampwm2020 hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
python-poetry/tomlkit#655 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
In-place array repetition changes values without updating serialized TOMLEvtl. vergeben @harbinresearcher hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
python-poetry/tomlkit#646 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
tomlkit 0.15.1 fails on out-of-order table headerEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
python-poetry/tomlkit#632 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in python-poetry/tomlkit
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
EchoTools/nevr-runtime#651 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug frontend rt sev-3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
noontide-co/mainbranch#1211 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adaptersOffentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
dbt-labs/dbt#16784 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag