Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit344f425

Browse files
committed
Fix SF bug [ 599838 ] httplib.connect broken in 2.1 branch
Some IPv6-specific changes crept into the 2.1 branch when I backportedother bug fixes.
1 parent4fa82fa commit344f425

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

‎Lib/httplib.py‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -505,25 +505,10 @@ def set_debuglevel(self, level):
505505

506506
defconnect(self):
507507
"""Connect to the host and port specified in __init__."""
508-
msg="getaddrinfo returns an empty list"
509-
forresinsocket.getaddrinfo(self.host,self.port,0,
510-
socket.SOCK_STREAM):
511-
af,socktype,proto,canonname,sa=res
512-
try:
513-
self.sock=socket.socket(af,socktype,proto)
514-
ifself.debuglevel>0:
515-
print"connect: (%s, %s)"% (self.host,self.port)
516-
self.sock.connect(sa)
517-
exceptsocket.error,msg:
518-
ifself.debuglevel>0:
519-
print'connect fail:', (self.host,self.port)
520-
ifself.sock:
521-
self.sock.close()
522-
self.sock=None
523-
continue
524-
break
525-
ifnotself.sock:
526-
raisesocket.error,msg
508+
self.sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
509+
ifself.debuglevel>0:
510+
print"connect: (%s, %s)"% (self.host,self.port)
511+
self.sock.connect((self.host,self.port))
527512

528513
defclose(self):
529514
"""Close the connection to the HTTP server."""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp