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

Unified Diff: third_party/oauth2client/file.py

Issue 1094533003: Revert of Upgrade 3rd packages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 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 | « third_party/oauth2client/django_orm.py ('k') | third_party/oauth2client/gce.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/oauth2client/file.py
diff --git a/third_party/oauth2client/file.py b/third_party/oauth2client/file.py
index 4337fcfd243ee0c1492395c10d955b7acb384cfd..1895f94eac58d0386ce59baa86295d27a8a79ec3 100644
--- a/third_party/oauth2client/file.py
+++ b/third_party/oauth2client/file.py
@@ -1,4 +1,4 @@
-# Copyright 2014 Google Inc. All rights reserved.
+# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,10 +21,12 @@
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import os
+import stat
import threading
+from anyjson import simplejson
+from client import Storage as BaseStorage
from client import Credentials
-from client import Storage as BaseStorage
class CredentialsFileSymbolicLinkError(Exception):
@@ -90,7 +92,7 @@
simple version of "touch" to ensure the file has been created.
"""
if not os.path.exists(self._filename):
- old_umask = os.umask(0o177)
+ old_umask = os.umask(0177)
try:
open(self._filename, 'a+b').close()
finally:
@@ -108,7 +110,7 @@
self._create_file_if_needed()
self._validate_file()
- f = open(self._filename, 'w')
+ f = open(self._filename, 'wb')
f.write(credentials.to_json())
f.close()
@@ -119,4 +121,4 @@
credentials: Credentials, the credentials to store.
"""
- os.unlink(self._filename)
+ os.unlink(self._filename)
« no previous file with comments | « third_party/oauth2client/django_orm.py ('k') | third_party/oauth2client/gce.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698