Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 640c1f8

Browse files
committed
Wrap getpwid in exception fixes:#1242
1 parent df48707 commit 640c1f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

raven/scripts/runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ def get_uid():
4040
import pwd
4141
except ImportError:
4242
return None
43-
return pwd.getpwuid(os.geteuid())[0]
44-
43+
try:
44+
return pwd.getpwuid(os.geteuid())[0]
45+
except KeyError: # Sometimes fails in containers
46+
return None
4547

4648
def send_test_message(client, options):
4749
sys.stdout.write("Client configuration:\n")

0 commit comments

Comments
 (0)