Skip to content

Commit

Permalink
Merge pull request #795 from vnitinv/fix-794-TypeError-py3-savexml
Browse files Browse the repository at this point in the history
fix for issue 794, TypeError: with python 3.4 and savexml
  • Loading branch information
vnitinv authored Nov 15, 2017
2 parents a10cf2c + a6f8672 commit 2eaac6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jnpr/junos/factory/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def savexml(self, path, hostname=False, timestamp=False, append=None):
fname += "_%s" % append

path = fname + fext
return etree.ElementTree(self.xml).write(open(path, 'w'))
return etree.ElementTree(self.xml).write(open(path, 'wb'))

def to_json(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_table_savexml(self, mock_file, mock_execute):
self.ppt.xml = etree.XML('<root><a>test</a></root>')
self.ppt.savexml('/vasr/tmssp/foo.xml', hostname=True, append='test')
mock_file.assert_called_once_with('/vasr/tmssp/foo_1.1.1.1_test.xml',
'w')
'wb')
self.ppt.savexml('/vasr/tmssp/foo.xml', hostname=True, timestamp=True)
self.assertEqual(mock_file.call_count, 2)

Expand Down

0 comments on commit 2eaac6c

Please sign in to comment.