Merge with 3.2
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index 1e0a31f..01092fc 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -242,26 +242,26 @@
 
     # create a temporary file and write some data to it
     >>> fp = tempfile.TemporaryFile()
-    >>> fp.write('Hello world!')
+    >>> fp.write(b'Hello world!')
     # read data from file
     >>> fp.seek(0)
     >>> fp.read()
-    'Hello world!'
+    b'Hello world!'
     # close the file, it will be removed
     >>> fp.close()
 
     # create a temporary file using a context manager
     >>> with tempfile.TemporaryFile() as fp:
-    ...     fp.write('Hello world!')
+    ...     fp.write(b'Hello world!')
     ...     fp.seek(0)
     ...     fp.read()
-    'Hello world!'
+    b'Hello world!'
     >>>
     # file is now closed and removed
 
     # create a temporary directory using the context manager
     >>> with tempfile.TemporaryDirectory() as tmpdirname:
-    ...     print 'created temporary directory', tmpdirname
+    ...     print('created temporary directory', tmpdirname)
     >>>
     # directory and contents have been removed
 
diff --git a/Misc/NEWS b/Misc/NEWS
index e4eba6e..fdd410b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -466,6 +466,11 @@
 
 - PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with Mercurial.
 
+Documentation
+-------------
+
+- Issue #11818: Fix tempfile examples for Python 3.
+
 
 What's New in Python 3.2?
 =========================