dinever / antispam

Dead simple bayesian anti-spam classifier written in Python.

Home Page:https://antispam.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

suppix opened this issue · 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'

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