classification
Title: ftplib.FTP.makeport() bug
Type: Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, giampaolo.rodola
Priority: release blocker Keywords: patch

Created on 2008-09-19 18:08 by giampaolo.rodola, last changed 2008-09-27 22:04 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
ftplib.patch giampaolo.rodola, 2008-09-19 18:08
Messages (7)
msg73435 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-09-19 18:08
Python 3.0rc1 (r30rc1:66507, Sep 18 2008, 14:47:08) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> f = ftplib.FTP()
>>> f.connect('mirrors.kernel.org')
'220 Welcome to mirrors.kernel.org.'
>>> f.login()
'230 Login successful.'
>>> f.debugging = 1
>>> f.makeport()
*cmd* 'PORT 10,0,0,1,18.21875,56'
*resp* '500 Illegal PORT command.'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python30\lib\ftplib.py", line 300, in makeport
    resp = self.sendport(host, port)
  File "C:\python30\lib\ftplib.py", line 260, in sendport
    return self.voidcmd(cmd)
  File "C:\python30\lib\ftplib.py", line 249, in voidcmd
    return self.voidresp()
  File "C:\python30\lib\ftplib.py", line 224, in voidresp
    resp = self.getresp()
  File "C:\python30\lib\ftplib.py", line 219, in getresp
    raise error_perm(resp)
ftplib.error_perm: 500 Illegal PORT command.
>>>



Path in attachment.
msg73444 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-19 23:16
Why not just use floor divide (//)?
msg73445 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-09-19 23:23
At your discretion. I was thinking that it's not encouraging that such
an outstanding bug has passed silently until RC1. IMHO, a minimal test
suite for the ftplib module would be really necessary.

A dummy FTP server returning fixed response codes could be arranged and
used to test the basic FTP class methods.
msg73446 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-19 23:24
On Fri, Sep 19, 2008 at 6:23 PM, Giampaolo Rodola'
<report@bugs.python.org> wrote:
>
> Giampaolo Rodola' <billiejoex@users.sourceforge.net> added the comment:
>
> At your discretion. I was thinking that it's not encouraging that such
> an outstanding bug has passed silently until RC1. IMHO, a minimal test
> suite for the ftplib module would be really necessary.

Yes, testing of some of these modules is quite sad.

>
> A dummy FTP server returning fixed response codes could be arranged and
> used to test the basic FTP class methods.

Would you like to contribute a patch?
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3911>
> _______________________________________
>
msg73470 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-09-20 19:58
> Would you like to contribute a patch?

Ok.
I started working on a patch which implements a dummy asyncore-based FTP
server including tests for all basic FTP() class methods.
I'll contribute a patch as soon as I'll wrote IPv6 tests.
msg73606 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-09-22 23:44
> Would you like to contribute a patch?

Done in issue #3939.
msg73942 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-27 22:04
Fixed in r66656.
History
Date User Action Args
2008-09-27 22:04:39benjamin.petersonsetstatus: open -> closed
priority: release blocker
resolution: fixed
messages: + msg73942
2008-09-22 23:44:57giampaolo.rodolasetmessages: + msg73606
2008-09-20 19:58:13giampaolo.rodolasetmessages: + msg73470
2008-09-19 23:24:36benjamin.petersonsetmessages: + msg73446
2008-09-19 23:23:24giampaolo.rodolasetmessages: + msg73445
2008-09-19 23:16:40benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg73444
2008-09-19 18:08:01giampaolo.rodolacreate