mirror of
https://github.com/python/cpython
synced 2024-09-06 06:03:51 +00:00
#3911 FTP.makeport was giving bad port numbers
reviewed by Benjamin and Antoine
This commit is contained in:
parent
be17a11721
commit
3a53fbbfcf
|
@ -254,7 +254,7 @@ def sendport(self, host, port):
|
|||
port number.
|
||||
'''
|
||||
hbytes = host.split('.')
|
||||
pbytes = [repr(port/256), repr(port%256)]
|
||||
pbytes = [repr(port//256), repr(port%256)]
|
||||
bytes = hbytes + pbytes
|
||||
cmd = 'PORT ' + ','.join(bytes)
|
||||
return self.voidcmd(cmd)
|
||||
|
|
|
@ -348,7 +348,7 @@ def test_dir(self):
|
|||
self.client.dir(lambda x: l.append(x))
|
||||
self.assertEqual(''.join(l), LIST_DATA.replace('\r\n', ''))
|
||||
|
||||
def Xtest_makeport(self):
|
||||
def test_makeport(self):
|
||||
self.client.makeport()
|
||||
# IPv4 is in use, just make sure send_eprt has not been used
|
||||
self.assertEqual(self.server.handler.last_received_cmd, 'port')
|
||||
|
|
|
@ -22,6 +22,8 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
|
||||
|
||||
- Issue #3929: When the database cannot be opened, dbm.open() would incorrectly
|
||||
raise a TypeError: "'tuple' object is not callable" instead of the expected
|
||||
dbm.error.
|
||||
|
|
Loading…
Reference in a new issue