Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4dcf5025
Commit
4dcf5025
authored
Mar 25, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use universal construct os.path.expanduser('~') instead of os.environ['HOME']
parent
ebbf1e67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
Doc/library/http.cookiejar.rst
Doc/library/http.cookiejar.rst
+1
-1
Doc/library/readline.rst
Doc/library/readline.rst
+1
-1
No files found.
Doc/library/http.cookiejar.rst
View file @
4dcf5025
...
...
@@ -719,7 +719,7 @@ cookies (assumes Unix/Netscape convention for location of the cookies file)::
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/")
...
...
Doc/library/readline.rst
View file @
4dcf5025
...
...
@@ -197,7 +197,7 @@ normally be executed automatically during interactive sessions from the user's
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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment