[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-10-30 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

> So can we close this?

Yes: retrbinary() and storbinary() can be used to get/send bytes.

Reopen the issue (or open another one) if we miss another problem.

--
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-10-21 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

- retrbinary() and storbinary() uses bytes (byte strings)
 - retrlines() and storlines() uses str (unicode strings) with 
charset=self.encoding
 - command is an unicode string converted to byte string with 
charset=self.encoding

So it's already possible to receive/send raw bytes, and forget my 
previous message.

I see a potential but minor problem: if the server is running a POSIX 
OS, it's not possible to open / rename / unlink a file with an invalid 
name. ftp might allow bytes filename, but I prefer to leave ftplib 
unchanged. If your FTP server is broken, fix your file system, fix your 
configuration or use an old FTP client to fix the problem.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-10-21 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Function result type should be the same of the connection is in text 
mode or binary mode. As far as I remember, the text mode converts the 
newline byte sequence, not the charset. A text file could be stored as 
latin-1, utf-8, koi-8 or anything else. Am I wrong?

ftplib should use byte strings (as I did for POP3, IMAP4 or some other 
libraries) because the FTP protocol doesn't send the charset.

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-10-20 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

So can we close this?

--
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-09-21 Thread Giampaolo Rodola'

Giampaolo Rodola' <[EMAIL PROTECTED]> added the comment:

Actually the 'r' flag is used against the control connection which is
not supposed to receive any "binary" data and in FTP.retrlines method
which is supposed to retrieve data in line mode.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2008-03-19 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' <[EMAIL PROTECTED]>:


--
nosy: +giampaolo.rodola

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1248] ftplib needs a rewrite to use bytes/buffers

2007-10-08 Thread Brett Cannon

New submission from Brett Cannon:

For instance, ftplib.FTP reads from sockets using socket.makefile(), but
in text mode.  That's bad when the data could be in the format of ASCII
or binary data.

--
components: Library (Lib)
keywords: py3k
messages: 56281
nosy: brett.cannon
priority: normal
severity: major
status: open
title: ftplib needs a rewrite to use bytes/buffers
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com