Adding changes to encoding.doctest to support send method