From 00082e5b4260a2eda7af15fe091f92f4e27bfebf Mon Sep 17 00:00:00 2001 From: Jerry George Date: Thu, 30 Jul 2015 14:41:41 -0400 Subject: [PATCH] Minor Documentation changes for code samples Change-Id: I2d13fe2884d9eaebd112d342041e2e219bf6a240 --- HACKING.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HACKING.rst b/HACKING.rst index 27c5e48..b7cc831 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -83,14 +83,16 @@ commandline arguments, etc.) should be presumed to be encoded as utf-8. WRONG: + infile = open('testfile', 'r') mystring = infile.readline() myreturnstring = do_some_magic_with(mystring) outfile.write(myreturnstring) RIGHT: + infile = open('testfile', 'r') mystring = infile.readline() - mytext = s.decode('utf-8') + mytext = mystring.decode('utf-8') returntext = do_some_magic_with(mytext) returnstring = returntext.encode('utf-8') outfile.write(returnstring)