Skip to content

Type error: "a bytes-like object is required, not 'str'" #7

Open
@faustus25

Description

@faustus25

Type error running Pysight.py under Python3:

Id": null, "observationTime": 1549856820}]}':
Unexpected error: %s (<class 'TypeError'>, TypeError("a bytes-like object is required, not 'str'",), <traceback object at 0x7ff411a33ac8>)
ERROR:PySight_settings:Something went wrong while downloading / processing the iSight Request
Traceback (most recent call last):
  File "PySight.py", line 807, in <module>
    misp_process_isight_alert(result)
  File "PySight.py", line 778, in misp_process_isight_alert
    for i in a_result['message']:
TypeError: 'bool' object is not subscriptable

Line 778-791:

for i in a_result['message']:
        PySight_settings.logger.debug("  %s current element %s", len(a_result['message']), i)

        # USING THREADS to proceed with the resulting JSON
        if PySight_settings.use_threading:
            t = threading.Thread(target=isight_process_alert_content_element, args=(i,))
            t.start()
        else:
            # NO THREADING

            isight_process_alert_content_element(i)
            PySight_settings.logger.debug("Sleeping for %s seconds", PySight_settings.time_sleep)
            time.sleep(PySight_settings.time_sleep)
    end = timer()

Line 807:

misp_process_isight_alert(result)

Can you check if you encounter this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions