Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
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 @@
 # 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 @@
         # 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)