unix2dos.py: make it ready for python 3

fixes bug #10838
This commit is contained in:
Uwe Stöhr 2017-12-08 02:08:16 +01:00
parent 56ef6db74c
commit 95bcff9924

View File

@ -7,7 +7,7 @@ for fname in sys.argv[1:]:
infile = open( fname, "rb" )
instr = infile.read()
infile.close()
outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ).replace( "\n", "\r\n" )
outstr = instr.replace( b"\r\n", b"\n" ).replace( b"\r", b"\n" ).replace( b"\n", b"\r\n" )
if len(outstr) == len(instr):
continue