Skip to content

Commit 218bf37

Browse files
committed
updated to python 3.9.6
1 parent a7ff392 commit 218bf37

File tree

109 files changed

+1245
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1245
-928
lines changed

PythonLib/full/_aix_support.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def _aix_tag(vrtl, bd):
1515
# type: (List[int], int) -> str
1616
# Infer the ABI bitwidth from maxsize (assuming 64 bit as the default)
1717
_sz = 32 if sys.maxsize == (2**31-1) else 64
18+
_bd = bd if bd != 0 else 9988
1819
# vrtl[version, release, technology_level]
19-
return "aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(vrtl[0], vrtl[1], vrtl[2], bd, _sz)
20+
return "aix-{:1x}{:1d}{:02d}-{:04d}-{}".format(vrtl[0], vrtl[1], vrtl[2], _bd, _sz)
2021

2122

2223
# extract version, release and technology level from a VRMF string
@@ -26,19 +27,20 @@ def _aix_vrtl(vrmf):
2627
return [int(v[-1]), int(r), int(tl)]
2728

2829

29-
def _aix_bosmp64():
30+
def _aix_bos_rte():
3031
# type: () -> Tuple[str, int]
3132
"""
3233
Return a Tuple[str, int] e.g., ['7.1.4.34', 1806]
33-
The fileset bos.mp64 is the AIX kernel. It's VRMF and builddate
34-
reflect the current ABI levels of the runtime environment.
34+
The fileset bos.rte represents the current AIX run-time level. It's VRMF and
35+
builddate reflect the current ABI levels of the runtime environment.
36+
If no builddate is found give a value that will satisfy pep425 related queries
3537
"""
36-
# We expect all AIX systems to have lslpp installed in this location
37-
out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.mp64"])
38+
# All AIX systems to have lslpp installed in this location
39+
out = subprocess.check_output(["/usr/bin/lslpp", "-Lqc", "bos.rte"])
3840
out = out.decode("utf-8")
3941
out = out.strip().split(":") # type: ignore
40-
# Use str() and int() to help mypy see types
41-
return (str(out[2]), int(out[-1]))
42+
_bd = int(out[-1]) if out[-1] != '' else 9988
43+
return (str(out[2]), _bd)
4244

4345

4446
def aix_platform():
@@ -47,11 +49,11 @@ def aix_platform():
4749
AIX filesets are identified by four decimal values: V.R.M.F.
4850
V (version) and R (release) can be retreived using ``uname``
4951
Since 2007, starting with AIX 5.3 TL7, the M value has been
50-
included with the fileset bos.mp64 and represents the Technology
52+
included with the fileset bos.rte and represents the Technology
5153
Level (TL) of AIX. The F (Fix) value also increases, but is not
5254
relevant for comparing releases and binary compatibility.
5355
For binary compatibility the so-called builddate is needed.
54-
Again, the builddate of an AIX release is associated with bos.mp64.
56+
Again, the builddate of an AIX release is associated with bos.rte.
5557
AIX ABI compatibility is described as guaranteed at: https://www.ibm.com/\
5658
support/knowledgecenter/en/ssw_aix_72/install/binary_compatability.html
5759
@@ -60,7 +62,7 @@ def aix_platform():
6062
e.g., "aix-6107-1415-32" for AIX 6.1 TL7 bd 1415, 32-bit
6163
and, "aix-6107-1415-64" for AIX 6.1 TL7 bd 1415, 64-bit
6264
"""
63-
vrmf, bd = _aix_bosmp64()
65+
vrmf, bd = _aix_bos_rte()
6466
return _aix_tag(_aix_vrtl(vrmf), bd)
6567

6668

@@ -79,7 +81,7 @@ def aix_buildtag():
7981
Return the platform_tag of the system Python was built on.
8082
"""
8183
# AIX_BUILDDATE is defined by configure with:
82-
# lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }'
84+
# lslpp -Lcq bos.rte | awk -F: '{ print $NF }'
8385
build_date = sysconfig.get_config_var("AIX_BUILDDATE")
8486
try:
8587
build_date = int(build_date)

PythonLib/full/_strptime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def __init__(self, locale_time=None):
201201
#XXX: Does 'Y' need to worry about having less or more than
202202
# 4 digits?
203203
'Y': r"(?P<Y>\d\d\d\d)",
204-
'z': r"(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)",
204+
'z': r"(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))",
205205
'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),
206206
'a': self.__seqToRE(self.locale_time.a_weekday, 'a'),
207207
'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'),

PythonLib/full/abc.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ def my_abstract_method(self, ...):
2828
class abstractclassmethod(classmethod):
2929
"""A decorator indicating abstract classmethods.
3030
31-
Deprecated, use 'classmethod' with 'abstractmethod' instead.
31+
Deprecated, use 'classmethod' with 'abstractmethod' instead:
32+
33+
class C(ABC):
34+
@classmethod
35+
@abstractmethod
36+
def my_abstract_classmethod(cls, ...):
37+
...
38+
3239
"""
3340

3441
__isabstractmethod__ = True
@@ -41,7 +48,14 @@ def __init__(self, callable):
4148
class abstractstaticmethod(staticmethod):
4249
"""A decorator indicating abstract staticmethods.
4350
44-
Deprecated, use 'staticmethod' with 'abstractmethod' instead.
51+
Deprecated, use 'staticmethod' with 'abstractmethod' instead:
52+
53+
class C(ABC):
54+
@staticmethod
55+
@abstractmethod
56+
def my_abstract_staticmethod(...):
57+
...
58+
4559
"""
4660

4761
__isabstractmethod__ = True
@@ -54,7 +68,14 @@ def __init__(self, callable):
5468
class abstractproperty(property):
5569
"""A decorator indicating abstract properties.
5670
57-
Deprecated, use 'property' with 'abstractmethod' instead.
71+
Deprecated, use 'property' with 'abstractmethod' instead:
72+
73+
class C(ABC):
74+
@property
75+
@abstractmethod
76+
def my_abstract_property(self):
77+
...
78+
5879
"""
5980

6081
__isabstractmethod__ = True

PythonLib/full/ast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,9 +1448,9 @@ def visit_Call(self, node):
14481448

14491449
def visit_Subscript(self, node):
14501450
def is_simple_tuple(slice_value):
1451-
# when unparsing a non-empty tuple, the parantheses can be safely
1451+
# when unparsing a non-empty tuple, the parentheses can be safely
14521452
# omitted if there aren't any elements that explicitly requires
1453-
# parantheses (such as starred expressions).
1453+
# parentheses (such as starred expressions).
14541454
return (
14551455
isinstance(slice_value, Tuple)
14561456
and slice_value.elts

PythonLib/full/bdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def dispatch_call(self, frame, arg):
117117
"""Invoke user function and return trace function for call event.
118118
119119
If the debugger stops on this function call, invoke
120-
self.user_call(). Raise BbdQuit if self.quitting is set.
120+
self.user_call(). Raise BdbQuit if self.quitting is set.
121121
Return self.trace_dispatch to continue tracing in this scope.
122122
"""
123123
# XXX 'arg' is no longer used

PythonLib/full/bz2.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,23 @@ def write(self, data):
226226
"""Write a byte string to the file.
227227
228228
Returns the number of uncompressed bytes written, which is
229-
always len(data). Note that due to buffering, the file on disk
230-
may not reflect the data written until close() is called.
229+
always the length of data in bytes. Note that due to buffering,
230+
the file on disk may not reflect the data written until close()
231+
is called.
231232
"""
232233
with self._lock:
233234
self._check_can_write()
235+
if isinstance(data, (bytes, bytearray)):
236+
length = len(data)
237+
else:
238+
# accept any data that supports the buffer protocol
239+
data = memoryview(data)
240+
length = data.nbytes
241+
234242
compressed = self._compressor.compress(data)
235243
self._fp.write(compressed)
236-
self._pos += len(data)
237-
return len(data)
244+
self._pos += length
245+
return length
238246

239247
def writelines(self, seq):
240248
"""Write a sequence of byte strings to the file.

PythonLib/full/configparser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,9 @@ def write(self, fp, space_around_delimiters=True):
907907
908908
If `space_around_delimiters' is True (the default), delimiters
909909
between keys and values are surrounded by spaces.
910+
911+
Please note that comments in the original configuration file are not
912+
preserved when writing the configuration back.
910913
"""
911914
if space_around_delimiters:
912915
d = " {} ".format(self._delimiters[0])
@@ -1005,7 +1008,7 @@ def _read(self, fp, fpname):
10051008
Configuration files may include comments, prefixed by specific
10061009
characters (`#' and `;' by default). Comments may appear on their own
10071010
in an otherwise empty line or may be entered in lines holding values or
1008-
section names.
1011+
section names. Please note that comments get stripped off when reading configuration files.
10091012
"""
10101013
elements_added = set()
10111014
cursect = None # None, or a dictionary

PythonLib/full/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen):
944944
_set_new_attribute(cls, '__repr__', _repr_fn(flds, globals))
945945

946946
if eq:
947-
# Create _eq__ method. There's no need for a __ne__ method,
947+
# Create __eq__ method. There's no need for a __ne__ method,
948948
# since python will call __eq__ and negate it.
949949
flds = [f for f in field_list if f.compare]
950950
self_tuple = _tuple_str('self', flds)

PythonLib/full/distutils/command/upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import io
1010
import hashlib
1111
from base64 import standard_b64encode
12-
from urllib.request import urlopen, Request, HTTPError
12+
from urllib.error import HTTPError
13+
from urllib.request import urlopen, Request
1314
from urllib.parse import urlparse
1415
from distutils.errors import DistutilsError, DistutilsOptionError
1516
from distutils.core import PyPIRCCommand

PythonLib/full/distutils/spawn.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,17 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
5959
if _cfg_target:
6060
_cfg_target_split = [int(x) for x in _cfg_target.split('.')]
6161
if _cfg_target:
62-
# ensure that the deployment target of build process is not less
63-
# than that used when the interpreter was built. This ensures
64-
# extension modules are built with correct compatibility values
62+
# Ensure that the deployment target of the build process is not
63+
# less than 10.3 if the interpreter was built for 10.3 or later.
64+
# This ensures extension modules are built with correct
65+
# compatibility values, specifically LDSHARED which can use
66+
# '-undefined dynamic_lookup' which only works on >= 10.3.
6567
cur_target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', _cfg_target)
66-
if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
68+
cur_target_split = [int(x) for x in cur_target.split('.')]
69+
if _cfg_target_split[:2] >= [10, 3] and cur_target_split[:2] < [10, 3]:
6770
my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: '
68-
'now "%s" but "%s" during configure'
71+
'now "%s" but "%s" during configure;'
72+
'must use 10.3 or later'
6973
% (cur_target, _cfg_target))
7074
raise DistutilsPlatformError(my_msg)
7175
env = dict(os.environ,

0 commit comments

Comments
 (0)