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

Python 3.12 deprecates timezone non aware utcfromtimestamp() and utcnow() #705

Open
traylenator opened this issue Oct 13, 2023 · 1 comment

Comments

@traylenator
Copy link

Describe the bug

There are some deprecation warnings with Python 3.12.

To Reproduce
Run tests with Python 3.12

Expected behavior
Tests should run clean.

For example:

  /builddir/build/BUILD/reactivex-4.0.4/reactivex/internal/basic.py:17: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    return datetime.utcnow()

tests/test_observable/test_delay.py::TestDelay::test_delay_datetime_offset_error1_impl
  /builddir/build/BUILD/reactivex-4.0.4/tests/test_observable/test_delay.py:204: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    return xs.pipe(delay(datetime.utcfromtimestamp(250)))

tests/test_observable/test_delay.py::TestDelay::test_delay_datetime_offset_error2_impl
  /builddir/build/BUILD/reactivex-4.0.4/tests/test_observable/test_delay.py:247: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    return xs.pipe(delay(datetime.utcfromtimestamp(350)))

https://docs.python.org/3.12/whatsnew/3.12.html#deprecated

@traylenator traylenator changed the title Python 3.12 deprecates Python 3.12 deprecates timezone non aware utcfromtimestamp() and utcnow() Oct 13, 2023
@christiansandberg
Copy link
Contributor

Is there a release planned with this 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

No branches or pull requests

2 participants