From 802648045476f91f1c4b6a9f507cc08625194c2c Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Tue, 17 Dec 2013 10:30:23 +0100 Subject: [PATCH] Use the BytesIO for buffering bytes and import the one from the compat module. --- docs/tutorial/1-serialization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index e1c0009c3..4d4e7258f 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -183,9 +183,9 @@ At this point we've translated the model instance into Python native datatypes. Deserialization is similar. First we parse a stream into Python native datatypes... - import StringIO + from rest_framework.compat import BytesIO - stream = StringIO.StringIO(content) + stream = BytesIO(content) data = JSONParser().parse(stream) ...then we restore those native datatypes into to a fully populated object instance.