Use universal construct os.path.expanduser('~') instead of os.environ['HOME']
diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst
index 1aafec9..74d8d16 100644
--- a/Doc/library/http.cookiejar.rst
+++ b/Doc/library/http.cookiejar.rst
@@ -719,7 +719,7 @@
import os, http.cookiejar, urllib.request
cj = http.cookiejar.MozillaCookieJar()
- cj.load(os.path.join(os.environ["HOME"], ".netscape/cookies.txt"))
+ cj.load(os.path.join(os.path.expanduser("~"), ".netscape", "cookies.txt"))
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
r = opener.open("http://example.com/")
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst
index 218f81e..ab7b4b6 100644
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -197,7 +197,7 @@
import os
import readline
- histfile = os.path.join(os.environ["HOME"], ".pyhist")
+ histfile = os.path.join(os.path.expanduser("~"), ".pyhist")
try:
readline.read_history_file(histfile)
except IOError: