To test, install python-pyclamd and clamav-daemon:

$ sudo aptitude install python-pyclamd clamav-daemon

Update the virus definition database (to make sure you have one):

$ sudo -u clamav freshclam

Then do anything that would make it raise an exception:

$ python
>>> import pyclamd
>>> pyclamd.init_unix_socket("/var/run/clamav/clamd.ctl")
>>> pyclamd.scan_file("file_that_doesnt_exist")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/pyclamd.py", line 350, in scan_file
    raise ScanError(reason)
pyclamd.ScanError: lstat() failed: No such file or directory.

The above output is correct (raising a ScanError). On 1.1, you get this
instead:

>>> import pyclamd
>>> pyclamd.init_unix_socket("/var/run/clamav/clamd.ctl")
>>> pyclamd.scan_file("file_that_doesnt_exist")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/pyclamd.py", line 286, in scan_file
    raise ScanError, virusname
TypeError: exceptions must be old-style classes or derived from BaseException, 
not str

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/771955

Title:
  pyClamd 0.1.1 doesn't work with Python 2.6

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to