gabrielfalcao/HTTPretty — pull request #115 by melor (2013-10-22 20:32:47+00:00)
Title: core: fix for working with python 3.3

The removed utf8() conversion raises the following exception
in Python 3.3:

TypeError: Type str doesn't support the buffer API

Also removed iteritems() as it is deprecated and no longer
supported in Python 3.x

---

The same (or just very similar?) problem is mentioned in https://github.com/gabrielfalcao/HTTPretty/pull/27/files

The original exception:

try:
self.sock.sendall(data)
except TypeError:
if isinstance(data, collections.Iterable):
for d in data:
> self.sock.sendall(d)

/usr/lib64/python3.3/http/client.py:875:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = , data = 71, args = (), kw = {}

def sendall(self, data, *args, **kw):
self._sent_data.append(data)

try:
> requestline, _ = data.split(b'\r\n', 1)
E AttributeError: 'int' object has no attribute 'split'

../../env/test/lib/python3.3/site-packages/httpretty-0.7.0-py3.3.egg/httpretty/core.py:346: AttributeError