Skip to content

tenable.sc.scan_instances.ScanResultAPI.import_scan - Error using "example" #960

@stiong-p

Description

@stiong-p

Description:

From SC ScanResultAPI.import_scan
using the example:

with open('example.nessus') as fobj:
    sc.scan_instances.import_scan(fobj, 1)

would result in the error:
TypeError: a bytes-like object is required, not 'str'

What works:

with open('example.nessus', 'rb') as fobj:
sc.scan_instances.import_scan(fobj, 1)

To confirm:

Is this an incorrect example or a library issue?

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions