Skip to content

Added support for python3 with poll_client#250

Open
shu-tom wants to merge 1 commit intoTAXIIProject:masterfrom
shu-tom:master
Open

Added support for python3 with poll_client#250
shu-tom wants to merge 1 commit intoTAXIIProject:masterfrom
shu-tom:master

Conversation

@shu-tom
Copy link

@shu-tom shu-tom commented Apr 21, 2021

I got the following error when using poll_client in Python 3.7.

Traceback (most recent call last):
  File "/Library/Python/3.7/site-packages/libtaxii/scripts/__init__.py", line 428, in __call__
    self.handle_response(r, args)
  File "poll_client.py", line 87, in handle_response
    self.write_cbs_from_poll_response_11(response, dest_dir=args.dest_dir, write_type_=args.write_type)
  File "/Library/Python/3.7/site-packages/libtaxii/scripts/__init__.py", line 359, in write_cbs_from_poll_response_11
    f.write(cb.content)
TypeError: a bytes-like object is required, not 'str'

After changing to encode the content, it worked in Python3 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant