tags 587698 patch thanks On Thu, Jul 01, 2010 at 11:09:28AM +1200, Francois Marier wrote: > Everytime I run ipcheck.py on cron (I have it in /etc/cron.hourly), I get > this: > > Traceback (most recent call last): > File "/usr/sbin/ipcheck.py", line 5518, in <module> > _main(sys.argv) > File "/usr/sbin/ipcheck.py", line 5198, in _main > fp.close() > File "/usr/lib/python2.6/socket.py", line 273, in close > self._sock.close() > AttributeError: 'NoneType' object has no attribute 'close' > > I have attached the patch I used to silence these errors.
I have applied this fix to the attached NMU patch. Miguel
diff -u ipcheck-0.233/debian/changelog ipcheck-0.233/debian/changelog --- ipcheck-0.233/debian/changelog +++ ipcheck-0.233/debian/changelog @@ -1,3 +1,11 @@ +ipcheck (0.233-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix "on python2.6: AttributeError: 'NoneType' object has no + attribute 'close'" (Closes: #587698) + + -- Miguel de Val Borro <miguel.de...@gmail.com> Sun, 04 Dec 2011 15:57:08 +0100 + ipcheck (0.233-1) unstable; urgency=low * New upstream release only in patch2: unchanged: --- ipcheck-0.233.orig/ipcheck.py +++ ipcheck-0.233/ipcheck.py @@ -5187,15 +5187,15 @@ logger.logit(logline) # try to get the html text + fp = None try: fp = h2.getfile() httpdata = fp.read() - fp.close() except: httpdata = "No output from http request." - # explicitly close - fp.close() + if fp: + fp.close() logline = "fd closed" logger.logit(logline)