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

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

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

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
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