Skip to content

appItunesmeta: fix crash on string purchase/release/install dates#1613

Merged
abrignoni merged 1 commit into
mainfrom
fix-appitunesmeta-string-date
Jun 25, 2026
Merged

appItunesmeta: fix crash on string purchase/release/install dates#1613
abrignoni merged 1 commit into
mainfrom
fix-appitunesmeta-string-date

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Problem

AttributeError: 'str' object has no attribute 'year'
  appItunesmeta.py:41  purchasedate = convert_plist_date_to_utc(purchasedate)

convert_plist_date_to_utc (and convert_time_obj_to_utc) expect a datetime object — they read .year / call .replace(tzinfo=...). In some iTunesMetadata.plist files, purchaseDate (and releaseDate/installDate) are stored as ISO strings rather than plist <date> objects, so the converter raised and aborted the whole artifact.

Fix

Guard all three conversions: convert only when the value isinstance(..., datetime); pass strings/empties through unchanged. The App Purchase Date / Installed Date columns are datetime-typed, so a pass-through ISO string is still parsed correctly by the framework.

Pre-existing bug surfaced during testing.

Validation

  • pylint 10.00/10.
  • Runtime-tested both forms: ISO-string purchaseDate (was crashing) passes through; datetime purchaseDate still converts to aware UTC.

convert_plist_date_to_utc / convert_time_obj_to_utc expect a datetime object (they read
.year / call .replace(tzinfo=...)). In some iTunesMetadata.plist files purchaseDate (and
releaseDate/installDate) are stored as ISO strings rather than plist <date> objects, so the
converters raised AttributeError ('str' object has no attribute 'year') and aborted the
artifact. Guard all three: convert only datetime objects; pass strings through unchanged
(the framework parses ISO strings for the datetime columns).

Pre-existing bug surfaced during testing.
@abrignoni abrignoni merged commit 1a2c674 into main Jun 25, 2026
1 check passed
@abrignoni abrignoni deleted the fix-appitunesmeta-string-date branch June 25, 2026 15:08
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