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
a5785b15
Kaydet (Commit)
a5785b15
authored
Eyl 29, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix NNTP when there's a ".netrc" file
üst
2620d81b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
nntplib.py
Lib/nntplib.py
+3
-2
test_nntplib.py
Lib/test/test_nntplib.py
+2
-1
No files found.
Lib/nntplib.py
Dosyayı görüntüle @
a5785b15
...
@@ -279,11 +279,12 @@ class _NNTPBase:
...
@@ -279,11 +279,12 @@ class _NNTPBase:
encoding
=
'utf-8'
encoding
=
'utf-8'
errors
=
'surrogateescape'
errors
=
'surrogateescape'
def
__init__
(
self
,
file
,
user
=
None
,
password
=
None
,
def
__init__
(
self
,
file
,
host
,
user
=
None
,
password
=
None
,
readermode
=
None
,
usenetrc
=
True
,
readermode
=
None
,
usenetrc
=
True
,
timeout
=
_GLOBAL_DEFAULT_TIMEOUT
):
timeout
=
_GLOBAL_DEFAULT_TIMEOUT
):
"""Initialize an instance. Arguments:
"""Initialize an instance. Arguments:
- file: file-like object (open for read/write in binary mode)
- 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
- user: username to authenticate with
- password: password to use with username
- password: password to use with username
- readermode: if true, send 'mode reader' command after
- readermode: if true, send 'mode reader' command after
...
@@ -933,7 +934,7 @@ class NNTP(_NNTPBase):
...
@@ -933,7 +934,7 @@ class NNTP(_NNTPBase):
self
.
port
=
port
self
.
port
=
port
self
.
sock
=
socket
.
create_connection
((
host
,
port
),
timeout
)
self
.
sock
=
socket
.
create_connection
((
host
,
port
),
timeout
)
file
=
self
.
sock
.
makefile
(
"rwb"
)
file
=
self
.
sock
.
makefile
(
"rwb"
)
_NNTPBase
.
__init__
(
self
,
file
,
user
,
password
,
_NNTPBase
.
__init__
(
self
,
file
,
host
,
user
,
password
,
readermode
,
usenetrc
,
timeout
)
readermode
,
usenetrc
,
timeout
)
def
_close
(
self
):
def
_close
(
self
):
...
...
Lib/test/test_nntplib.py
Dosyayı görüntüle @
a5785b15
...
@@ -12,6 +12,7 @@ TIMEOUT = 30
...
@@ -12,6 +12,7 @@ TIMEOUT = 30
# TODO:
# TODO:
# - test the `file` arg to more commands
# - test the `file` arg to more commands
# - test error conditions
# - test error conditions
# - test auth and `usenetrc`
class
NetworkedNNTPTestsMixin
:
class
NetworkedNNTPTestsMixin
:
...
@@ -255,7 +256,7 @@ class MockedNNTPTestsMixin:
...
@@ -255,7 +256,7 @@ class MockedNNTPTestsMixin:
# isn't seekable.
# isn't seekable.
file
=
io
.
BufferedRWPair
(
self
.
sio
,
self
.
sio
)
file
=
io
.
BufferedRWPair
(
self
.
sio
,
self
.
sio
)
kwargs
.
setdefault
(
'usenetrc'
,
False
)
kwargs
.
setdefault
(
'usenetrc'
,
False
)
self
.
server
=
nntplib
.
_NNTPBase
(
file
,
*
args
,
**
kwargs
)
self
.
server
=
nntplib
.
_NNTPBase
(
file
,
'test.server'
,
*
args
,
**
kwargs
)
return
self
.
server
return
self
.
server
...
...
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