Skip to content

Commit f46b082

Browse files
committed
Use UTF-8 explicitly in case system doesn't use UTF-8
Fixes output failures in case the system (in particular Windows) doesn't use UTF-8.
1 parent f51e092 commit f46b082

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

byml/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def byml_to_yml() -> None:
3636
elif '!!' in args.yml:
3737
sys.stderr.write('error: cannot use !! (for input filename) when reading from stdin\n')
3838
sys.exit(1)
39-
output = sys.stdout if args.yml == '-' else open(args.yml, 'w')
39+
output = sys.stdout if args.yml == '-' else open(args.yml, 'w', encoding='utf-8')
4040
with output:
41-
yaml.dump(root, output, Dumper=dumper, allow_unicode=True)
41+
yaml.dump(root, output, Dumper=dumper, allow_unicode=True, encoding='utf-8')
4242

4343
def yml_to_byml() -> None:
4444
parser = argparse.ArgumentParser(description='Converts a YAML file to BYML.')

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="byml",
8-
version="2.0.0-3",
8+
version="2.0.1",
99
author="leoetlino",
1010
author_email="[email protected]",
1111
description="A simple Nintendo BYML or BYAML v2/v3 parser and writer",

0 commit comments

Comments
 (0)