Skip to content

Update test compat with pyftpdlib>=1.5.10 #591

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

Closed

Conversation

mweinelt
Copy link

Type of changes

  • Bug fix

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

The pyftpdlib library in version 1.5.10 renamed the ThreadedTestFTPd to FtpdThreadWrapper. I've updated that reference and ran the tests. I also updated the version requirement to my best knowledge.

musicinmybrain added a commit to musicinmybrain/pyfilesystem2 that referenced this pull request Jun 14, 2025
@musicinmybrain
Copy link

This seems to be on the right track, but doesn’t seem quite right at the moment. It looks like pyftpdlib 1.5.10 still has ThreadedTestFTPd, and FtpdThreadWrapper was introduced in pyftpdlib 2.0.

https://github.com/giampaolo/pyftpdlib/blob/3cea779de3ccb5ab5744220de3bddb3d4ff10f35/pyftpdlib/test/__init__.py#L445

Also, there is another use of ThreadedTestFTPd in TestAnonFTPFS that needs to be adjusted:

@mark.slow
@unittest.skipIf(platform.python_implementation() == "PyPy", "ftp unreliable with PyPy")
class TestAnonFTPFS(FSTestCases, unittest.TestCase):
user = "anonymous"
pasw = ""
@classmethod
def setUpClass(cls):
from pyftpdlib.test import ThreadedTestFTPd
super(TestAnonFTPFS, cls).setUpClass()
cls._temp_dir = tempfile.mkdtemp("ftpfs2tests")
cls._temp_path = os.path.join(cls._temp_dir, text_type(uuid.uuid4()))
os.mkdir(cls._temp_path)
cls.server = ThreadedTestFTPd()

I used this PR as inspiration for #595.

@mweinelt
Copy link
Author

Back then I applied a substitution downstream, so in practice I arrived at the same result as #595, and missed that it touched two tests. Thanks!

@mweinelt mweinelt closed this Jun 14, 2025
@mweinelt mweinelt deleted the pyftpdlib-1.5.10-compat branch June 14, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants