tenable.sc.scan_instances.ScanResultAPI.import_scan - Error using "example"
Open
Nobody has claimed this yet.
backlog
documentation
Tenable Security Center
- Dominant language
- Python
- Stars
- 417
- Forks
- 190
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 3
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the linked ScanResultAPI.import_scan documentation and compare its example with the working binary-mode call shown here. Confirm whether the documented example should use binary mode; done means the example no longer raises the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100