[Patches] [ python-Patches-1755206 ] struni: corrections in ftplib
SourceForge.net
noreply at sourceforge.net
Tue Jul 17 22:45:40 CEST 2007
Patches item #1755206, was opened at 2007-07-16 20:46
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1755206&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 3000
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: Amaury Forgeot d'Arc (amauryf)
Assigned to: Guido van Rossum (gvanrossum)
Summary: struni: corrections in ftplib
Initial Comment:
test_ftplib now passes, but it only tests socket timeouts...
My corrections were based on runs like:
python -m ftplib ftp.gnu.org -l emacs
Note: In this kind of code, byte objects make the code more difficult:
- it is easy to forget the b prefix
eg: resp[:3] in (b'250', '200')
- getitem does not return a single byte:
eg: resp[0] == b'2'
Or should ftplib decode all the lines it receives?
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2007-07-17 16:45
Message:
Logged In: YES
user_id=6380
Originator: NO
I've checked in minimal changes that make ftplib work along those lines.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2007-07-17 15:15
Message:
Logged In: YES
user_id=6380
Originator: NO
You're right, it's ugly. I wonder if it makes more sense to change the
makefile() call to use 'r' for the mode, and adjust the various put*
methods to convert their argument to bytes? We could use "ASCII",
"Latin-1" or "UTF-8" for encoding, I don't really know if there are ftp
servers that do anything with non-ASCII characters or encodings. Maybe
adding the encoding as an option would be useful.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1755206&group_id=5470
More information about the Patches
mailing list