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

Remove usage of datetime_safe #524

Closed
lociii opened this issue Jan 24, 2023 · 4 comments
Closed

Remove usage of datetime_safe #524

lociii opened this issue Jan 24, 2023 · 4 comments

Comments

@lociii
Copy link
Contributor

lociii commented Jan 24, 2023

django.utils.datetime_safe has been deprecated and will be removed in DJango 5.0

DJango source code described it's purpose as following:

# These classes override date and datetime to ensure that strftime('%Y')
# returns four digits (with leading zeros) on years < 1000.
# https://bugs.python.org/issue13305
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(10, 8, 2).strftime("%Y/%m/%d was a %A")
# '0010/08/02 was a Monday'

This may break for actions dated before the year 1000.
If a removal without replacement is accepted, I would go ahead and provide a pull request.

@justquick
Copy link
Owner

anything throwing deprecation warnings for future django releases should be fine. please go ahead and make a PR

i dont think a lot of folks are using this app to track actions from the roman empire but it should b removed anyway

@lociii
Copy link
Contributor Author

lociii commented Feb 21, 2023

After some investigation, this seems like a packaging/release issue.

You already removed the datetime_safe calls in March 2022 in df4b569 and they are not found anymore in the main branch but the current package 1.4.2 still contains them in e.g. actstream/feed.py:10

from django.utils import datetime_safe

Package has been downloaded from GitHub and PyPI both containing the outdated imports and usages.

@lociii
Copy link
Contributor Author

lociii commented Mar 2, 2023

@justquick pinging here as this might be a severe issue.

@justquick
Copy link
Owner

fixed in version 1.4.3

justquick added a commit that referenced this issue Mar 25, 2023
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

No branches or pull requests

2 participants