giampaolo / pyftpdlib

Extremely fast and scalable Python FTP server library
MIT License
1.67k stars 266 forks source link

Infinitely trying to start a new server when compiled. #640

Open Kayull opened 3 months ago

Kayull commented 3 months ago

Bit of a strange issue that I hope someone can shed some light on.

I have been trying to get the base script to work on various Macs, both Apple Silicon and Intel, and the base script works but only when run using python3 test.py.

Once I compile it then it tries to infinitely start a new server for some reason. I have compiled using Pyinstaller and cx_freeze, all the same issue.

The error I get is below:

[I 2024-07-10 12:55:18] concurrency model: async
[I 2024-07-10 12:55:18] masquerade (NAT) address: None
[I 2024-07-10 12:55:18] passive ports: None
[I 2024-07-10 12:55:18] >>> starting FTP server on :::2121, pid=32541 <<<
Traceback (most recent call last):
  File "test.py", line 40, in <module>
  File "test.py", line 30, in main
  File "pyftpdlib/servers.py", line 118, in __init__
  File "pyftpdlib/ioloop.py", line 1093, in bind_af_unspecified
OSError: [Errno 48] Address already in use
[32543] Failed to execute script 'test' due to unhandled exception!
Traceback (most recent call last):
  File "test.py", line 40, in <module>
  File "test.py", line 30, in main
  File "pyftpdlib/servers.py", line 118, in __init__
  File "pyftpdlib/ioloop.py", line 1093, in bind_af_unspecified
OSError: [Errno 48] Address already in use
[32549] Failed to execute script 'test' due to unhandled exception!
...Infinitely does this...

The only way I have managed to get a compiled version to work is by using subprocess with the command lines like python3 -m pyftpdlib -w

I have compiled on both macOS Sonoma and Ventura. Compiled using Python versions 3.9.6 and 3.12.1

Any suggestions are appreciated to try and figure out why this is happening.