Bug #231382 - If the open() call in getconfig() raises an unexpected IOError,
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Jul 2008 09:08:39 +0000 (09:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Jul 2008 09:08:39 +0000 (09:08 -0000)
write a message to stderr showing the exact call that failed, including the
path of the file, in order to aid in debugging.

svn path=/main/trunk/; revision=11010

pym/portage/util.py

index 5ae3cc1f3a1f266ef3f6fc7715fced7c04d5114c..f6cd68457b48ee4a5eccc41f917b3213812ff974 100644 (file)
@@ -334,6 +334,7 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
                if e.errno == PermissionDenied.errno:
                        raise PermissionDenied(mycfg)
                if e.errno != errno.ENOENT:
+                       writemsg("open('%s', 'r'): %s\n" % (mycfg, e), noiselevel=-1)
                        raise
                return None
        try: