Skip to content

Fix edge cases in Cocoa, birthdate and size conversion helpers - #453

Merged
abrignoni merged 1 commit into
mainfrom
fix/ilapfuncs-helper-edge-cases
Nov 18, 2026
Merged

abrignoni merged 1 commit into
mainfrom
fix/ilapfuncs-helper-edge-cases

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Levels the shared helper fixes from abrignoni/iLEAPP#2795 into this copy of scripts/ilapfuncs.py, which carried the same four defects.

  • convert_cocoa_core_data_ts_to_utc: ms, µs and ns Cocoa times came out about 31 years early; NSDate.distantPast and distantFuture showed as 1968 and 1972 and now come back blank, like an absent date. Pre-1970 dates still convert.
  • get_birthdate_from_unix_ts crashed on an empty value.
  • convert_bytes_to_unit returned a bare number from 1 TiB up.

New tests fail on main and pass here. Full suite: 1,036 OK. No artifact or other module in this repo calls these three helpers today, so no report output can change and a corpus run would not exercise them; the fix keeps the shared file in step.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

🤖 Generated with Claude Code

Same fixes as abrignoni/iLEAPP#2795 for this copy of scripts/ilapfuncs.py:

- convert_cocoa_core_data_ts_to_utc added the 2001 offset before scaling, so
  Cocoa times in ms, us or ns came out about 31 years early. Positive values
  from 10**11 are now scaled first.
- It also showed NSDate.distantPast as 1968 and distantFuture as 1972. Both
  now come back blank, like an absent date. Pre-1970 dates still convert.
- get_birthdate_from_unix_ts raised AttributeError on an empty value.
- convert_bytes_to_unit returned a bare number from 1 TiB up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit e0fa9ed into main Nov 18, 2026
9 checks passed
@abrignoni
abrignoni deleted the fix/ilapfuncs-helper-edge-cases branch November 18, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant