classification
Title: ftplib storelines does not honor strings returned in fp.readline
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Error calling .storlines from ftplib
View: 6822
Assigned To: Nosy List: aymanhs, giampaolo.rodola
Priority: normal Keywords:

Created on 2009-08-27 07:18 by aymanhs, last changed 2010-04-17 21:13 by r.david.murray. This issue is now closed.

Messages (2)
msg91997 - (view) Author: Ayman (aymanhs) Date: 2009-08-27 07:18
in ftplibs.storlines, a call is done on what should be a Text stream:
fp.readline()
This would work in pre 3.x as it returns bytes but now that readlines
returns a string, the call at lines 477 would fail:

  File "C:\Python31\lib\ftplib.py", line 477, in storlines
    if buf[-1] in B_CRLF: buf = buf[:-1]
TypeError: Type str doesn't support the buffer API

The readline call should then be encoded().
msg103425 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-04-17 19:17
Closed as a duplicate of 6822 which provides a patch.
History
Date User Action Args
2010-04-17 21:13:52r.david.murraysetpriority: normal
type: crash -> behavior
superseder: Error calling .storlines from ftplib
stage: resolved
2010-04-17 19:17:48giampaolo.rodolasetstatus: open -> closed

nosy: + giampaolo.rodola
messages: + msg103425

resolution: duplicate
2009-08-27 07:18:16aymanhscreate