| Index: gclient_utils.py
|
| diff --git a/gclient_utils.py b/gclient_utils.py
|
| index 35f8b3bf44ef69ed02c72422c73125e7f671f2c1..9ba6da50c4b7c50926ca13aa937c84d94234f72f 100644
|
| --- a/gclient_utils.py
|
| +++ b/gclient_utils.py
|
| @@ -4,6 +4,7 @@
|
|
|
| """Generic utils."""
|
|
|
| +import codecs
|
| import errno
|
| import logging
|
| import os
|
| @@ -76,21 +77,13 @@ class PrintableObject(object):
|
|
|
|
|
| def FileRead(filename, mode='rU'):
|
| - content = None
|
| - f = open(filename, mode)
|
| - try:
|
| - content = f.read()
|
| - finally:
|
| - f.close()
|
| - return content
|
| + with codecs.open(filename, mode=mode, encoding='utf-8') as f:
|
| + return f.read()
|
|
|
|
|
| def FileWrite(filename, content, mode='w'):
|
| - f = open(filename, mode)
|
| - try:
|
| + with codecs.open(filename, mode=mode, encoding='utf-8') as f:
|
| f.write(content)
|
| - finally:
|
| - f.close()
|
|
|
|
|
| def rmtree(path):
|
|
|