For bug #153295, do a sanity check for non-string types in config.environ().
authorZac Medico <zmedico@gentoo.org>
Sun, 29 Oct 2006 22:25:50 +0000 (22:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 29 Oct 2006 22:25:50 +0000 (22:25 -0000)
svn path=/main/trunk/; revision=4877

pym/portage.py

index 70671b5930b26dbe6a275f82b02991e19936ae5f..f527ad826741a643e4b6ab21c814c947ca74b3b7 100644 (file)
@@ -1910,7 +1910,12 @@ class config:
                "return our locally-maintained environment"
                mydict={}
                for x in self.keys():
-                       mydict[x]=self[x]
+                       myvalue = self[x]
+                       if not isinstance(myvalue, basestring):
+                               writemsg("!!! Non-string value in config: %s=%s\n" % \
+                                       (x, myvalue), noiselevel=-1)
+                               continue
+                       mydict[x] = myvalue
                if not mydict.has_key("HOME") and mydict.has_key("BUILD_PREFIX"):
                        writemsg("*** HOME not set. Setting to "+mydict["BUILD_PREFIX"]+"\n")
                        mydict["HOME"]=mydict["BUILD_PREFIX"][:]