comparison mercurial/util.py @ 30925:82f1ef8b4477

py3: convert the mode argument of os.fdopen to unicodes (2 of 2)
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 13 Feb 2017 22:15:28 +0530
parents 3a4c0905f357
children ae5d60bb70c9
comparison
equal deleted inserted replaced
30924:48dea083f66d 30925:82f1ef8b4477
807 with the strings INFILE and OUTFILE replaced by the real names of 807 with the strings INFILE and OUTFILE replaced by the real names of
808 the temporary files generated.''' 808 the temporary files generated.'''
809 inname, outname = None, None 809 inname, outname = None, None
810 try: 810 try:
811 infd, inname = tempfile.mkstemp(prefix='hg-filter-in-') 811 infd, inname = tempfile.mkstemp(prefix='hg-filter-in-')
812 fp = os.fdopen(infd, 'wb') 812 fp = os.fdopen(infd, pycompat.sysstr('wb'))
813 fp.write(s) 813 fp.write(s)
814 fp.close() 814 fp.close()
815 outfd, outname = tempfile.mkstemp(prefix='hg-filter-out-') 815 outfd, outname = tempfile.mkstemp(prefix='hg-filter-out-')
816 os.close(outfd) 816 os.close(outfd)
817 cmd = cmd.replace('INFILE', inname) 817 cmd = cmd.replace('INFILE', inname)