Skip to content

Conversation

Jojeker
Copy link
Contributor

@Jojeker Jojeker commented Jan 4, 2025

This should fix the typo in the encode function that lead to an exception, when using the struct_time.

I came across this with a small example:

    from pycrate_mobile.TS24008_IE import TimeZoneTime
    from time import gmtime

    uttz = TimeZoneTime()
    curr = gmtime()
    uttz.encode(curr)

Which led to the following output:

  File ".venv/lib/python3.12/site-packages/pycrate_mobile/TS24008_IE.py", line 1043, in encode
    self['TZ'].encode( tz )
    ~~~~^^^^^^
  File ".venv/lib/python3.12/site-packages/pycrate_core/elt.py", line 2146, in __getitem__
    raise(EltErr('{0} [__getitem__] str item: {1}'.format(self._name, err)))
pycrate_core.elt.EltErr: TimeZoneTime [__getitem__] str item: 'TZ' is not in list

The commit renames the member that is accessed to TimeZone (like below) ^^

Cheers,
Eduard

This should fix the typo in the encode function that lead to an
exception, when using the `struct_time`.

Signed-off-by: Eduard Vlad <[email protected]>
@mitshell mitshell self-assigned this Jan 5, 2025
@mitshell mitshell merged commit 31e341f into pycrate-org:master Jan 5, 2025
12 of 13 checks passed
@mitshell
Copy link
Member

mitshell commented Jan 5, 2025

Thanks for the bug fix

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.

2 participants