Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests pass after 2038 #516

Merged
merged 1 commit into from Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions enaml/core/import_hooks.py
Expand Up @@ -307,7 +307,7 @@ def _write_cache(self, code, ts, file_info):
os.mkdir(file_info.cache_dir)
with open(file_info.cache_path, 'w+b') as cache_file:
cache_file.write(MAGIC_NUMBER)
cache_file.write(struct.pack('i', ts))
cache_file.write(struct.pack('<L', ts & 0xFFFF_FFFF))
marshal.dump(code, cache_file)
except (OSError, IOError):
pass
Expand All @@ -328,7 +328,7 @@ def _get_magic_info(self, file_info):
"""
with open(file_info.cache_path, 'rb') as cache_file:
magic = cache_file.read(4)
timestamp = struct.unpack('i', cache_file.read(4))[0]
timestamp = struct.unpack('<L', cache_file.read(4))[0]
return (magic, timestamp)

def read_source(self):
Expand Down