nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.58k stars 1.47k forks source link

Inifile causes corruption on an ini file #17452

Open lucamanga opened 3 years ago

lucamanga commented 3 years ago

Inifile causes corruption on an ini file. Running nim 1.4.4

Example

import os, parsecfg, streams, strutils

inifile="example.ini"

var dict = loadConfig(inifile)
dict.delSectionKey("cache", "size")
dict.writeConfig(inifile)

Current Output

the ini file is corrupted

lucamanga commented 3 years ago

example.zip

ghost commented 3 years ago

I'm not sure if this is a valid bug - Nim's parsecfg doesn't claim to be able to parse all of the .ini files out there, it claims to support its own format