This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jottbe
Recipients giampaolo.rodola, jottbe
Date 2018-03-26.09:42:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522057377.92.0.467229070634.issue33122@psf.upfronthosting.co.za>
In-reply-to
Content
Hi, thanks for tanking care of this issue.
I am mainly working on a windows client and connect to a z/OS host.
Attached you find the ftplib.py I patched to workaround this.

Here is the output of the list command which ends up in an exception (this time from a unix machine, where I still have found the unpatched version of ftplib.py): 

>>> ftplib.FTP_TLS.debugging=True
>>> conn=ftplib.FTP_TLS(host=url, user=user, passwd=passw)
*resp* '220-TCPFT000 IBM FTP CS V2R2 at tcpip06, 11:38:07 on 2018-03-26.\n220 Connection will close if idle for more than 5 minutes.'
*cmd* 'AUTH TLS'
*resp* '234 Security environment established - ready for negotiation'
*cmd* 'USER SBxxxxx'
*resp* '331 Send password please.'
*cmd* 'PASS ********'
*resp* '230 SBxxxxx is logged on.  Working directory is "SBxxxxx.".'
>>> conn.prot_p()
*cmd* 'PBSZ 0'
*resp* '200 Protection buffer size accepted'
*cmd* 'PROT P'
*resp* '200 Data connection protection set to private'
'200 Data connection protection set to private'
>>> conn.retrlines("LIST 'SBxxxxx.SBxxxxx.*'")
*cmd* 'TYPE A'
*resp* '200 Representation type is Ascii NonPrint'
*cmd* 'PASV'
*resp* '227 Entering Passive Mode (53,113,100,193,250,60)'
*cmd* "LIST 'SBxxxxx.SBxxxxx.*'"
*resp* '125 List started OK'
Volume Unit    Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
IDV101 3390   2018/03/21 16   68  VB    4092  4096  PS  'SBxxxxx.SBxxxxx.SPUFI.OUT'
Migrated                                                'SBxxxxx.SBxxxxx.SPUFI.SOAOUT'
IDV10T 3390   2018/03/08 13   62  VB    4092  4096  PS  'SBxxxxx.SBxxxxx.SPUFI.WHC'
Migrated                                                'SBxxxxx.SBxxxxx.VI870V'
Migrated                                                'SBxxxxx.SBxxxxx.VI871V'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/ftplib.py", line 484, in retrlines
    conn.unwrap()
  File "/usr/lib/python3.4/ssl.py", line 811, in unwrap
    s = self._sslobj.shutdown()
OSError: [Errno 0] Error
History
Date User Action Args
2018-03-26 09:43:01jottbesetrecipients: + jottbe, giampaolo.rodola
2018-03-26 09:42:57jottbesetmessageid: <1522057377.92.0.467229070634.issue33122@psf.upfronthosting.co.za>
2018-03-26 09:42:57jottbelinkissue33122 messages
2018-03-26 09:42:57jottbecreate