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

datetime/FakeDate equality failure on 3.13 #568

Open
xmo-odoo opened this issue Mar 10, 2025 · 0 comments
Open

datetime/FakeDate equality failure on 3.13 #568

xmo-odoo opened this issue Mar 10, 2025 · 0 comments

Comments

@xmo-odoo
Copy link

assert FakeDate(1912, 11, 2) == datetime(1912, 11, 2, 7, 16, 50)

succeeds when running on Python 3.10, 3.11, and 3.12 (running the latest freezegun, although in older versions as well e.g. 1.2) but fails when using faketime 1.5.1 on Python 3.13.

In fairness I don't know if that behaviour was ever expected, I just found it when trying 3.13 on an existing project. Replacing FakeDate by date fails in all of 3.10 to 3.13.

xmo-odoo added a commit to odoo-dev/odoo that referenced this issue Mar 10, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 10, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #200978

Signed-off-by: Xavier Morel (xmo) <[email protected]>
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue Mar 10, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

X-original-commit: 833bea9
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue Mar 10, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

X-original-commit: 833bea9
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue Mar 10, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

X-original-commit: 833bea9
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

X-original-commit: 833bea9
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #201077

X-original-commit: 833bea9
Signed-off-by: Xavier Morel (xmo) <[email protected]>
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #201093

X-original-commit: 833bea9
Signed-off-by: Xavier Morel (xmo) <[email protected]>
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #201093

X-original-commit: 833bea9
Signed-off-by: Xavier Morel (xmo) <[email protected]>
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #201088

X-original-commit: 833bea9
Signed-off-by: Xavier Morel (xmo) <[email protected]>
robodoo pushed a commit to odoo/odoo that referenced this issue Mar 11, 2025
Normally a `date` and a `datetime` compare `False`. For some reason
however a `datetime` and a `freezegun.api.FakeDate` compare equal as
long as the datetime's date part matches the fakedate's... until
Python 3.13, when it stop working.

I've no idea why it ever worked, but it's completely unnecessary, we
can just get the reference datetime's `date()` part and compare that
to the date.

upstream issue: spulec/freezegun#568

closes #201081

X-original-commit: 833bea9
Signed-off-by: Xavier Morel (xmo) <[email protected]>
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

1 participant