Allow nailgun to work with utf-8 properly
Allow nailgun to work with utf-8 properly

Summary:
Make sure we take the length of the bytes array, rather than the input buffer.

In python2, this worked properly because str==bytes
In python3, len(str) is the number of characters, and len(bytes) is the number of bytes. When there was a mismatch (we tried to send only some of the bytes), the python client would appear to hang.

Picking the proper size makes this work correctly. Will upstream to nailgun as well.

Reviewed By: gnuthor

shipit-source-id: 19e52424acd3e95ea0929ce7559585d3fab80b16

kageiit/buck,JoelMarcey/buck,kageiit/buck,nguyentruongtho/buck,nguyentruongtho/buck,JoelMarcey/buck,nguyentruongtho/buck,Addepar/buck,JoelMarcey/buck,JoelMarcey/buck,facebook/buck,nguyentruongtho/buck,facebook/buck,JoelMarcey/buck,kageiit/buck,Addepar/buck,JoelMarcey/buck,JoelMarcey/buck,JoelMarcey/buck,Addepar/buck,facebook/buck,Addepar/buck,JoelMarcey/buck,facebook/buck,JoelMarcey/buck,facebook/buck,Addepar/buck,facebook/buck,JoelMarcey/buck,Addepar/buck,kageiit/buck,Addepar/buck,Addepar/buck,kageiit/buck,Addepar/buck,Addepar/buck,Addepar/buck,JoelMarcey/buck,Addepar/buck,nguyentruongtho/buck,kageiit/buck,Addepar/buck,kageiit/buck,nguyentruongtho/buck,facebook/buck,nguyentruongtho/buck,JoelMarcey/buck