Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9513e34a
Kaydet (Commit)
9513e34a
authored
Agu 03, 2004
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
üst
0b49e02e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
libnntplib.tex
Doc/lib/libnntplib.tex
+7
-2
nntplib.py
Lib/nntplib.py
+2
-2
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/lib/libnntplib.tex
Dosyayı görüntüle @
9513e34a
...
@@ -54,12 +54,14 @@ The module itself defines the following items:
...
@@ -54,12 +54,14 @@ The module itself defines the following items:
\begin{classdesc}
{
NNTP
}{
host
\optional
{
, port
\begin{classdesc}
{
NNTP
}{
host
\optional
{
, port
\optional
{
, user
\optional
{
, password
\optional
{
, user
\optional
{
, password
\optional
{
, readermode
}}}}}
\optional
{
, readermode
}
\optional
{
, usenetrc
}}}}}
Return a new instance of the
\class
{
NNTP
}
class, representing a
Return a new instance of the
\class
{
NNTP
}
class, representing a
connection to the NNTP server running on host
\var
{
host
}
, listening at
connection to the NNTP server running on host
\var
{
host
}
, listening at
port
\var
{
port
}
. The default
\var
{
port
}
is 119. If the optional
port
\var
{
port
}
. The default
\var
{
port
}
is 119. If the optional
\var
{
user
}
and
\var
{
password
}
are provided,
\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
the
\samp
{
AUTHINFO USER
}
and
\samp
{
AUTHINFO PASS
}
commands are used to
identify and authenticate the user to the server. If the optional
identify and authenticate the user to the server. If the optional
flag
\var
{
readermode
}
is true, then a
\samp
{
mode reader
}
command is
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
...
@@ -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
and intend to call reader-specific commands, such as
\samp
{
group
}
. If
you get unexpected
\code
{
NNTPPermanentError
}
s, you might need to set
you get unexpected
\code
{
NNTPPermanentError
}
s, you might need to set
\var
{
readermode
}
.
\var
{
readermode
}
defaults to
\code
{
None
}
.
\var
{
readermode
}
.
\var
{
readermode
}
defaults to
\code
{
None
}
.
\var
{
usenetrc
}
defaults to
\code
{
True
}
.
\versionchanged
[\var{usenetrc} argument added]
{
2.4
}
\end{classdesc}
\end{classdesc}
\begin{classdesc}
{
NNTPError
}{}
\begin{classdesc}
{
NNTPError
}{}
...
...
Lib/nntplib.py
Dosyayı görüntüle @
9513e34a
...
@@ -92,7 +92,7 @@ CRLF = '\r\n'
...
@@ -92,7 +92,7 @@ CRLF = '\r\n'
# The class itself
# The class itself
class
NNTP
:
class
NNTP
:
def
__init__
(
self
,
host
,
port
=
NNTP_PORT
,
user
=
None
,
password
=
None
,
def
__init__
(
self
,
host
,
port
=
NNTP_PORT
,
user
=
None
,
password
=
None
,
readermode
=
None
):
readermode
=
None
,
usenetrc
=
True
):
"""Initialize an instance. Arguments:
"""Initialize an instance. Arguments:
- host: hostname to connect to
- host: hostname to connect to
- port: port to connect to (default the standard NNTP port)
- port: port to connect to (default the standard NNTP port)
...
@@ -136,7 +136,7 @@ class NNTP:
...
@@ -136,7 +136,7 @@ class NNTP:
# If no login/password was specified, try to get them from ~/.netrc
# If no login/password was specified, try to get them from ~/.netrc
# Presume that if .netc has an entry, NNRP authentication is required.
# Presume that if .netc has an entry, NNRP authentication is required.
try
:
try
:
if
not
user
:
if
usenetrc
and
not
user
:
import
netrc
import
netrc
credentials
=
netrc
.
netrc
()
credentials
=
netrc
.
netrc
()
auth
=
credentials
.
authenticators
(
host
)
auth
=
credentials
.
authenticators
(
host
)
...
...
Misc/NEWS
Dosyayı görüntüle @
9513e34a
...
@@ -72,6 +72,8 @@ Extension modules
...
@@ -72,6 +72,8 @@ Extension modules
Library
Library
-------
-------
-
nntplib
does
now
allow
to
ignore
a
.
netrc
file
.
-
urllib2
now
recognizes
Basic
authentication
even
if
other
authentication
-
urllib2
now
recognizes
Basic
authentication
even
if
other
authentication
schemes
are
offered
.
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