Skip to content

Commit e8aadae

Browse files
Merge pull request #1605 from jluebbe/suppress-grpc-error-message
remote/client: suppress gRPC error message on shutdown
2 parents 9636068 + 2dc889c commit e8aadae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

labgrid/remote/client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,13 @@ def main():
21692169
except Exception: # pylint: disable=broad-except
21702170
traceback.print_exc(file=sys.stderr)
21712171
exitcode = 2
2172+
if not args.debug:
2173+
# This is a workround for the gRPC issue
2174+
# https://github.com/grpc/grpc/issues/38679.
2175+
# Since Python 3.12, an empty exception message is printed from gRPC
2176+
# during shutdown, although nothing seems to go wrong. As this is
2177+
# confusing for users, suppress the message by closing stderr.
2178+
os.close(sys.stderr.fileno())
21722179
exit(exitcode)
21732180
else:
21742181
parser.print_help(file=sys.stderr)

0 commit comments

Comments
 (0)