[Python 3] fork code harmonizing

Authored by ghane on Mar 14 2022, 10:41 AM.



fixes error in Python3 running in fork mode

Code harmonized with code in def run of kolabd/ and wallace/

Diff Detail

rP pykolab
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ghane requested review of this revision.Mar 14 2022, 10:41 AM
ghane created this revision.
sicherha requested changes to this revision.Mar 14 2022, 11:51 PM
sicherha added a subscriber: sicherha.

Could you add to the summary of this differential a description of the concrete error that is being solved here? I presume that some part of Python (which one?) complained about one of the file descriptors for stdin/ stdout/ stderr being unavailable, but it would be great to make that explicit.

This revision now requires changes to proceed.Mar 14 2022, 11:51 PM
ghane added a comment.Mar 15 2022, 1:37 AM

with --fork

testsaslauthd -u user(@domain) -p password
0: NO "authentication failed"

  • Logging error ---

Traceback (most recent call last):

File "/usr/lib/python3.x/logging/", line 1037, in emit
  stream.write(msg + self.terminator)

BrokenPipeError: [Errno 32] Broken pipe
Call stack:

File "./", line 43, in <module>

Message: "Authentication for 'user(@domain)' succeeded"

I tried to localize the error on other parts of the code, but I couldn't localize.
without --fork the code worked.

testsaslauthd -u user(@domain) -p password
0: OK "Success."

I just checked against the same fork code snippet on wallace and kolabd, C&P the missing code part and it worked.

So I just harmonized the fork code in def run on the daemon.

sicherha accepted this revision.Mar 16 2022, 10:28 PM
This revision is now accepted and ready to land.Mar 16 2022, 10:28 PM
This revision was automatically updated to reflect the committed changes.