filesystem_spec icon indicating copy to clipboard operation
filesystem_spec copied to clipboard

Add ftptls

Open bartvaneswhiffle opened this issue 10 months ago • 7 comments

See #1580.

It is basically a copy of the FTP class in fsspec, with a modification to use FTP_TLS and one addtional change.

Please have a look at this.

bartvaneswhiffle avatar Apr 17 '24 15:04 bartvaneswhiffle

I've added tests (mostly copied from test_ftp.py, not all are yet working. Could use some help here :)

bartvaneswhiffle avatar Apr 18 '24 13:04 bartvaneswhiffle

Thanks for contributing!

Before going further, do you think it's possible to provide the extra features as options on the original FTP filesystem rather than create a new variant that is largely the same?

martindurant avatar Apr 18 '24 13:04 martindurant

No worries, in a sense we could give two additional arguments on the init of FTPFileSystem:

  • ssl=False
  • prot_p=False

Then we could modify the _connect to use either FTP or TLS_FTP and modify the init to activate prot_p if it's equal to True after setting the connection.

How does this sound to you?

bartvaneswhiffle avatar Apr 18 '24 13:04 bartvaneswhiffle

Yes, exactly.

For testing, you would need a secured server, of course, but you could essentially run all FTP tests with standard and secure servers.

martindurant avatar Apr 18 '24 13:04 martindurant

I've removed the the ftp_tls class and integrated it with the ftp class. Two tests are currently still failing: the test with caching (test_complex) and the test with transaction (test_transaction), not sure how to fix those?

bartvaneswhiffle avatar Apr 22 '24 10:04 bartvaneswhiffle

Ping: is this PR still progressing?

martindurant avatar May 29 '24 20:05 martindurant

Thanks for the reminder, so far I've not had the time to further implement the tests.

bartvaneswhiffle avatar May 30 '24 06:05 bartvaneswhiffle

I've found some time to update the tests. The pyftpdlib server has been replaced with script that starts a pyftpdlib server that accepts TLS. Furtermore, docstrings and codestyle improvements have been made.

@martindurant: Do you understand why the CI / downstream fails?

bartvaneswhiffle avatar Aug 08 '24 11:08 bartvaneswhiffle

Do you understand why the CI / downstream fails

Please merge from master and try again

martindurant avatar Aug 08 '24 16:08 martindurant

Do you understand why the CI / downstream fails

Please merge from master and try again

All checks have passed :)

bartvaneswhiffle avatar Aug 12 '24 08:08 bartvaneswhiffle