Skip to content

Commit

Permalink
'os.getlogin()' => 'getpass.getuser()'
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-turner-1 committed Jan 9, 2025
1 parent fcc2faf commit 5a2c052
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/access_py_telemetry/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing import Any, Type, TypeVar, Iterable
import warnings
import os
import getpass
import datetime
import hashlib
import httpx
Expand Down Expand Up @@ -187,7 +187,7 @@ def _create_telemetry_record(
aren't. I've also modified __get__, so SessionID() evaluates to a string.
"""
telemetry_data = {
"name": os.getlogin(),
"name": getpass.getuser(),
"function": function_name,
"args": args,
"kwargs": kwargs,
Expand Down Expand Up @@ -237,7 +237,7 @@ def __get__(self, obj: object, objtype: type | None = None) -> str:

@staticmethod
def create_session_id() -> str:
login = os.getlogin()
login = getpass.getuser()
timestamp = datetime.datetime.now().isoformat()
session_str = f"{login}_{timestamp}"
session_id = hashlib.sha256((session_str).encode()).hexdigest()
Expand Down

0 comments on commit 5a2c052

Please sign in to comment.