comparison mercurial/util.py @ 14250:34ec9b313638

util: make readfile() operate in binary mode writefile() and appendfile() are already working that way.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 07 May 2011 21:12:35 +0200
parents b9e1b041744f
children 23cd7eeff678
comparison
equal deleted inserted replaced
14249:f4766e1bb0b3 14250:34ec9b313638
770 raise 770 raise
771 makedirs(parent, mode) 771 makedirs(parent, mode)
772 makedirs(name, mode) 772 makedirs(name, mode)
773 773
774 def readfile(path): 774 def readfile(path):
775 fp = open(path) 775 fp = open(path, 'rb')
776 try: 776 try:
777 return fp.read() 777 return fp.read()
778 finally: 778 finally:
779 fp.close() 779 fp.close()
780 780