From c4432a94c063f9a40c460d2d0b961ce32eeb379a Mon Sep 17 00:00:00 2001 From: ucar-tmeyer Date: Wed, 12 Feb 2025 09:02:11 -0700 Subject: [PATCH] Remove pwd import so notebooks will run on Windows When running the notebooks on windows, you get a ModuleNotFoundError: No module named 'pwd' The code is attempting to import pwd, which is not a module available on Windows systems. The pwd module is specific to Unix-based systems (like Linux and macOS) for user and password management, so we removed it from the following files: dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py --- .../dstypes/com/raytheon/uf/common/auth/user/UserId.py | 8 ++------ .../dstypes/com/raytheon/uf/common/message/WsId.py | 5 +---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py index c5f697e..8f48a82 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py @@ -20,15 +20,11 @@ # File auto-generated against equivalent DynamicSerialize Java class -import os, pwd - +import os class UserId(object): def __init__(self, id = None): - if id is None: - self.id = pwd.getpwuid(os.getuid()).pw_name - else: - self.id = id + self.id = id def getId(self): return self.id diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py index d23e92b..58bc3f5 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py @@ -37,7 +37,6 @@ import struct import socket import os -import pwd import threading class WsId(object): @@ -48,8 +47,6 @@ class WsId(object): self.networkId = str(struct.unpack('