mirror of https://github.com/python/cpython
Issue #17220: two fixes for changeset 2528e4aea338.
First, because the mtime can exceed 4 bytes, make sure to mask it down to 4 bytes before getting its little-endian representation for writing out to a .pyc file. Two, cap an rsplit() call to 1 split, else can lead to too many values being returned for unpacking.
This commit is contained in:
parent
91d0ca72de
commit
c190389834
|
@ -48,7 +48,7 @@ def _w_long(x):
|
|||
XXX Temporary until marshal's long functions are exposed.
|
||||
|
||||
"""
|
||||
return int(x).to_bytes(4, 'little')
|
||||
return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little')
|
||||
|
||||
|
||||
# TODO: Expose from marshal
|
||||
|
@ -74,7 +74,7 @@ def _path_split(path):
|
|||
return front, tail
|
||||
for x in reversed(path):
|
||||
if x in path_separators:
|
||||
front, tail = path.rsplit(x)
|
||||
front, tail = path.rsplit(x, maxsplit=1)
|
||||
return front, tail
|
||||
return '', path
|
||||
|
||||
|
|
8440
Python/importlib.h
8440
Python/importlib.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue