ipcheck suffers exception; NoneType object has no attribute 'close'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ipcheck (Debian) |
Fix Released
|
Unknown
|
|||
ipcheck (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ipcheck
ipcheck version 0.233-1 gives
Traceback (most recent call last):
File "/usr/sbin/
File "/usr/sbin/
fp.close()
File "/usr/lib/
AttributeError: 'NoneType' object has no attribute 'close'
Lines of interest are
$ cat -n /usr/sbin/ipcheck | sed -n 5190,5198p
5190 try:
5191 fp = h2.getfile()
5192 httpdata = fp.read()
5193 fp.close()
5194 except:
5195 httpdata = "No output from http request."
5196
5197 # explicitly close
5198 fp.close()
$
It seems h2.getfile() is returning None causing problems when fp.close()
is attempted outside of the try-block.
Related branches
Changed in ipcheck (Debian): | |
status: | Unknown → New |
Changed in ipcheck (Debian): | |
status: | New → Fix Committed |
Changed in ipcheck (Debian): | |
status: | Fix Committed → Fix Released |
Having had time to work around it, fp isn't None, but fp._sock is. Changing line 5198 to
if fp and fp._sock: fp.close()
lets the program continue to apparently successful conclusion. I don't suggest this as the proper fix though. Without the work around, ipcheck.dat doesn't contain useful data.