Issue1755206
Created on 2007-07-17 00:46 by amaury.forgeotdarc, last changed 2008-01-06 22:29 by admin.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
ftplib.diff
|
amaury.forgeotdarc,
2007-07-17 00:46
|
|
|
|
|
msg52895 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) |
Date: 2007-07-17 00:46 |
|
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?
|
|
msg52896 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-07-17 19:15 |
|
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.
|
|
msg52897 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-07-17 20:45 |
|
I've checked in minimal changes that make ftplib work along those lines.
|
|
| Date |
User |
Action |
Args |
| 2008-01-06 22:29:45 | admin | set | keywords:
- py3k versions:
+ Python 3.0 |
| 2007-07-17 00:46:10 | amaury.forgeotdarc | create | |
|