Skip to content
Snippets Groups Projects
Commit a3211be2 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Don't use the runtime platform's native endianness when unpacking .pyc files...

Don't use the runtime platform's native endianness when unpacking .pyc files to fix test failures on big-endian machines. (Closes: #290)
parent 5c9446e1
No related branches found
No related tags found
No related merge requests found
Pipeline #323156 passed
......@@ -64,11 +64,11 @@ def parse_pyc(f):
f.seek(4, 1)
moddate = f.read(4)
modtime = time.asctime(time.gmtime(struct.unpack("=L", moddate)[0]))
modtime = time.asctime(time.gmtime(struct.unpack("<L", moddate)[0]))
yield "moddate: {} ({} UTC)".format(hexlify(moddate), modtime)
filesz = f.read(4)
filesz = struct.unpack("=L", filesz)
filesz = struct.unpack("<L", filesz)
yield f"files sz: {filesz[0]}"
code = marshal.load(f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment