can not specify newline of a file
Bug #1791945 reported by
Zhan Shiyan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Invalid
|
Undecided
|
Unassigned |
Bug Description
For some reason I need to dump XML files with DOC newline characters.
But I didn't find a way to specify the newline character in lxml library.
I searched the source code and found lxml wrote the file in binary mode and used '\n' as newline character.
So I wonder if there would be some way (or in the future) to specify the newline character.
Python : sys.version_
lxml.etree : (4, 2, 1, 0)
libxml used : (2, 9, 5)
libxml compiled : (2, 9, 5)
libxslt used : (1, 1, 30)
libxslt compiled : (1, 1, 30)
To post a comment you must log in.
It's not clear what you tried, but if you want pretty printing, for example, then you can just add your own line endings to the document. See http:// effbot. org/zone/ element- lib.htm# prettyprint