thriftpy
thriftpy copied to clipboard
Fixes #302 -- deprecation warnings when array.tostring() is called on Python 3.3+
Fixes #302; calls appropriate array.tobytes / array.tostring depending on Python version.
Not sure why this fails Travis for Python 2.6, but don't think it has anything to do with my change.
Would be awesome if someone merged it. My logs are rather unreadable because of tons of deprecation warnings. :/
@michcio1234 FYI: You can use Python's 'warnings' module to suppress these messages. Here's what we've done in the interim. This disables this specific warning only within the context manager.
import warnings
with warnings.catch_warnings():
# Filter out Thriftpy deprecation warnings
warnings.filterwarnings(action='ignore', message=r'tostring\(\) is deprecated. Use tobytes\(\) instead.', module='thriftpy.protocol.compact',
category=DeprecationWarning)
<thrift code here>
Thriftpy was not supported any more, and it already be resolved in thriftpy2, thanks!