Any exception raised attempting to find the logged on user for logging

purposes is now ignored (#112).
This commit is contained in:
Anthony Tuininga 2023-01-18 10:03:20 -07:00
parent cebde524d0
commit cc52daf97b
2 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,9 @@ oracledb 1.2.2 (TBD)
Thin Mode Changes
+++++++++++++++++
#) Any exception raised attempting to find the logged on user for logging
purposes is now ignored
(`issue 112 <https://github.com/oracle/python-oracledb/issues/112>`__).
#) Fixed bug when binding OUT a NULL boolean value.
(`issue 119 <https://github.com/oracle/python-oracledb/issues/119>`__).

View File

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
# Copyright (c) 2020, 2023, Oracle and/or its affiliates.
#
# This software is dual-licensed to you under the Universal Permissive License
# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@ -36,7 +36,10 @@ class ConnectConstants:
self.program_name = sys.executable
self.machine_name = socket.gethostname()
self.pid = str(os.getpid())
self.user_name = getpass.getuser()
try:
self.user_name = getpass.getuser()
except:
self.user_name = ""
self.terminal_name = "unknown"
self.sanitized_program_name = self._sanitize(self.program_name)
self.sanitized_machine_name = self._sanitize(self.machine_name)