diff --git a/packager/app/test/packager_app.py b/packager/app/test/packager_app.py index 81da80bcce..5bc97e6b98 100644 --- a/packager/app/test/packager_app.py +++ b/packager/app/test/packager_app.py @@ -45,11 +45,11 @@ class PackagerApp(object): def DumpStreamInfo(self, stream): input_str = 'input=%s' % stream cmd = [self.packager_binary, input_str, '--dump_stream_info'] - return subprocess.check_output(cmd, env=self.GetEnv()) + return subprocess.check_output(cmd, env=self.GetEnv()).decode() def Version(self): return subprocess.check_output( - [self.packager_binary, '--version'], env=self.GetEnv()) + [self.packager_binary, '--version'], env=self.GetEnv()).decode() def Package(self, streams, flags=None): """Executes packager command.""" diff --git a/packager/app/test/packager_test.py b/packager/app/test/packager_test.py index 1759837b66..38c420404b 100755 --- a/packager/app/test/packager_test.py +++ b/packager/app/test/packager_test.py @@ -173,7 +173,7 @@ def _UpdateMediaInfoPaths(media_info_filepath): # after: media_file_name: "bear-640x360-audio.mp4" with open(media_info_filepath, 'rb') as f: - content = f.read() + content = f.read().decode() regex = 'media_file_name: "(.*)"' for path in re.findall(regex, content): @@ -181,7 +181,7 @@ def _UpdateMediaInfoPaths(media_info_filepath): content = content.replace(path, short_path) with open(media_info_filepath, 'wb') as f: - f.write(content) + f.write(content.encode()) def _UpdateMpdTimes(mpd_filepath): @@ -200,7 +200,7 @@ def _UpdateMpdTimes(mpd_filepath): return out with open(mpd_filepath, 'rb') as f: - content = f.read() + content = f.read().decode() content = _Replace( content, @@ -213,7 +213,7 @@ def _UpdateMpdTimes(mpd_filepath): 'publishTime="some_time"') with open(mpd_filepath, 'wb') as f: - f.write(content) + f.write(content.encode()) def GetExtension(input_file_path, output_format):