Skip to content

Unable to deepcopy Interval, TypeError: Interval.__new__() got an unexpected keyword argument 'days' #850

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
aploium opened this issue Oct 13, 2024 · 0 comments
Labels

Comments

@aploium
Copy link
Contributor

aploium commented Oct 13, 2024

  • [ x ] I am on the latest Pendulum version.
  • [ x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name: Debian 12 (os independent)
  • Pendulum version: 3.0.0 pypi

Issue

As title describes.

Reproduce

docker run -it python:3.12 bash
pip install pendulum==3.0.0
python -c "import pendulum,copy
copy.deepcopy(pendulum.now() - pendulum.now().subtract(days=1))
"
# Traceback (most recent call last):
#  File "<string>", line 2, in <module>
#  File "/usr/local/lib/python3.12/copy.py", line 143, in deepcopy
#    y = copier(memo)
#        ^^^^^^^^^^^^
#  File "/usr/local/lib/python3.12/site-packages/pendulum/duration.py", line 464, in __deepcopy__
#    return self.__class__(
#           ^^^^^^^^^^^^^^^
# TypeError: Interval.__new__() got an unexpected keyword argument 'days'

Potential Fix

#851

aploium added a commit to aploium/pendulum that referenced this issue Oct 13, 2024
aploium added a commit to aploium/pendulum that referenced this issue Oct 13, 2024
@ashb ashb added the bug label Jan 13, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants