Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9513e34a
Commit
9513e34a
authored
Aug 03, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
parent
0b49e02e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
Doc/lib/libnntplib.tex
Doc/lib/libnntplib.tex
+7
-2
Lib/nntplib.py
Lib/nntplib.py
+2
-2
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/lib/libnntplib.tex
View file @
9513e34a
...
...
@@ -54,12 +54,14 @@ The module itself defines the following items:
\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 @@ necessary if you are connecting to an NNTP server on the local machine
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
}{}
...
...
Lib/nntplib.py
View file @
9513e34a
...
...
@@ -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
)
...
...
Misc/NEWS
View file @
9513e34a
...
...
@@ -72,6 +72,8 @@ Extension modules
Library
-------
-
nntplib
does
now
allow
to
ignore
a
.
netrc
file
.
-
urllib2
now
recognizes
Basic
authentication
even
if
other
authentication
schemes
are
offered
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment