Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test suite failure in test_stou() - incorrectly parsed STOU response #27

Closed
giampaolo opened this issue May 28, 2014 · 2 comments
Closed
Assignees
Labels
bug Component-Unittest imported imported from old googlecode site and very likely outdated

Comments

@giampaolo
Copy link
Owner

From jlo...@gmail.com on July 20, 2007 09:37:17

What steps will reproduce the problem?  
1. run test suite prior to Revision 40 Running through the test suite on a 
Linux box to compare with OS X results,
there was a failure in test_stou() due to the filename being calculated as:

        filename = ftp.sendcmd('stou')[4:]

This caused a later call to os.remove to fail while trying to remove the
file "/path/to/my/test/suite/FILE: .0". The response from sendcmd is
actually in the below format:

        #filename comes in as  150 FILE: $filename

so I made the following change to the test suite to correctly remove the
prefix and also make it a little clearer how the filename was being parsed:

        filename = ftp.sendcmd('stou').replace('150 FILE: ', '')

Original issue: http://code.google.com/p/pyftpdlib/issues/detail?id=27

@giampaolo giampaolo self-assigned this May 28, 2014
@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on July 20, 2007 06:47:37

Yes, sorry, I forgot to add the uploaded version of test_ftpd.py including the
changes for STOU into SVN when I fixed issue #8 into FTPServer.py.
Just one thing: considering that we could get different response codes (125 if data
channel is already open, else 150) I would avoid using:

>>> filename = ftp.sendcmd('stou').replace('150 FILE: ', '')

...in favour of:

>>> filename = ftp.sendcmd('stou').split('FILE: ')[1]

Change applied into SVN revision #41 .
Closing out the issue.

Status: Fixed
Labels: Component-Unittest

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on May 02, 2008 11:31:13

Labels: Version-0.1.1 Milestone-0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component-Unittest imported imported from old googlecode site and very likely outdated
Projects
None yet
Development

No branches or pull requests

1 participant