Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
FTP multiple threads, storbinary callback not called
-
I'm tying to perform multiple uploads to several FTP servers by using threads.
Threads seem to work but it seems that my callback code is not called when executing the storbinary command, even with callback=lambda block:print(len(block)). -
double check line 17. thats where your problem lies.
-
As I didn't post my source code, I suppose it's humor.
My code is very long and callback did function before I modified it for multiple threads, thus my question was "general", does need callback something special when executed in a thread run? -
@jonb Thanks for your hilarious post, it forced me to deeper check my source, and I found my error.
Sorry to have so quickly posted a topic, but I really had tried some hours... -
I told you... it is always line 17 :)
Out of curiosity... did you have to do anything special, or was it just a stupid bug?
-
Really stupid bug, just near line 17.😤
I had subs, for connecting, sending, deconnecting and I have integrated all theses subs in an inline code because I thought it would be easier to set it as able for multi thread due to a lot of variables (not easy to explain). And so, just before my storbinary line, I added an if (bad invention, isn't it?) and it was always False and my storbinary was not executed, thus also not it's callback. So easy, but I swear, I've tested during hours, and after your post, I've just done a code review...and I found this 🐜
Thanks for your patience for helping us so much.