Skip to content

Commit fa52af4

Browse files
gvanrossummethane
andauthored
Open files in UTF-8 mode
Co-authored-by: Inada Naoki <[email protected]>
1 parent 6e11529 commit fa52af4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/scripts/deepfreeze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,14 @@ def main() -> None:
403403
global verbose
404404
args = parser.parse_args()
405405
verbose = args.verbose
406-
with open(args.file) as f:
406+
with open(args.file, encoding="utf-8") as f:
407407
source = f.read()
408408
modname = args.module or os.path.basename(args.file).removesuffix(".py")
409409
output = args.output or modname + ".c"
410410
outdir = os.path.dirname(output)
411411
if outdir:
412412
os.makedirs(outdir, exist_ok=True)
413-
with open(output, "w") as file:
413+
with open(output, "w", encoding="utf-8") as file:
414414
with report_time("generate"):
415415
generate(source, f"<frozen {modname}>", modname, file)
416416
if verbose:

0 commit comments

Comments
 (0)