File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,12 @@ def main():
20
20
description = ('A simple command line interface for json module '
21
21
'to validate and pretty-print JSON objects.' )
22
22
parser = argparse .ArgumentParser (prog = prog , description = description )
23
- parser .add_argument ('infile' , nargs = '?' , type = argparse .FileType (),
23
+ parser .add_argument ('infile' , nargs = '?' ,
24
+ type = argparse .FileType (encoding = "utf-8" ),
24
25
help = 'a JSON file to be validated or pretty-printed' ,
25
26
default = sys .stdin )
26
- parser .add_argument ('outfile' , nargs = '?' , type = argparse .FileType ('w' ),
27
+ parser .add_argument ('outfile' , nargs = '?' ,
28
+ type = argparse .FileType ('w' , encoding = "utf-8" ),
27
29
help = 'write the output of infile to outfile' ,
28
30
default = sys .stdout )
29
31
parser .add_argument ('--sort-keys' , action = 'store_true' , default = False ,
You can’t perform that action at this time.
0 commit comments