Don't fail if /etc/netrc is not readable

This commit is contained in:
Cédric Krier 2012-01-08 19:57:03 +01:00
parent b5a13157e4
commit 0b103e8627

View File

@ -138,7 +138,7 @@ class IMAPRepository(BaseRepository):
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry:
@ -235,7 +235,7 @@ class IMAPRepository(BaseRepository):
try:
netrcentry = netrc.netrc('/etc/netrc').authenticators(self.gethost())
except IOError, inst:
if inst.errno != errno.ENOENT:
if inst.errno not in (errno.ENOENT, errno.EACCES):
raise
else:
if netrcentry: