Open eastein opened 8 years ago
I started doing some research into this and found that there have been compatiblity changes in msgpack-python at different points around encoding, which may be playing poorly with python 3's own encoding compatibility issues: https://pypi.python.org/pypi/msgpack-python - see section "Notes / string and binary type".
I will want to use tox to automate testing while working on this issue. https://tox.readthedocs.io/en/latest/
On python 3.9.16, on macOS, using pyenv-virtualenv and having installed 0.1.0 off of PyPI, I get this when trying to train a chain:
$ echo "test" | python -m andrey.train test.mpack 2 3
test.mpack 2 3
Traceback (most recent call last):
File "/Users/EStein/.pyenv/versions/3.9.16/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/EStein/.pyenv/versions/3.9.16/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/EStein/.pyenv/versions/andrey-3916/lib/python3.9/site-packages/andrey/train.py", line 25, in <module>
m.save(fn)
File "/Users/EStein/.pyenv/versions/andrey-3916/lib/python3.9/site-packages/andrey/persist.py", line 31, in save
msgpack.dump(self.todict(), fh)
File "/Users/EStein/.pyenv/versions/andrey-3916/lib/python3.9/site-packages/msgpack/__init__.py", line 38, in pack
stream.write(packer.pack(o))
TypeError: write() argument must be str, not bytes
Got started in a py3 labeled branch which I have since tagged (0.1.0) and released on PyPI. More work to do - under python 3.5.2, I get this when trying to start the bot (which really is just reading a msgpack persisted chain that was produced under python 2.7.12, using the same revision of the code) - the issue lies within andrey, not andrey_bot.