|
From: Michael F. <fuz...@vo...> - 2007-12-18 16:28:31
|
Frederik Elwert wrote: > Hello! > > I just discovered ConfigObj, and I really like it. But I have one > problem: ConfigObj doesn't put a newline at the end of the files it > writes. So the config file ends immediately after the value of the last > option, with no trailing newline. > > Now I want to edit configuration files for one specific application with > ConfigObj. And this application crashes with this behaviour while > reading the config file. As far as I know, the POSIX standard requires > files to end with newlines, so it seems legitimate for applications to > expect newlines at the end of a file. > > Is this behaviour intended? And is there an easy way to add a final > newline to the file? > Well - there are easy ways to add newlines to files. :-) Newline handling was actually quite tricky as ConfigObj is used to roundtrip files. I also prefer files terminated with a newline but wasn't aware it was part of the POSIX spec. Unless there are any objections I will add code to ensure that files are newline terminated. A side effect is that roundtripped files may gain a newline. Avoiding this would mean storing extra state when reading files and I don't *intend* to jump through those hoops. Michael http://www.manning.com/foord > Thanks, > Frederik > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |