Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77236

xml issue with Type 'bool' cannot be serialized

Date 2014-08-28 13:58 -0700
From Noah <noah-list@enabled.com>
Subject xml issue with Type 'bool' cannot be serialized
Newsgroups comp.lang.python
Message-ID <mailman.13581.1409259948.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

xml issue with Type 'bool' cannot be serialized Noah <noah-list@enabled.com> - 2014-08-28 13:58 -0700

csiph-web