Open oz123 opened 7 years ago
Well, I guess it's impossible to figure this out without seeing any code. What does the test FTP server looks like? Is it a thread test FTP server similar to the one used in pyftpdlib test suite?
@giampaolo Thanks for the reply, the code for ftpserver is linked above in my repository. But here is it again: https://raw.githubusercontent.com/oz123/pytest-localftpserver/3a1ddeb85fa4dc379ae2015d1aab5c10601e54a5/pytest_localftpserver/plugin.py
Currently, I changed the code to work with mutliprocessing, and it seems to work better.
Having the same issue almost 5 and a half years later
It seems that having abc.py
contain the FTPServer
object and having xyz.py
import it and call threading.Thread(target=abc.server.serve_forever).start()
causes the issue. Starting the thread in abc.py
doesn't cause an issue
Edit: Actually it seems to throw an error about binding to the same port twice???
File "C:\Users\...\AppData\Local\Programs\Python\Python310\lib\site-packages\pyftpdlib\servers.py", line 118, in __init__
self.bind_af_unspecified(address_or_socket)
File "C:\Users\...\AppData\Local\Programs\Python\Python310\lib\site-packages\pyftpdlib\ioloop.py", line 1018, in bind_af_unspecified
raise socket.error(err)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
did you find any solution? @Scripter17
Sadly no
I'm busy today and tomorrow but I'll see if I can figure it out
I am not sure this is a bug, maybe it is. I wrote a plugin for pytest which creates a test fixture with an simple FTPD waiting for requests.
The code is found here: https://github.com/oz123/pytest-localftpserver
My issue is that the call for the
server.start()
is running while invoking a test module, but it is not while running the test suite. I am not sure how to solve this problem.Here is an output of test runs:
This just hangs there indefinitely ...
When I run the last test module by it's own, everything is fun:
This is the contents of that test_module: