Serializing cpyamf.util.BufferedByteStream leads to crash

I know that I am using mitmproxy version that someone could describe as ancient, that’s due to strong coupling with software I use. But it seems that problem I am going to ask about is really not mitmproxy issue.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/proxy/server.py", line 121, in handle
    root_layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/proxy/modes/http_proxy.py", line 25, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/tls.py", line 358, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http1.py", line 67, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 192, in __call__
    self.get_response_from_server(flow)
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 294, in get_response_from_server
    get_response()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 290, in get_response
    self.send_request(flow.request)
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http1.py", line 25, in send_request
    self.server_conn.wfile.write(http1.assemble_request(request))
  File "/usr/local/lib/python2.7/dist-packages/netlib/http/http1/assemble.py", line 11, in assemble_request
    body = b"".join(assemble_body(request.data.headers, [request.data.content]))
TypeError: sequence item 0: expected string, cpyamf.util.BufferedByteStream found

mitmproxy has crashed!
Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy
127.0.0.1:47710: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/proxy/server.py", line 121, in handle
    root_layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/proxy/modes/http_proxy.py", line 25, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/tls.py", line 358, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http1.py", line 67, in __call__
    layer()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 192, in __call__
    self.get_response_from_server(flow)
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 294, in get_response_from_server
    get_response()
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http.py", line 290, in get_response
    self.send_request(flow.request)
  File "/usr/local/lib/python2.7/dist-packages/mitmproxy/protocol/http1.py", line 25, in send_request
    self.server_conn.wfile.write(http1.assemble_request(request))
  File "/usr/local/lib/python2.7/dist-packages/netlib/http/http1/assemble.py", line 11, in assemble_request
    body = b"".join(assemble_body(request.data.headers, [request.data.content]))
TypeError: sequence item 0: expected string, cpyamf.util.BufferedByteStream found