Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: gclient_utils.py

Issue 10698089: The previous fix r145315 seems to have broken python 2.6.2 on Windows users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index e43577b67ccedc51d26b87f3883880e158d13565..34f3db84719e2013ae8168a147eeb4eea968dca7 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -77,12 +77,9 @@ class PrintableObject(object):
def FileRead(filename, mode='rU'):
- with codecs.open(filename, mode=mode, encoding='utf-8') as f:
- content = f.read()
- if mode.endswith('U'):
- # codecs.open() has different behavior than open() on python 2.6.
- return content.replace('\r\n', '\n')
- return content
+ with open(filename, mode=mode) as f:
+ # codecs.open() has different behavior than open() on python 2.6.
cmp 2012/07/10 01:27:02 since you're no longer calling codecs.open(), this
+ return f.read().decode('utf-8')
def FileWrite(filename, content, mode='w'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698