From 34e9ea2cd07ae9e336749a0e6f3a6655ada4505e Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Mon, 15 Feb 2016 09:06:54 +1100 Subject: [PATCH] =?utf8?q?Be=20explicit=20about=20why=20we=20use=20?= =?utf8?q?=E2=80=98io.BytesIO=E2=80=99=20for=20the=20fake=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/tutorial.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/tutorial.txt b/doc/tutorial.txt index c17590b..ecddc2a 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -2,7 +2,7 @@ Gajja tutorial ############## :Author: Ben Finney -:Updated: 2016-02-14 +:Updated: 2016-02-15 Faking a file's size @@ -39,6 +39,10 @@ a large input file returns no more than `batch_size` bytes:: ... read_bytes = reader.read() ... self.assertLessEqual(len(read_bytes), reader.batch_size) +Your program will access a stream of bytes from Python representing +the file's contents (if your program wants text, it will arrange that +by specifying a text encoding or relying in the default encoding). + How to make that fake input file? To fake the file content you can use a `io.BytesIO`:: -- 2.11.4.GIT