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
95390763
Kaydet (Commit)
95390763
authored
Mar 31, 2001
tarafından
Moshe Zadka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- #119833 - close socket in smtplib if there was an error connecting
- #126863 - getopt long option handling fixed
üst
a60cde3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
16 deletions
+34
-16
getopt.py
Lib/getopt.py
+22
-15
smtplib.py
Lib/smtplib.py
+5
-1
NEWS
Misc/NEWS
+7
-0
No files found.
Lib/getopt.py
Dosyayı görüntüle @
95390763
...
...
@@ -65,8 +65,7 @@ def getopt(args, shortopts, longopts = []):
longopts
=
[
longopts
]
else
:
longopts
=
list
(
longopts
)
longopts
.
sort
()
while
args
and
args
[
0
][:
1
]
==
'-'
and
args
[
0
]
!=
'-'
:
while
args
and
args
[
0
]
.
startswith
(
'-'
)
and
args
[
0
]
!=
'-'
:
if
args
[
0
]
==
'--'
:
args
=
args
[
1
:]
break
...
...
@@ -80,9 +79,10 @@ def getopt(args, shortopts, longopts = []):
def
do_longs
(
opts
,
opt
,
longopts
,
args
):
try
:
i
=
opt
.
index
(
'='
)
opt
,
optarg
=
opt
[:
i
],
opt
[
i
+
1
:]
except
ValueError
:
optarg
=
None
else
:
opt
,
optarg
=
opt
[:
i
],
opt
[
i
+
1
:]
has_arg
,
opt
=
long_has_args
(
opt
,
longopts
)
if
has_arg
:
...
...
@@ -99,18 +99,25 @@ def do_longs(opts, opt, longopts, args):
# has_arg?
# full option name
def
long_has_args
(
opt
,
longopts
):
optlen
=
len
(
opt
)
for
i
in
range
(
len
(
longopts
)):
x
,
y
=
longopts
[
i
][:
optlen
],
longopts
[
i
][
optlen
:]
if
opt
!=
x
:
continue
if
y
!=
''
and
y
!=
'='
and
i
+
1
<
len
(
longopts
):
if
opt
==
longopts
[
i
+
1
][:
optlen
]:
raise
GetoptError
(
'option --
%
s not a unique prefix'
%
opt
,
opt
)
if
longopts
[
i
][
-
1
:]
in
(
'='
,
):
return
1
,
longopts
[
i
][:
-
1
]
return
0
,
longopts
[
i
]
raise
GetoptError
(
'option --
%
s not recognized'
%
opt
,
opt
)
possibilities
=
[
o
for
o
in
longopts
if
o
.
startswith
(
opt
)]
if
not
possibilities
:
raise
GetoptError
(
'option --
%
s not recognized'
%
opt
,
opt
)
# Is there an exact match?
if
opt
in
possibilities
:
return
0
,
opt
elif
opt
+
'='
in
possibilities
:
return
1
,
opt
# No exact match, so better be unique.
if
len
(
possibilities
)
>
1
:
# XXX since possibilities contains all valid continuations, might be
# nice to work them into the error msg
raise
GetoptError
(
'option --
%
s not a unique prefix'
%
opt
,
opt
)
assert
len
(
possibilities
)
==
1
unique_match
=
possibilities
[
0
]
has_arg
=
unique_match
.
endswith
(
'='
)
if
has_arg
:
unique_match
=
unique_match
[:
-
1
]
return
has_arg
,
unique_match
def
do_shorts
(
opts
,
optstring
,
shortopts
,
args
):
while
optstring
!=
''
:
...
...
Lib/smtplib.py
Dosyayı görüntüle @
95390763
...
...
@@ -214,7 +214,11 @@ class SMTP:
if
not
port
:
port
=
SMTP_PORT
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
if
self
.
debuglevel
>
0
:
print
'connect:'
,
(
host
,
port
)
self
.
sock
.
connect
((
host
,
port
))
try
:
self
.
sock
.
connect
((
host
,
port
))
except
socket
.
error
:
self
.
close
()
raise
(
code
,
msg
)
=
self
.
getreply
()
if
self
.
debuglevel
>
0
:
print
"connect:"
,
msg
return
(
code
,
msg
)
...
...
Misc/NEWS
Dosyayı görüntüle @
95390763
...
...
@@ -85,6 +85,13 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
- #233200 - cPickle did not use Py_BEGIN_ALLOW_THREADS.
- #125452 - shlex.shlex hungs when it encounters a string with an unmatched
quote
- #119833 - close socket in smtplib if there was an error connecting
- #126863 - getopt long option handling fixed
What's New in Python 2.0?
=========================
...
...
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