Skip to content

TypeError: a bytes-like object is required, not 'str' #26

@sim0nx

Description

@sim0nx

Hi,
While converting a python2 script to python3 I noticed a bug in your library:

Traceback (most recent call last):
....
File "/opt/lib/scapy_http/http.py", line 179, in self_build
return _self_build(self, field_pos_list)
File "/opt/lib/scapy_http/http.py", line 101, in _self_build
val = _get_field_value(obj, f.name)
File "/opt/lib/scapy_http/http.py", line 74, in _get_field_value
headers = _parse_headers(val)
File "/opt/lib/scapy_http/http.py", line 18, in _parse_headers
headers = s.split("\r\n")
TypeError: a bytes-like object is required, not 'str'

I will open a PR which addresses this.

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