Skip to content

Commit 15718e9

Browse files
committed
update to python 3.12.5
1 parent 486eadb commit 15718e9

File tree

138 files changed

+945
-518
lines changed

Some content is hidden

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

138 files changed

+945
-518
lines changed

.github/workflows/CI_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
if: matrix.build_configuration == 'Release'
4444
working-directory: installer
4545
run: |
46-
$env:PYTHONBUILDDIR_X64='..\packages\python.3.12.4\tools'
47-
$env:PYTHONBUILDDIR='..\packages\pythonx86.3.12.4\tools'
46+
$env:PYTHONBUILDDIR_X64='..\packages\python.3.12.5\tools'
47+
$env:PYTHONBUILDDIR='..\packages\pythonx86.3.12.5\tools'
4848
Rename-Item -Path ".\buildPaths.bat.orig" -NewName "buildPaths.bat"
4949
$env:WIX_PATH="C:\Program Files (x86)\WiX Toolset v3.11\bin"
5050
$env:PATH = $env:PATH + ';' + $env:WIX_PATH

PythonLib/full/_pydatetime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,8 @@ def __new__(cls, year, month=None, day=None):
970970
@classmethod
971971
def fromtimestamp(cls, t):
972972
"Construct a date from a POSIX timestamp (like time.time())."
973+
if t is None:
974+
raise TypeError("'NoneType' object cannot be interpreted as an integer")
973975
y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
974976
return cls(y, m, d)
975977

PythonLib/full/_pydecimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def sin(x):
424424
# numbers.py for more detail.
425425

426426
class Decimal(object):
427-
"""Floating point class for decimal arithmetic."""
427+
"""Floating-point class for decimal arithmetic."""
428428

429429
__slots__ = ('_exp','_int','_sign', '_is_special')
430430
# Generally, the value of the Decimal instance is given by

PythonLib/full/argparse.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ def _get_kwargs(self):
18431843
# ==================================
18441844
def add_subparsers(self, **kwargs):
18451845
if self._subparsers is not None:
1846-
self.error(_('cannot have multiple subparser arguments'))
1846+
raise ArgumentError(None, _('cannot have multiple subparser arguments'))
18471847

18481848
# add the parser class to the arguments if it's not present
18491849
kwargs.setdefault('parser_class', type(self))
@@ -1895,8 +1895,11 @@ def _get_positional_actions(self):
18951895
def parse_args(self, args=None, namespace=None):
18961896
args, argv = self.parse_known_args(args, namespace)
18971897
if argv:
1898-
msg = _('unrecognized arguments: %s')
1899-
self.error(msg % ' '.join(argv))
1898+
msg = _('unrecognized arguments: %s') % ' '.join(argv)
1899+
if self.exit_on_error:
1900+
self.error(msg)
1901+
else:
1902+
raise ArgumentError(None, msg)
19001903
return args
19011904

19021905
def parse_known_args(self, args=None, namespace=None):
@@ -2175,7 +2178,7 @@ def consume_positionals(start_index):
21752178
self._get_value(action, action.default))
21762179

21772180
if required_actions:
2178-
self.error(_('the following arguments are required: %s') %
2181+
raise ArgumentError(None, _('the following arguments are required: %s') %
21792182
', '.join(required_actions))
21802183

21812184
# make sure all required groups had one option present
@@ -2191,7 +2194,7 @@ def consume_positionals(start_index):
21912194
for action in group._group_actions
21922195
if action.help is not SUPPRESS]
21932196
msg = _('one of the arguments %s is required')
2194-
self.error(msg % ' '.join(names))
2197+
raise ArgumentError(None, msg % ' '.join(names))
21952198

21962199
# return the updated namespace and the extra arguments
21972200
return namespace, extras
@@ -2218,7 +2221,7 @@ def _read_args_from_files(self, arg_strings):
22182221
arg_strings = self._read_args_from_files(arg_strings)
22192222
new_arg_strings.extend(arg_strings)
22202223
except OSError as err:
2221-
self.error(str(err))
2224+
raise ArgumentError(None, str(err))
22222225

22232226
# return the modified argument list
22242227
return new_arg_strings
@@ -2298,7 +2301,7 @@ def _parse_optional(self, arg_string):
22982301
for action, option_string, sep, explicit_arg in option_tuples])
22992302
args = {'option': arg_string, 'matches': options}
23002303
msg = _('ambiguous option: %(option)s could match %(matches)s')
2301-
self.error(msg % args)
2304+
raise ArgumentError(None, msg % args)
23022305

23032306
# if exactly one action matched, this segmentation is good,
23042307
# so return the parsed action
@@ -2358,7 +2361,7 @@ def _get_option_tuples(self, option_string):
23582361

23592362
# shouldn't ever get here
23602363
else:
2361-
self.error(_('unexpected option string: %s') % option_string)
2364+
raise ArgumentError(None, _('unexpected option string: %s') % option_string)
23622365

23632366
# return the collected option tuples
23642367
return result
@@ -2415,8 +2418,11 @@ def _get_nargs_pattern(self, action):
24152418
def parse_intermixed_args(self, args=None, namespace=None):
24162419
args, argv = self.parse_known_intermixed_args(args, namespace)
24172420
if argv:
2418-
msg = _('unrecognized arguments: %s')
2419-
self.error(msg % ' '.join(argv))
2421+
msg = _('unrecognized arguments: %s') % ' '.join(argv)
2422+
if self.exit_on_error:
2423+
self.error(msg)
2424+
else:
2425+
raise ArgumentError(None, msg)
24202426
return args
24212427

24222428
def parse_known_intermixed_args(self, args=None, namespace=None):

PythonLib/full/asyncio/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def run(self):
8989

9090

9191
if __name__ == '__main__':
92+
sys.audit("cpython.run_stdin")
93+
9294
loop = asyncio.new_event_loop()
9395
asyncio.set_event_loop(loop)
9496

PythonLib/full/asyncio/base_events.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,7 @@ async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None):
994994
except OSError as exc:
995995
msg = (
996996
f'error while attempting to bind on '
997-
f'address {laddr!r}: '
998-
f'{exc.strerror.lower()}'
997+
f'address {laddr!r}: {str(exc).lower()}'
999998
)
1000999
exc = OSError(exc.errno, msg)
10011000
my_exceptions.append(exc)
@@ -1561,7 +1560,7 @@ async def create_server(
15611560
except OSError as err:
15621561
msg = ('error while attempting '
15631562
'to bind on address %r: %s'
1564-
% (sa, err.strerror.lower()))
1563+
% (sa, str(err).lower()))
15651564
if err.errno == errno.EADDRNOTAVAIL:
15661565
# Assume the family is not enabled (bpo-30945)
15671566
sockets.pop()

PythonLib/full/calendar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ def weekday(year, month, day):
159159

160160

161161
def monthrange(year, month):
162-
"""Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
163-
year, month."""
162+
"""Return weekday of first day of month (0-6 ~ Mon-Sun)
163+
and number of days (28-31) for year, month."""
164164
if not 1 <= month <= 12:
165165
raise IllegalMonthError(month)
166166
day1 = weekday(year, month, 1)

PythonLib/full/code.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def showsyntaxerror(self, filename=None):
127127
else:
128128
# If someone has set sys.excepthook, we let that take precedence
129129
# over self.write
130-
sys.excepthook(type, value, tb)
130+
self._call_excepthook(type, value, tb)
131131

132132
def showtraceback(self):
133133
"""Display the exception that just occurred.
@@ -141,16 +141,29 @@ def showtraceback(self):
141141
sys.last_traceback = last_tb
142142
sys.last_exc = ei[1]
143143
try:
144-
lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
145144
if sys.excepthook is sys.__excepthook__:
145+
lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
146146
self.write(''.join(lines))
147147
else:
148148
# If someone has set sys.excepthook, we let that take precedence
149149
# over self.write
150-
sys.excepthook(ei[0], ei[1], last_tb)
150+
self._call_excepthook(ei[0], ei[1], last_tb)
151151
finally:
152152
last_tb = ei = None
153153

154+
def _call_excepthook(self, typ, value, tb):
155+
try:
156+
sys.excepthook(typ, value, tb)
157+
except SystemExit:
158+
raise
159+
except BaseException as e:
160+
e.__context__ = None
161+
print('Error in sys.excepthook:', file=sys.stderr)
162+
sys.__excepthook__(type(e), e, e.__traceback__.tb_next)
163+
print(file=sys.stderr)
164+
print('Original exception was:', file=sys.stderr)
165+
sys.__excepthook__(typ, value, tb)
166+
154167
def write(self, data):
155168
"""Write a string.
156169

PythonLib/full/colorsys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
__all__ = ["rgb_to_yiq","yiq_to_rgb","rgb_to_hls","hls_to_rgb",
2525
"rgb_to_hsv","hsv_to_rgb"]
2626

27-
# Some floating point constants
27+
# Some floating-point constants
2828

2929
ONE_THIRD = 1.0/3.0
3030
ONE_SIXTH = 1.0/6.0

PythonLib/full/concurrent/futures/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'ALL_COMPLETED',
2424
'CancelledError',
2525
'TimeoutError',
26+
'InvalidStateError',
2627
'BrokenExecutor',
2728
'Future',
2829
'Executor',

0 commit comments

Comments
 (0)