antispam icon indicating copy to clipboard operation
antispam copied to clipboard

save issues "TypeError: a bytes-like object is required, not 'str'"

Open suppix opened this issue 5 years ago • 1 comments

import antispam

d = antispam.Detector("my_model.dat")

d.train("Super cheap octocats for sale at GitHub.", True)
d.train("Hi John, could you please come to my office by 3pm? Ding", False)

d.save()

  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 180, in dump
    fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'

suppix avatar Apr 09 '19 13:04 suppix

Hi, Is it still relevant? I've checked it. Works fine for me.

badijm avatar Aug 11 '20 13:08 badijm