{"id":1977,"date":"2022-08-30T15:21:01","date_gmt":"2022-08-30T15:21:01","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/08\/detected-unhandled-python-exception-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:21:01","modified_gmt":"2022-08-30T15:21:01","slug":"detected-unhandled-python-exception-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/detected-unhandled-python-exception-collection-of-common-programming-errors\/","title":{"rendered":"detected unhandled Python exception-Collection of common programming errors"},"content":{"rendered":"<pre><code>abrt: detected unhandled Python exception in '\/usr\/local\/cpanel\/hooks\/addondomain\/addaddondomain'\n<\/code><\/pre>\n<p>code:<\/p>\n<pre><code>#!\/usr\/bin\/env python\nimport subprocess\nimport sys\nimport os\nimport yaml\nfrom xml.dom import minidom\nsys.path.append('\/scripts')\nimport createvhosts\ndoc = minidom.parse(sys.stdin)\n\nresulttaglist = doc.getElementsByTagName('result')\nresultlist =[]\n\nif resulttaglist[1].childNodes[0].toxml() == 0:\n        sys.exit\nelse:\n        subdomaintaglist = doc.getElementsByTagName('subdomain')\n        subdomain = subdomaintaglist[0].childNodes[0].toxml()\n        maindomaintaglist = doc.getElementsByTagName('DOMAIN')\n        maindomain = maindomaintaglist[0].childNodes[0].toxml()\n        domain =  subdomain + '.' + maindomain\n        usertaglist = doc.getElementsByTagName('USER')\n        user = usertaglist[0].childNodes[0].toxml()\n        docroot, yip, alias = createvhosts.getvars(domain)\n        serverip = createvhosts.getmainip()\n                if yip == serverip:\n                        createvhosts.writeconfshared(user, domain, docroot, yip, alias)\n                else:\n                        createvhosts.writeconfded(user, domain, docroot, yip, alias)\n        proc = subprocess.Popen(\"\/etc\/init.d\/nginx restart &gt; \/dev\/null 2&gt;&amp;1\", shell=True)\n<\/code><\/pre>\n<p>I was just wondering could this be a python version issue?<\/p>\n<pre><code>ls \/usr\/bin | grep python*\nabrt-action-analyze-python*\npython*\npython2@\npython2.6*\npython2.6-config*\npython-config@\n<\/code><\/pre>\n<p>I assume I am using python 2.6?<\/p>\n<p><strong>EDIT<\/strong> This also used to never happen. The other thing I noticed was the process won&#8217;t die and will remain seen when you do <code>ps -ef<\/code><\/p>\n<p id=\"rop\"><small>Originally posted 2013-12-08 05:27:00. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>abrt: detected unhandled Python exception in &#8216;\/usr\/local\/cpanel\/hooks\/addondomain\/addaddondomain&#8217; code: #!\/usr\/bin\/env python import subprocess import sys import os import yaml from xml.dom import minidom sys.path.append(&#8216;\/scripts&#8217;) import createvhosts doc = minidom.parse(sys.stdin) resulttaglist = doc.getElementsByTagName(&#8216;result&#8217;) resultlist =[] if resulttaglist[1].childNodes[0].toxml() == 0: sys.exit else: subdomaintaglist = doc.getElementsByTagName(&#8216;subdomain&#8217;) subdomain = subdomaintaglist[0].childNodes[0].toxml() maindomaintaglist = doc.getElementsByTagName(&#8216;DOMAIN&#8217;) maindomain = maindomaintaglist[0].childNodes[0].toxml() domain = subdomain + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1977","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1977"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1977\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}