[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Feb 2 19:54:02 UTC 2021


The branch, master has been updated
       via  35459b753af selftest: Add support for python-dateutil >= 2.7.1
       via  273a3c089d6 selftest: Directly import python-iso8601
       via  30450bff669 python:subunit: Use UTC timezone from datatime module
      from  0a93f5367bc s3:smbd: Fix invalid memory access in posix_sys_acl_blob_get_fd()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 35459b753aff4dfa7c7e7c70c9783844705a42c0
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Feb 2 13:44:01 2021 +0100

    selftest: Add support for python-dateutil >= 2.7.1
    
    This uses the more widespread python-dateutil instead of python-iso8601.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Tue Feb  2 19:53:35 UTC 2021 on sn-devel-184

commit 273a3c089d6ada16a9101ab81f901f99c1d55485
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Feb 2 13:11:56 2021 +0100

    selftest: Directly import python-iso8601
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit 30450bff66982eb7295d7a00be42052cbd6ad596
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Feb 1 10:38:08 2021 +0100

    python:subunit: Use UTC timezone from datatime module
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/subunit/__init__.py |  3 ---
 python/samba/subunit/run.py      |  6 ++----
 selftest/subunithelper.py        | 10 ++++++++--
 3 files changed, 10 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/subunit/__init__.py b/python/samba/subunit/__init__.py
index fef06ffa1cd..f823172dcb6 100644
--- a/python/samba/subunit/__init__.py
+++ b/python/samba/subunit/__init__.py
@@ -18,9 +18,6 @@
 """Subunit test protocol."""
 
 import samba
-
-import iso8601
-
 import unittest
 
 
diff --git a/python/samba/subunit/run.py b/python/samba/subunit/run.py
index e369b15aa02..45425e6c2e6 100755
--- a/python/samba/subunit/run.py
+++ b/python/samba/subunit/run.py
@@ -24,8 +24,6 @@
   $ python -m samba.subunit.run mylib.tests.test_suite
 """
 
-from iso8601.iso8601 import UTC
-
 import datetime
 import os
 import sys
@@ -184,7 +182,7 @@ class TestProtocolClient(unittest.TestResult):
 
         ":param datetime: A datetime.datetime object.
         """
-        time = a_datetime.astimezone(UTC)
+        time = a_datetime.astimezone(datetime.timezone.utc)
         self._stream.write("time: %04d-%02d-%02d %02d:%02d:%02d.%06dZ\n" % (
             time.year, time.month, time.day, time.hour, time.minute,
             time.second, time.microsecond))
@@ -458,7 +456,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator):
         time = self._time
         if time is not None:
             return
-        time = datetime.datetime.utcnow().replace(tzinfo=UTC)
+        time = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
         self.decorated.time(time)
 
     @property
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index 4fbb5442839..fd356d92156 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -24,8 +24,14 @@ import sys
 import os
 from samba import subunit
 from samba.subunit.run import TestProtocolClient
-from samba.subunit import iso8601
 import unittest
+try:
+    from dateutil.parser import isoparse as iso_parse_date
+except ImportError:
+    try:
+        from iso8601 import parse_date as iso_parse_date;
+    except ImportError:
+        print('Install either python-dateutil >= 2.7.1 or python-iso8601')
 
 
 VALID_RESULTS = set(['success', 'successful', 'failure', 'fail', 'skip',
@@ -63,7 +69,7 @@ def parse_results(msg_ops, statistics, fh):
         elif command == "time":
             msg_ops.control_msg(l)
             try:
-                dt = iso8601.parse_date(arg.rstrip("\n"))
+                dt = iso_parse_date(arg.rstrip("\n"))
             except TypeError as e:
                 print("Unable to parse time line: %s" % arg.rstrip("\n"))
             else:


-- 
Samba Shared Repository



More information about the samba-cvs mailing list