graingert / python-clamd

Clamd is a python interface to Clamd (Clamav daemon). By using Clamd, you can add virus detection capabilities to your python software in an efficient and easy way.
82 stars 39 forks source link

instream returns None #20

Open srinathganesh opened 5 years ago

srinathganesh commented 5 years ago

Test Code

  import clamd
    cd = clamd.ClamdUnixSocket()

    f = '/tmp/EICAR.txt'
    open(f, 'wb').write(clamd.EICAR)
    print(f"Test1: {cd.scan(f)}")

    f = '/tmp/SAFE.txt'
    open(f, 'wb').write(b"asdf")
    print(f"Test2: {cd.scan(f)}")

    from six import BytesIO
    r = cd.instream(BytesIO(clamd.EICAR))
    print(r)

Result

Test1: {'/tmp/EICAR.txt': ('FOUND', 'Eicar-Test-Signature')}
Test2: {'/tmp/SAFE.txt': ('OK', None)}
None