Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass on huge_tree to ncclient #975

Merged
merged 1 commit into from
Nov 14, 2019
Merged

pass on huge_tree to ncclient #975

merged 1 commit into from
Nov 14, 2019

Conversation

vnitinv
Copy link
Contributor

@vnitinv vnitinv commented Nov 14, 2019

with huge_tree we used to get execpetion for big xml

  File "/Users/nitinkr/Coding/ncclient/ncclient/manager.py", line 236, in execute
    huge_tree=self._huge_tree).request(*args, **kwds)
  File "/Users/nitinkr/Coding/ncclient/ncclient/operations/third_party/juniper/rpc.py", line 52, in request
    return self._request(rpc)
  File "/Users/nitinkr/Coding/ncclient/ncclient/operations/rpc.py", line 338, in _request
    self._reply.parse()
  File "/Users/nitinkr/Coding/ncclient/ncclient/operations/rpc.py", line 148, in parse
    root = self._root = to_ele(self._raw, huge_tree=self._huge_tree) # The <rpc-reply> element
  File "/Users/nitinkr/Coding/ncclient/ncclient/xml_.py", line 124, in to_ele
    return x if etree.iselement(x) else etree.fromstring(x.encode('UTF-8'), parser=_get_parser(huge_tree))
  File "src/lxml/etree.pyx", line 3222, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1765, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc
  File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
  File "<string>", line 105629
lxml.etree.XMLSyntaxError: xmlSAX2Characters: huge text node, line 105629, column 

@coveralls
Copy link

coveralls commented Nov 14, 2019

Coverage Status

Coverage increased (+0.01%) to 94.926% when pulling c6145cd on vnitinv:huge_tree into fdd6fdc on Juniper:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 94.856% when pulling c6145cd on vnitinv:huge_tree into fdd6fdc on Juniper:master.

@vnitinv
Copy link
Contributor Author

vnitinv commented Nov 14, 2019

Fix ncclient/ncclient#356

Copy link
Collaborator

@dineshbaburam91 dineshbaburam91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@vnitinv
Copy link
Contributor Author

vnitinv commented Nov 14, 2019

usage:

with Device(host=....., huge_tree=True) as dev:
    ----

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants