diff --git a/scripts/clean_rosdep_yaml.py b/scripts/clean_rosdep_yaml.py index 245f48026c099..1fccfebe274ed 100755 --- a/scripts/clean_rosdep_yaml.py +++ b/scripts/clean_rosdep_yaml.py @@ -64,5 +64,5 @@ def prn(n, nm, lvl): for a in sorted(iny): buf += prn(iny[a], a, 0) - with io.open(args.outfile, 'w', encoding='utf-8') as f: - f.write(buf) + with io.open(args.outfile, 'wb') as f: + f.write(buf.encode('utf-8'))