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

Use built-in isoformat support #383

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

City-busz
Copy link
Contributor

The ISO formatted string can be stored in multiple formats. Use the built-in datetime.isoformat() and datetime.fromisoformat() functions, which able to handle all variants.

Fixes: #382

@Evidlo
Copy link
Member

Evidlo commented Mar 11, 2024

Thanks for investigating this.

.fromisoformat on Python 3.6-3.10 does not support the 'Z' suffix to indicate timezone, so we need an additional .replace('Z', '+00:00') as mentioned in this thread

The ISO formatted string can be stored in multiple formats. Use the built-in datetime.isoformat() and datetime.fromisoformat() functions, which able to handle all variants.
Replace 'Z' with '+00:00' to ensure compatibility with Python < 3.11.

Fixes: libkeepass#382
@City-busz
Copy link
Contributor Author

Okay, I updated the MR to include this replace for compatibility.

@Evidlo Evidlo merged commit 18ec462 into libkeepass:master Mar 11, 2024
5 of 6 checks passed
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.

[4.0.7] regression -> gnome secrets crashes on expiration date check with missmatch of date format
2 participants