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.

Title: FTPLib error when server returns byte message instead of string
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: andrei.avk, hugochiaxyz8, terry.reedy
Priority: normal Keywords:

Created on 2021-03-06 13:33 by hugochiaxyz8, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg388198 - (view) Author: Hugo Chia (hugochiaxyz8) Date: 2021-03-06 13:33

Above are some of the links mentioning the issue with the FTPLib module. It happens when the FTP server returns a byte message instead of a string. Ftplib expects a string and does not account for receiving a byte message
msg388561 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-03-12 22:22
3.7 only gets security fixes.  Please verify that this is an issue with 3.10, or at least 3.9, and give a reproducible test case.
msg388562 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-03-12 22:53
An exception exit is not a 'crash' for this tracker.  The latter is an indefinite hang or a no-exception stackoverflow or the Windows equivalent error box (or worse).  The linked issue appears to show an exception exit.
msg396934 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-07-04 01:15
This is an issue with cowrie, I've commented on it here: .

In short, cowrie overrides FTP class and opens `self.file` in binary mode. Various FTP methods will break or work incorrectly if `self.file` is in binary mode.

This can be closed as not a bug.
msg407695 - (view) Author: Andrei Kulakov (andrei.avk) * (Python triager) Date: 2021-12-05 00:48
Closing as third party. Cowrie overrides ftplib.FTP class and implements __init__ in a way that doesn't work properly with some other methods of `FTP` class.
Date User Action Args
2022-04-11 14:59:42adminsetgithub: 87584
2021-12-05 00:48:11andrei.avksetstatus: open -> closed
resolution: third party
messages: + msg407695

stage: resolved
2021-07-04 01:15:32andrei.avksetnosy: + andrei.avk
messages: + msg396934
2021-03-12 22:53:49terry.reedysettype: crash -> behavior
messages: + msg388562
title: FTPLib module crashes when server returns byte message instead of string -> FTPLib error when server returns byte message instead of string
2021-03-12 22:22:28terry.reedysetnosy: + terry.reedy
messages: + msg388561
2021-03-06 13:33:26hugochiaxyz8create