Skip to content

Commit 363b853

Browse files
authored
🐛 FIX: set myst-anchor read/write encoding as utf8 (#610)
Ideally it would read from sphinx `source_encoding`, but this should fix most use cases, with the default encoding.
1 parent bd9303e commit 363b853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

myst_parser/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ def print_anchors(args=None):
1313
arg_parser.add_argument(
1414
"input",
1515
nargs="?",
16-
type=argparse.FileType("r"),
16+
type=argparse.FileType("r", encoding="utf8"),
1717
default=sys.stdin,
1818
help="Input file (default stdin)",
1919
)
2020
arg_parser.add_argument(
2121
"-o",
2222
"--output",
23-
type=argparse.FileType("w"),
23+
type=argparse.FileType("w", encoding="utf8"),
2424
default=sys.stdout,
2525
help="Output file (default stdout)",
2626
)

0 commit comments

Comments
 (0)