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
782d9408
Commit
782d9408
authored
Nov 17, 2002
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against error if .netrc is missing.
parent
89350a41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
Lib/nntplib.py
Lib/nntplib.py
+10
-7
No files found.
Lib/nntplib.py
View file @
782d9408
...
...
@@ -135,13 +135,16 @@ class NNTP:
raise
# If no login/password was specified, try to get them from ~/.netrc
# Presume that if .netc has an entry, NNRP authentication is required.
if
not
user
:
import
netrc
credentials
=
netrc
.
netrc
()
auth
=
credentials
.
authenticators
(
host
)
if
auth
:
user
=
auth
[
0
]
password
=
auth
[
2
]
try
:
if
not
user
:
import
netrc
credentials
=
netrc
.
netrc
()
auth
=
credentials
.
authenticators
(
host
)
if
auth
:
user
=
auth
[
0
]
password
=
auth
[
2
]
except
IOError
:
pass
# Perform NNRP authentication if needed.
if
user
:
resp
=
self
.
shortcmd
(
'authinfo user '
+
user
)
...
...
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