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
b1436f18
Kaydet (Commit)
b1436f18
authored
Kas 09, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix IMAP.login() to work properly.
Also, add remote tests for imaplib (part of #4471).
üst
adffced3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
6 deletions
+48
-6
imaplib.py
Lib/imaplib.py
+3
-3
test_imaplib.py
Lib/test/test_imaplib.py
+43
-3
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/imaplib.py
Dosyayı görüntüle @
b1436f18
...
...
@@ -1054,10 +1054,10 @@ class IMAP4:
def
_quote
(
self
,
arg
):
arg
=
arg
.
replace
(
b
'
\\
'
,
b
'
\\\\
'
)
arg
=
arg
.
replace
(
b
'"'
,
b
'
\\
"'
)
arg
=
arg
.
replace
(
'
\\
'
,
'
\\\\
'
)
arg
=
arg
.
replace
(
'"'
,
'
\\
"'
)
return
b
'"'
+
arg
+
b
'"'
return
'"'
+
arg
+
'"'
def
_simple_command
(
self
,
name
,
*
args
):
...
...
Lib/test/test_imaplib.py
Dosyayı görüntüle @
b1436f18
...
...
@@ -10,7 +10,7 @@ import os.path
import
socketserver
import
time
from
test.support
import
reap_threads
,
verbose
from
test.support
import
reap_threads
,
verbose
,
transient_internet
import
unittest
try
:
...
...
@@ -192,8 +192,45 @@ class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
imap_class
=
IMAP4_SSL
def
test_main
():
class
RemoteIMAPTest
(
unittest
.
TestCase
):
host
=
'cyrus.andrew.cmu.edu'
port
=
143
username
=
'anonymous'
password
=
'pass'
imap_class
=
imaplib
.
IMAP4
def
setUp
(
self
):
with
transient_internet
(
self
.
host
):
self
.
server
=
self
.
imap_class
(
self
.
host
,
self
.
port
)
def
tearDown
(
self
):
if
self
.
server
is
not
None
:
self
.
server
.
logout
()
def
test_logincapa
(
self
):
self
.
assertTrue
(
'LOGINDISABLED'
in
self
.
server
.
capabilities
)
def
test_anonlogin
(
self
):
self
.
assertTrue
(
'AUTH=ANONYMOUS'
in
self
.
server
.
capabilities
)
rs
=
self
.
server
.
login
(
self
.
username
,
self
.
password
)
self
.
assertEqual
(
rs
[
0
],
'OK'
)
def
test_logout
(
self
):
rs
=
self
.
server
.
logout
()
self
.
assertEqual
(
rs
[
0
],
'BYE'
)
@unittest.skipUnless
(
ssl
,
"SSL not available"
)
class
RemoteIMAP_SSLTest
(
RemoteIMAPTest
):
port
=
993
imap_class
=
IMAP4_SSL
def
test_logincapa
(
self
):
self
.
assertFalse
(
'LOGINDISABLED'
in
self
.
server
.
capabilities
)
self
.
assertTrue
(
'AUTH=PLAIN'
in
self
.
server
.
capabilities
)
def
test_main
():
tests
=
[
TestImaplib
]
if
support
.
is_resource_enabled
(
'network'
):
...
...
@@ -203,7 +240,10 @@ def test_main():
"keycert.pem"
)
if
not
os
.
path
.
exists
(
CERTFILE
):
raise
support
.
TestFailed
(
"Can't read certificate files!"
)
tests
.
extend
([
ThreadedNetworkedTests
,
ThreadedNetworkedTestsSSL
])
tests
.
extend
([
ThreadedNetworkedTests
,
ThreadedNetworkedTestsSSL
,
RemoteIMAPTest
,
RemoteIMAP_SSLTest
,
])
support
.
run_unittest
(
*
tests
)
...
...
Misc/NEWS
Dosyayı görüntüle @
b1436f18
...
...
@@ -60,6 +60,8 @@ Core and Builtins
Library
-------
- Fix IMAP.login() to work properly.
- Issue #9244: multiprocessing pool worker processes could terminate
unexpectedly if the return value of a task could not be pickled. Only
the ``repr`` of such errors are now sent back, wrapped in an
...
...
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