Skip to content

Commit 28cc2e0

Browse files
Merge pull request googleapis#129 from thobrla/master
2 parents 535388c + ff33c81 commit 28cc2e0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

oauth2client/multistore_file.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
__author__ = '[email protected] (Joe Beda)'
4848

49+
import errno
4950
import json
5051
import logging
5152
import os
@@ -279,7 +280,17 @@ def _create_file_if_needed(self):
279280
def _lock(self):
280281
"""Lock the entire multistore."""
281282
self._thread_lock.acquire()
282-
self._file.open_and_lock()
283+
try:
284+
self._file.open_and_lock()
285+
except IOError as e:
286+
if e.errno == errno.ENOSYS:
287+
logger.warn('File system does not support locking the credentials '
288+
'file.')
289+
elif e.errno == errno.ENOLCK:
290+
logger.warn('File system is out of resources for writing the '
291+
'credentials file (is your disk full?).')
292+
else:
293+
raise
283294
if not self._file.is_locked():
284295
self._read_only = True
285296
if self._warn_on_readonly:

0 commit comments

Comments
 (0)