Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
60988bb2
Commit
60988bb2
authored
Dec 17, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
336d3a60
39ca45d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Lib/ftplib.py
Lib/ftplib.py
+7
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ftplib.py
View file @
60988bb2
...
...
@@ -273,21 +273,24 @@ class FTP:
def
makeport
(
self
):
'''Create a new socket and send a PORT command for it.'''
msg
=
"getaddrinfo returns an empty list"
err
=
None
sock
=
None
for
res
in
socket
.
getaddrinfo
(
None
,
0
,
self
.
af
,
socket
.
SOCK_STREAM
,
0
,
socket
.
AI_PASSIVE
):
af
,
socktype
,
proto
,
canonname
,
sa
=
res
try
:
sock
=
socket
.
socket
(
af
,
socktype
,
proto
)
sock
.
bind
(
sa
)
except
socket
.
error
,
msg
:
except
socket
.
error
,
err
:
if
sock
:
sock
.
close
()
sock
=
None
continue
break
if
not
sock
:
raise
socket
.
error
,
msg
if
sock
is
None
:
if
err
is
not
None
:
raise
err
else
:
raise
socket
.
error
(
"getaddrinfo returns an empty list"
)
sock
.
listen
(
1
)
port
=
sock
.
getsockname
()[
1
]
# Get proper port
host
=
self
.
sock
.
getsockname
()[
0
]
# Get proper host
...
...
Misc/NEWS
View file @
60988bb2
...
...
@@ -160,6 +160,9 @@ Core and Builtins
Library
-------
- Issue #16646: ftplib.FTP.makeport() might lose socket error details.
(patch by Serhiy Storchaka)
- Issue #16626: Fix infinite recursion in glob.glob() on Windows when the
pattern contains a wildcard in the drive or UNC path. Patch by Serhiy
Storchaka.
...
...
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