config_dest = os.path.join(self.jenkins_home, 'config.xml')
config_dest_file = open(config_dest, 'w')
config_source = pkg_resources.resource_string('jenkinsapi_tests.systests', 'config.xml')
- config_dest_file.write(config_source.encode('UTF-8'))
+ try:
+ config_dest_file.write(config_source.encode('UTF-8'))
+ except AttributeError:
+ # Python 3.x
+ config_dest_file.write(config_source.decode('UTF-8'))
+
def install_plugins(self):
for i, url in enumerate(self.plugin_urls):
while True:
try:
streamName, line = self.q.get(block=True, timeout=timeout)
+ # Python 3.x
+ if isinstance(line, bytes):
+ line = line.decode('UTF-8')
except Queue.Empty:
log.warn("Input ended unexpectedly")
break