{"action":"opened","issue":{"url":"https://api.github.com/repos/mindflayer/python-mocket/issues/54","repository_url":"https://api.github.com/repos/mindflayer/python-mocket","labels_url":"https://api.github.com/repos/mindflayer/python-mocket/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/mindflayer/python-mocket/issues/54/comments","events_url":"https://api.github.com/repos/mindflayer/python-mocket/issues/54/events","html_url":"https://github.com/mindflayer/python-mocket/issues/54","id":231503301,"number":54,"title":"Mocket can't mock writing compressed data by zlib","user":{"login":"wen-aa","id":1390602,"avatar_url":"https://avatars2.githubusercontent.com/u/1390602?v=3","gravatar_id":"","url":"https://api.github.com/users/wen-aa","html_url":"https://github.com/wen-aa","followers_url":"https://api.github.com/users/wen-aa/followers","following_url":"https://api.github.com/users/wen-aa/following{/other_user}","gists_url":"https://api.github.com/users/wen-aa/gists{/gist_id}","starred_url":"https://api.github.com/users/wen-aa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wen-aa/subscriptions","organizations_url":"https://api.github.com/users/wen-aa/orgs","repos_url":"https://api.github.com/users/wen-aa/repos","events_url":"https://api.github.com/users/wen-aa/events{/privacy}","received_events_url":"https://api.github.com/users/wen-aa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-26T01:34:54Z","updated_at":"2017-05-26T01:34:54Z","closed_at":null,"body":"I tried to use Mocket to mock redis and write the compressed data, it threw this error.\r\n\r\n```python\r\nIn [1]: from mocket import compat\r\n\r\nIn [2]: import zlib\r\n\r\nIn [3]: s = '{[]}'\r\n\r\nIn [4]: compat.decode_from_bytes(zlib.compress(s))\r\n---------------------------------------------------------------------------\r\nUnicodeDecodeError                        Traceback (most recent call last)\r\n<ipython-input-4-0af92b1f9211> in <module>()\r\n----> 1 compat.decode_from_bytes(zlib.compress(s))\r\n\r\n/usr/local/lib/python2.7/dist-packages/mocket/compat.pyc in decode_from_bytes(s, charset)\r\n     35 def decode_from_bytes(s, charset=encoding):\r\n     36     if isinstance(s, byte_type):\r\n---> 37         s = s.decode(charset)\r\n     38     return text_type(s)\r\n     39\r\n\r\n/usr/lib/python2.7/encodings/utf_8.pyc in decode(input, errors)\r\n     14\r\n     15 def decode(input, errors='strict'):\r\n---> 16     return codecs.utf_8_decode(input, errors, True)\r\n     17\r\n     18 class IncrementalEncoder(codecs.IncrementalEncoder):\r\n\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte\r\n```\r\n"}}
{"actor":{"display_login":"wen-aa"}}