Join GitHub today
Don't call os.pid() the default kwargs to atexit_print_messages #3005
So this actually doesn't work, at least not in the way it was intended to.
This code was intended to fix the problem if the client forks. While it doesn't fork anymore (but might in the future), the problem we were having is we registered
Default arguments are evaluated when the function is defined. This allowed us to set the default value of
The code proposed in this PR removes this protection though and messages will be printed for every exiting process. There are other solutions though. We could create a global variable or have
Hopefully this makes sense! Let me know if you have any questions.
Ahhhhh. :) Apologies for not spotting this but, on the other hand, it's the sort of thing that would definitely deserve a large/scary comment, if only to prevent someone helpfully following the instructions of a linter to remove dangerous-looking default arguments.
@bmw I've updated this PR to match and documented this behaviour explicitly.