summaryrefslogtreecommitdiffstats
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-08-03 14:36:32 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-08-03 14:36:32 (GMT)
commit9513e34ac405344e1ae78b14cb65e02f7b57a6f5 (patch)
treec47d6a7b8ce542d5364fb6d9466fe9d17819f45d /Lib/nntplib.py
parent0b49e02e03cd398883e816ad5a995da24dd2a1b3 (diff)
downloadcpython-9513e34ac405344e1ae78b14cb65e02f7b57a6f5.zip
cpython-9513e34ac405344e1ae78b14cb65e02f7b57a6f5.tar.gz
cpython-9513e34ac405344e1ae78b14cb65e02f7b57a6f5.tar.bz2
Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
Diffstat (limited to 'Lib/nntplib.py')
-rw-r--r--Lib/nntplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index d0bd5ad..8709fff 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -92,7 +92,7 @@ CRLF = '\r\n'
# The class itself
class NNTP:
def __init__(self, host, port=NNTP_PORT, user=None, password=None,
- readermode=None):
+ readermode=None, usenetrc=True):
"""Initialize an instance. Arguments:
- host: hostname to connect to
- port: port to connect to (default the standard NNTP port)
@@ -136,7 +136,7 @@ class NNTP:
# If no login/password was specified, try to get them from ~/.netrc
# Presume that if .netc has an entry, NNRP authentication is required.
try:
- if not user:
+ if usenetrc and not user:
import netrc
credentials = netrc.netrc()
auth = credentials.authenticators(host)