summaryrefslogtreecommitdiffstats
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-29 16:19:50 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-29 16:19:50 (GMT)
commita5785b1524074656f0a0ec64e5e5cdb27aa3a356 (patch)
tree01583b47f69a08b1d11e59285b9a64ba95cfd7e4 /Lib/nntplib.py
parent2620d81b7fa0a915e03e74eb82f80e029f7081a1 (diff)
downloadcpython-a5785b1524074656f0a0ec64e5e5cdb27aa3a356.zip
cpython-a5785b1524074656f0a0ec64e5e5cdb27aa3a356.tar.gz
cpython-a5785b1524074656f0a0ec64e5e5cdb27aa3a356.tar.bz2
Fix NNTP when there's a ".netrc" file
Diffstat (limited to 'Lib/nntplib.py')
-rw-r--r--Lib/nntplib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 1055d06..409342c 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -279,11 +279,12 @@ class _NNTPBase:
encoding = 'utf-8'
errors = 'surrogateescape'
- def __init__(self, file, user=None, password=None,
+ def __init__(self, file, host, user=None, password=None,
readermode=None, usenetrc=True,
timeout=_GLOBAL_DEFAULT_TIMEOUT):
"""Initialize an instance. Arguments:
- file: file-like object (open for read/write in binary mode)
+ - host: hostname of the server (used if `usenetrc` is True)
- user: username to authenticate with
- password: password to use with username
- readermode: if true, send 'mode reader' command after
@@ -933,7 +934,7 @@ class NNTP(_NNTPBase):
self.port = port
self.sock = socket.create_connection((host, port), timeout)
file = self.sock.makefile("rwb")
- _NNTPBase.__init__(self, file, user, password,
+ _NNTPBase.__init__(self, file, host, user, password,
readermode, usenetrc, timeout)
def _close(self):