Skip to content

Commit cc52daf

Browse files
Any exception raised attempting to find the logged on user for logging
purposes is now ignored (#112).
1 parent cebde52 commit cc52daf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ oracledb 1.2.2 (TBD)
1313
Thin Mode Changes
1414
+++++++++++++++++
1515

16+
#) Any exception raised attempting to find the logged on user for logging
17+
purposes is now ignored
18+
(`issue 112 <https://github.com/oracle/python-oracledb/issues/112>`__).
1619
#) Fixed bug when binding OUT a NULL boolean value.
1720
(`issue 119 <https://github.com/oracle/python-oracledb/issues/119>`__).
1821

src/oracledb/impl/thin/utils.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2020, 2023, Oracle and/or its affiliates.
33
#
44
# This software is dual-licensed to you under the Universal Permissive License
55
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -36,7 +36,10 @@ class ConnectConstants:
3636
self.program_name = sys.executable
3737
self.machine_name = socket.gethostname()
3838
self.pid = str(os.getpid())
39-
self.user_name = getpass.getuser()
39+
try:
40+
self.user_name = getpass.getuser()
41+
except:
42+
self.user_name = ""
4043
self.terminal_name = "unknown"
4144
self.sanitized_program_name = self._sanitize(self.program_name)
4245
self.sanitized_machine_name = self._sanitize(self.machine_name)

0 commit comments

Comments
 (0)