From 3287ea328f76da7e5ff6cc148fdbd5afe33099dd Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Thu, 20 Apr 2023 00:22:49 +0200 Subject: fix failing users() test; update HISTORY; give CREDITS to @0-wiz-0 for #2241 Signed-off-by: Giampaolo Rodola --- CREDITS | 2 +- HISTORY.rst | 8 ++++++++ psutil/tests/test_posix.py | 11 +++++++++-- scripts/internal/generate_manifest.py | 7 +++---- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CREDITS b/CREDITS index c845a8c6..f5888fb7 100644 --- a/CREDITS +++ b/CREDITS @@ -85,7 +85,7 @@ I: 18 N: Thomas Klausner W: https://github.com/0-wiz-0 D: NetBSD implementation (co-author). -I: 557, 2128 +I: 557, 2128, 2241 N: Ryo Onodera W: https://github.com/ryoon diff --git a/HISTORY.rst b/HISTORY.rst index fb74f367..1a79b360 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,5 +1,13 @@ *Bug tracker at https://github.com/giampaolo/psutil/issues* +5.9.6 (IN DEVELOPMENT) +====================== + +XXXX-XX-XX + +- 2241_, [NetBSD]: can't compile On NetBSD 10.99.3/amd64. (patch by Thomas + Klausner) + 5.9.5 ===== diff --git a/psutil/tests/test_posix.py b/psutil/tests/test_posix.py index 8ea6cf7c..9ce82cae 100755 --- a/psutil/tests/test_posix.py +++ b/psutil/tests/test_posix.py @@ -358,6 +358,7 @@ class TestSystemAPIs(PsutilTestCase): out = sh("who -u") if not out.strip(): raise self.skipTest("no users on this system") + tstamp = None # '2023-04-11 09:31' (Linux) started = re.findall(r"\d\d\d\d-\d\d-\d\d \d\d:\d\d", out) if started: @@ -368,8 +369,14 @@ class TestSystemAPIs(PsutilTestCase): if started: tstamp = "%b %d %H:%M" else: - raise ValueError( - "cannot interpret tstamp in who output\n%s" % (out)) + # 'Apr 10' + started = re.findall(r"[A-Z][a-z][a-z] \d\d", out) + if started: + tstamp = "%b %d" + + if not tstamp: + raise ValueError( + "cannot interpret tstamp in who output\n%s" % (out)) with self.subTest(psutil=psutil.users(), who=out): for idx, u in enumerate(psutil.users()): psutil_value = datetime.datetime.fromtimestamp( diff --git a/scripts/internal/generate_manifest.py b/scripts/internal/generate_manifest.py index 3d3e83b0..b7ad8c7e 100755 --- a/scripts/internal/generate_manifest.py +++ b/scripts/internal/generate_manifest.py @@ -23,16 +23,15 @@ def sh(cmd): def main(): - files = [] + files = set() for file in sh("git ls-files").split('\n'): if file.startswith(SKIP_PREFIXES) or \ os.path.splitext(file)[1].lower() in SKIP_EXTS or \ file in SKIP_FILES: continue - if file not in files: - files.append(file) + files.add(file) - for file in files: + for file in sorted(files): print("include " + file) -- cgit v1.2.1