From 9513e34ac405344e1ae78b14cb65e02f7b57a6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 3 Aug 2004 14:36:32 +0000 Subject: Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP(). --- Lib/nntplib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/nntplib.py') diff --git a/Lib/nntplib.py b/Lib/nntplib.py index d0bd5adcfd..8709fffc64 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) -- cgit v1.2.1