-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CCC command support to ftplib #56348
Comments
In FTPS, CCC command can be used to switch back to a clear-text control connection. |
Can you explain this a little more? + resp = self.voidcmd('CCC') Should the response be checked before calling unwrap()? |
voidcmd() expects a response code starting with "2" and automatically raises an exception otherwise. |
New changeset d2eacbbdaf57 by Giampaolo Rodola' in branch 'default': |
====================================================================== Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_ftplib.py", line 890, in test_ccc
self.client.sendcmd('noop')
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py", line 261, in sendcmd
return self.getresp()
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py", line 236, in getresp
raise error_proto(resp)
ftplib.error_proto: ��� Ôxéî¢��Ö®�º¸qh�Ñ�øcÞ�Å\³9úÓ�#ï�å200 noop ok |
http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/2792/steps/test/logs/stdio ====================================================================== Traceback (most recent call last):
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/test_ftplib.py", line 890, in test_ccc
self.client.sendcmd('noop')
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py", line 261, in sendcmd
return self.getresp()
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py", line 226, in getresp
resp = self.getmultiline()
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py", line 212, in getmultiline
line = self.getline()
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ftplib.py", line 199, in getline
line = self.file.readline()
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/socket.py", line 279, in readinto
return self._sock.recv_into(b)
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/ssl.py", line 392, in recv_into
return socket.recv_into(self, buffer, nbytes, flags)
socket.timeout: timed out |
Hmm... Reopening. I'll look into this later. |
The test is still failing on many buildbots. x86 Ubuntu Shared 3.x: ====================================================================== Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_ftplib.py", line 890, in test_ccc
self.client.sendcmd('noop')
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py", line 261, in sendcmd
return self.getresp()
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/ftplib.py", line 236, in getresp
raise error_proto(resp)
ftplib.error_proto: ��� �eÊc¯�öZÖ8N´��ýùô "PPC Tiger 3.x", "AMD64 Leopard 3.x", "x86 FreeBSD 6.4 3.x" and "x86 Tiger 3.x": ====================================================================== Traceback (most recent call last):
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/test/test_ftplib.py", line 890, in test_ccc
self.client.sendcmd('noop')
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/ftplib.py", line 261, in sendcmd
return self.getresp()
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/ftplib.py", line 226, in getresp
resp = self.getmultiline()
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/ftplib.py", line 212, in getmultiline
line = self.getline()
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/ftplib.py", line 199, in getline
line = self.file.readline()
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/socket.py", line 279, in readinto
return self._sock.recv_into(b)
File "/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86-2/build/Lib/ssl.py", line 392, in recv_into
return socket.recv_into(self, buffer, nbytes, flags)
socket.timeout: timed out |
The culprit here is the dummy FTP test server which does not complete the SSL shutdown procedure successfully. I believe it's better if we remove the self.client.sendcmd('noop') line. That's there in order to check that client and server can still "talk" after reverting the connection back to clear-text, but making the server doing this right is quite complicated, see for example: I don't want to include and maintain that monster into test_ftplib.py so I think I'll just remove that line from the tests. |
New changeset 0cef8cac71c8 by Giampaolo Rodola' in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: