This commit is contained in:
Dimitri John Ledkov 2014-12-18 21:34:13 +00:00
parent d86cacddf9
commit ddabeed530
2 changed files with 6 additions and 2 deletions

View File

@ -308,7 +308,7 @@ class SourcePackage(object):
"Write dsc file to workdir" "Write dsc file to workdir"
if self._dsc is None: if self._dsc is None:
self.pull_dsc() self.pull_dsc()
with open(self.dsc_pathname, 'w') as f: with open(self.dsc_pathname, 'wb') as f:
f.write(self.dsc.raw_text) f.write(self.dsc.raw_text)
def _download_file(self, url, filename): def _download_file(self, url, filename):

View File

@ -45,6 +45,7 @@ class HelpTestCase(unittest.TestCase):
null = open('/dev/null', 'r') null = open('/dev/null', 'r')
process = subprocess.Popen(['./' + script, '--help'], process = subprocess.Popen(['./' + script, '--help'],
close_fds=True, stdin=null, close_fds=True, stdin=null,
universal_newlines=True,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
started = time.time() started = time.time()
@ -57,7 +58,10 @@ class HelpTestCase(unittest.TestCase):
while time.time() - started < TIMEOUT: while time.time() - started < TIMEOUT:
for fd in select.select(fds, [], fds, TIMEOUT)[0]: for fd in select.select(fds, [], fds, TIMEOUT)[0]:
out.append(os.read(fd, 1024)) output = os.read(fd, 1024)
if not isinstance(output, str):
output = output.decode('utf-8')
out.append(output)
if process.poll() is not None: if process.poll() is not None:
break break