Python 3.3 fixes.

This commit is contained in:
Jakub Roztocil 2013-01-03 14:54:34 +01:00
parent 0ae9d7af58
commit 79c412064a
2 changed files with 6 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import inspect
import argparse
import functools
from . import __version__
from .input import RegexValidator
from .sessions import (Session, Host,
command_session_list,
@ -18,8 +17,7 @@ from .sessions import (Session, Host,
parser = argparse.ArgumentParser(
description='The HTTPie management command.',
version=__version__
description='The HTTPie management command.'
)
subparsers = parser.add_subparsers()

View File

@ -168,4 +168,8 @@ class HTTPRequest(HTTPMessage):
@property
def body(self):
return self._orig.body or b''
body = self._orig.body
if isinstance(body, str):
# Happens with JSON/form request data parsed from the command line.
body = body.encode('utf8')
return body or b''