Library is not parsing input when it contains \n, \r
We are using the version 2.9.1-6.0.3.el7_9.6 in python2 While using the function parseDoc, the following error is being reported:
File "/usr/lib64/python2.7/site-packages/libxml2.py", line 1325, in parseDoc
if ret is None:raise parserError('xmlParseDoc() failed')
Then only line in input that is producing this error is:
<field name="sip.msg_hdr" showname="Message Header" size="585" pos="77" show="Call-ID: c3eF6f58-363323Cd-8058EB88-10307533@192.168.1.37
CSeq: 130 BYE
From: <sip:4321@192.168.1.37>;tag=a3bhg
Supported: 100rel
To: <sip:1234@192.168.1.87>;tag=a3bhg
Via: SIP/2.0/UDP 192.168.1.37:5060;branch=z9hG4bKkdjuw3107
P-Asserted-Identity: <sip:4321@192.168.1.37;user=phone>
Valid8-Profile: Valid8-UAE
Remote-Party-ID: <sip:4321@192.168.1.37;user=phone>;party=calling;id-type=subscriber;screen=no
Max-Forwards: 70
Allow: INVITE, ACK, BYE, CANCEL, REFER, OPTIONS, REGISTER, SUBSCRIBE
Content-Type: application/ISUP; version=itu-t; base=itu-t92+
Content-Length: 8
" value="43616c6c2d49443a2063336546366635382d33363333323343642d38303538454238382d3130333037353333403139322e3136382e312e33370d0a435365713a20313330204259450d0a46726f6d3a203c7369703a34333231403139322e3136382e312e33373e3b7461673d61336268670d0a537570706f727465643a2031303072656c0d0a546f3a203c7369703a31323334403139322e3136382e312e38373e3b7461673d61336268670d0a5669613a205349502f322e302f554450203139322e3136382e312e33373a353036303b6272616e63683d7a39684734624b6b646a7577333130370d0a502d41737365727465642d4964656e746974793a203c7369703a34333231403139322e3136382e312e33373b757365723d70686f6e653e0d0a56616c6964382d50726f66696c653a2056616c6964382d5541450d0a52656d6f74652d50617274792d49443a203c7369703a34333231403139322e3136382e312e33373b757365723d70686f6e653e3b70617274793d63616c6c696e673b69642d747970653d737562736372696265723b73637265656e3d6e6f0d0a4d61782d466f7277617264733a2037300d0a416c6c6f773a20494e564954452c2041434b2c204259452c2043414e43454c2c2052454645522c204f5054494f4e532c2052454749535445522c205355425343524942450d0a436f6e74656e742d547970653a206170706c69636174696f6e2f495355503b2076657273696f6e3d6974752d743b20626173653d6974752d7439322b0d0a436f6e74656e742d4c656e6774683a20380d0a0d0a">
....
</field>
That is, the lines in the attribute show have \n, \r in them - Where the parser is throwing the beforementioned error.