Title: TLS end connection not detected properly in retrbinary
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: giampaolo.rodola Nosy List: adiroiban, giampaolo.rodola
Priority: normal Keywords:

Created on 2011-02-11 02:46 by adiroiban, last changed 2011-02-13 04:07 by adiroiban. This issue is now closed.

Messages (3)
msg128360 - (view) Author: Adi Roiban (adiroiban) Date: 2011-02-11 02:46
FTP_TLS.retrybinary should detect the end of a TLS read in the same way as FTP.TLS_retryline does.

it should be something like this... catching ssl.ZeroReturnError as a valid expection for signaling EOF.

                        data = conn.recv(blocksize)
                    except ssl.ZeroReturnError:
                        # pyOpenSSL does not return 0, but rather
                        # SSL.ZeroReturnError
                    if not data:
msg128373 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2011-02-11 10:57
Please provide more information.
Have you actually seen this happen?
retrlines method isn't currently looking for EOF.
msg128476 - (view) Author: Adi Roiban (adiroiban) Date: 2011-02-13 04:07

I apologies for raising this issues.

It looks like FTP_TLS is not available in Python 3.1 ... and retrbinary is working in Python 2.7.

What I actually done, was backporting from 2.7 to 2.5 and using pyOpenSSL instead of the standard ssl module.

It looks like the standard „ssl” module from 2.7 return 0 instead of ssl.ZeroReturnError.
Date User Action Args
2011-02-13 04:07:35adiroibansetstatus: open -> closed
versions: - Python 3.2, Python 3.3
nosy: giampaolo.rodola, adiroiban
messages: + msg128476

resolution: not a bug
2011-02-11 10:57:10giampaolo.rodolasetnosy: giampaolo.rodola, adiroiban
messages: + msg128373
2011-02-11 10:05:26pitrousetpriority: high -> normal
nosy: giampaolo.rodola, adiroiban
versions: - Python 3.1
type: crash -> behavior
stage: needs patch
2011-02-11 08:09:07georg.brandlsetpriority: normal -> high
assignee: giampaolo.rodola

nosy: + giampaolo.rodola
2011-02-11 02:46:58adiroibancreate