Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77255
| References | <53FF9808.5040403@enabled.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2014-08-28 23:23 -0600 |
| Subject | Re: xml issue with Type 'bool' cannot be serialized |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13597.1409289858.18130.python-list@python.org> (permalink) |
On Thu, Aug 28, 2014 at 2:58 PM, Noah <noah-list@enabled.com> wrote: > Hi list, > > I am not clear how to fix this issue. > > Traceback (most recent call last): > File "./command.py", line 81, in <module> > connect(host, USER, PASSWORD) > File "./command.py", line 63, in connect > dump = etree.tostring(xml_cmd) > File "lxml.etree.pyx", line 3165, in lxml.etree.tostring > (src/lxml/lxml.etree.c:69414) > TypeError: Type 'bool' cannot be serialized. > > > here is snippets from the code > > > > --- code --- > > from jnpr.junos import Device > from jnpr.junos.utils.config import Config > from lxml import etree > import jnpr.junos.exception > import sys, os, time, re, getopt > > def connect(host, user, password): > conn = Device(host=host, user=user, password=password).open() > > xml_cmd = '' > xml_cmd = conn.rpc.get_configuration() > dump = etree.tostring(xml_cmd) > print dump What is xml_cmd? Is it actually an ElementTree tree as required by etree.tostring?
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: xml issue with Type 'bool' cannot be serialized Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-28 23:23 -0600
csiph-web