Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
diff --git a/Doc/lib/libnntplib.tex b/Doc/lib/libnntplib.tex
index a2161ce..1aa5d43 100644
--- a/Doc/lib/libnntplib.tex
+++ b/Doc/lib/libnntplib.tex
@@ -54,12 +54,14 @@
 
 \begin{classdesc}{NNTP}{host\optional{, port
                         \optional{, user\optional{, password
-			\optional{, readermode}}}}}
+			\optional{, readermode}
+			\optional{, usenetrc}}}}}
 Return a new instance of the \class{NNTP} class, representing a
 connection to the NNTP server running on host \var{host}, listening at
 port \var{port}.  The default \var{port} is 119.  If the optional
 \var{user} and \var{password} are provided, 
-or if suitable credentials are present in \file{~/.netrc},
+or if suitable credentials are present in \file{~/.netrc} and the
+optional flag \var{usenetrc} is true (the default),
 the \samp{AUTHINFO USER} and \samp{AUTHINFO PASS} commands are used to
 identify and authenticate the user to the server.  If the optional
 flag \var{readermode} is true, then a \samp{mode reader} command is
@@ -68,6 +70,9 @@
 and intend to call reader-specific commands, such as \samp{group}.  If
 you get unexpected \code{NNTPPermanentError}s, you might need to set
 \var{readermode}.  \var{readermode} defaults to \code{None}.
+\var{usenetrc} defaults to \code{True}.
+
+\versionchanged[\var{usenetrc} argument added]{2.4}
 \end{classdesc}
 
 \begin{classdesc}{NNTPError}{}
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)
diff --git a/Misc/NEWS b/Misc/NEWS
index 291cc77..2ea4cb1 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -72,6 +72,8 @@
 Library
 -------
 
+- nntplib does now allow to ignore a .netrc file.
+
 - urllib2 now recognizes Basic authentication even if other authentication
   schemes are offered.