The Samba-Bugzilla – Attachment 18245 Details for
Bug 15575
Remove unsupported "Final" keyword missing from Python 3.6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for Samba 4.20
bug15575-v4-20.patch (text/plain), 4.12 KB, created by
Jennifer Sutton
on 2024-02-08 18:20:09 UTC
(
hide
)
Description:
patch for Samba 4.20
Filename:
MIME Type:
Creator:
Jennifer Sutton
Created:
2024-02-08 18:20:09 UTC
Size:
4.12 KB
patch
obsolete
>From 9937cc69d48b9eeb52fbe0dfc4cf397f1619daa8 Mon Sep 17 00:00:00 2001 >From: Rob van der Linde <rob@catalyst.net.nz> >Date: Fri, 2 Feb 2024 12:54:41 +1300 >Subject: [PATCH 1/2] python: do not make use of typing.Final for python 3.6 > >Python 3.6 does not have typing.Final yet > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15575 > >Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> >Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >(cherry picked from commit ecc84aa448a962f1a224144bbb65f0cef36a4279) >--- > python/samba/nt_time.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/python/samba/nt_time.py b/python/samba/nt_time.py >index 69e01d611962..4518e90b158d 100644 >--- a/python/samba/nt_time.py >+++ b/python/samba/nt_time.py >@@ -18,18 +18,18 @@ > # > > import datetime >-from typing import Final, NewType >+from typing import NewType > > > NtTime = NewType("NtTime", int) > NtTimeDelta = NewType("NtTimeDelta", int) > > >-NT_EPOCH: Final = datetime.datetime( >+NT_EPOCH = datetime.datetime( > 1601, 1, 1, 0, 0, 0, 0, tzinfo=datetime.timezone.utc > ) >-NT_TICKS_PER_μSEC: Final = 10 >-NT_TICKS_PER_SEC: Final = NT_TICKS_PER_μSEC * 10**6 >+NT_TICKS_PER_μSEC = 10 >+NT_TICKS_PER_SEC = NT_TICKS_PER_μSEC * 10**6 > > > def _validate_nt_time(nt_time: NtTime) -> None: >-- >2.39.1 > > >From 940747dd4cbaafcd004c483212e5ff803a17345f Mon Sep 17 00:00:00 2001 >From: Jo Sutton <josutton@catalyst.net.nz> >Date: Fri, 2 Feb 2024 12:23:58 +1300 >Subject: [PATCH 2/2] =?UTF-8?q?python:=20Remove=20=E2=80=98typing.Final?= > =?UTF-8?q?=E2=80=99?= >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This is only present in Python 3.8 and above. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15575 > >Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >(cherry picked from commit d6fe66ddeeb99c550fa9a0f1abb845e6daf71f8a) >--- > python/samba/gkdi.py | 16 ++++++++-------- > python/samba/tests/gkdi.py | 4 ++-- > 2 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/python/samba/gkdi.py b/python/samba/gkdi.py >index 9e3abb58a2fb..4179263b769e 100644 >--- a/python/samba/gkdi.py >+++ b/python/samba/gkdi.py >@@ -20,7 +20,7 @@ > > from enum import Enum > from functools import total_ordering >-from typing import Final, Optional, Tuple >+from typing import Optional, Tuple > > from cryptography.hazmat.primitives import hashes > >@@ -30,14 +30,14 @@ from samba.ndr import ndr_pack, ndr_unpack > from samba.nt_time import NtTime, NtTimeDelta > > >-uint64_max: Final[int] = 2**64 - 1 >+uint64_max: int = 2**64 - 1 > >-L1_KEY_ITERATION: Final[int] = _glue.GKDI_L1_KEY_ITERATION >-L2_KEY_ITERATION: Final[int] = _glue.GKDI_L2_KEY_ITERATION >-KEY_CYCLE_DURATION: Final[NtTimeDelta] = _glue.GKDI_KEY_CYCLE_DURATION >-MAX_CLOCK_SKEW: Final[NtTimeDelta] = _glue.GKDI_MAX_CLOCK_SKEW >+L1_KEY_ITERATION: int = _glue.GKDI_L1_KEY_ITERATION >+L2_KEY_ITERATION: int = _glue.GKDI_L2_KEY_ITERATION >+KEY_CYCLE_DURATION: NtTimeDelta = _glue.GKDI_KEY_CYCLE_DURATION >+MAX_CLOCK_SKEW: NtTimeDelta = _glue.GKDI_MAX_CLOCK_SKEW > >-KEY_LEN_BYTES: Final = 64 >+KEY_LEN_BYTES = 64 > > > class Algorithm(Enum): >@@ -107,7 +107,7 @@ class UndefinedStartTime(Exception): > class Gkid: > __slots__ = ["_l0_idx", "_l1_idx", "_l2_idx"] > >- max_l0_idx: Final = 0x7FFF_FFFF >+ max_l0_idx = 0x7FFF_FFFF > > def __init__(self, l0_idx: int, l1_idx: int, l2_idx: int) -> None: > if not -1 <= l0_idx <= Gkid.max_l0_idx: >diff --git a/python/samba/tests/gkdi.py b/python/samba/tests/gkdi.py >index b59a837a9ca4..375b444414ce 100644 >--- a/python/samba/tests/gkdi.py >+++ b/python/samba/tests/gkdi.py >@@ -25,7 +25,7 @@ os.environ["PYTHONUNBUFFERED"] = "1" > > import datetime > import secrets >-from typing import Final, NewType, Optional, Tuple, Union >+from typing import NewType, Optional, Tuple, Union > > import ldb > >@@ -72,7 +72,7 @@ HResult = NewType("HResult", int) > RootKey = NewType("RootKey", ldb.Message) > > >-ROOT_KEY_START_TIME: Final = NtTime(KEY_CYCLE_DURATION + MAX_CLOCK_SKEW) >+ROOT_KEY_START_TIME = NtTime(KEY_CYCLE_DURATION + MAX_CLOCK_SKEW) > > > class GetKeyError(Exception): >-- >2.39.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
abartlet
:
review+
Actions:
View
Attachments on
bug 15575
: 18245