mik3y / pymidi

Python library for building RTP-MIDI / AppleMIDI clients and servers
MIT License
47 stars 11 forks source link

Ignoring unrecognized command: b'IN' #9

Closed droberin closed 5 years ago

droberin commented 5 years ago

I get this every few seconds

WARNING:pymidi.ControlProtocol:Ignoring unrecognized command: b'IN'
WARNING:pymidi.ControlProtocol:Ignoring unrecognized command: b'BY'

Setting verbose mode crashes server:

Traceback (most recent call last):
  File "pymidi/server.py", line 157, in <module>
    server.serve_forever()
  File "pymidi/server.py", line 117, in serve_forever
    proto.handle_message(buffer, addr)
  File "/home/fakeusername/myvenv/lib/python3.6/site-packages/pymidi-0.3.0-py3.6.egg/pymidi/protocol.py", line 70, in handle_message
    self.logger.debug('rx: {}'.format(data.encode('hex')))
AttributeError: 'bytes' object has no attribute 'encode'

I'm connecting rtpMIDI tool by Tobias Erichsen from a Windows machine also TouchDaw from an Android device. Both cause same errors.

mik3y commented 5 years ago

Thanks for the report! Both of these look like Python 3 support issues; treating bytes objects as strings. Will fix.

droberin commented 5 years ago

I'm planning to use this software in another software I want to release, so the best this gets the best the other can be. I'll let you know if I finally go for it.

Thanks for the incoming fix!

mik3y commented 5 years ago

No problem-o!

You can find a work-in-progress in the branch mikey/py3, which I just pushed. It fixes at least this python 3 issue, though there may be others. Caution - I will be pushing more changes and tests to this branch before merging, and I may rebase it; so feel free to check it out if you can tolerate sudden changes, otherwise just wait for me to close this.

mik3y commented 5 years ago

Should be resolved in #10 / v0.4.0 (now released). Please open a new issue if any further problems!