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.DateTime.equalTo now breaks with string argument #60

Closed
perrinjerome opened this issue Dec 3, 2023 · 0 comments · Fixed by #61
Closed

DateTime.DateTime.equalTo now breaks with string argument #60

perrinjerome opened this issue Dec 3, 2023 · 0 comments · Fixed by #61

Comments

@perrinjerome
Copy link
Contributor

BUG/PROBLEM REPORT / FEATURE REQUEST

Since DateTime 5.2, using DateTime.DateTime.equalTo with something else than a DateTime or a number throws AttributeError. This is a regression from #54 ( cc @fdiary )

What I did:

>>> import DateTime
>>> DateTime.DateTime() == ""
False
>>> DateTime.DateTime().equalTo("")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "./DateTime/src/DateTime/DateTime.py", line 1295, in equalTo
    return self._micros == t._micros
AttributeError: 'str' object has no attribute '_micros'

What I expect to happen:

DateTime.DateTime().equalTo("") should be False

What actually happened:

AttributeError: 'str' object has no attribute '_micros'

What version of Python and Zope/Addons I am using:

This is current master branch 955f3b9

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 a pull request may close this issue.

1 participant