Categories
Network Automation

Junos PyEZ how to fix the xmlSAX2Characters:huge text node

When trying to acquire a huge bit of config from juniper routers and parse it with PyEZ sometimes you get an error. Something like:

pyez xmlSAX2Characters: huge text node, line 256071, column 53 (<string>, line 256071)

PyEZ uses ncclient the python netconf client behind the scenes.It isn’t well documented in their docs though.

Allowing a huge text nodes in pyEZ, you should connect to your device and pass the huge_tree=True parameter:

with Device(host='x.x.x.x', user=junos_username, passwd=junos_password, huge_tree=True) as dev:
    ...

https://github.com/Juniper/py-junos-eznc/pull/975