mirror of https://github.com/python/cpython
Default to passive mode. See SF bug #126851.
This is slightly controversial, but after reading the argumentation in the bug tracker for and against, I believe this is the right solution. Let me know if it breaks for you, and how.
This commit is contained in:
parent
3f819ec2ed
commit
e6ccf3ab96
|
@ -113,7 +113,7 @@ class FTP:
|
||||||
- port: port to connect to (integer, default previous port)'''
|
- port: port to connect to (integer, default previous port)'''
|
||||||
if host: self.host = host
|
if host: self.host = host
|
||||||
if port: self.port = port
|
if port: self.port = port
|
||||||
self.passiveserver = 0
|
self.passiveserver = 1
|
||||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
self.sock.connect((self.host, self.port))
|
self.sock.connect((self.host, self.port))
|
||||||
self.file = self.sock.makefile('rb')
|
self.file = self.sock.makefile('rb')
|
||||||
|
|
Loading…
Reference in New Issue