Skip to content

Cannot (deep)copy a Date or DateTime object #523

@stellasia

Description

@stellasia
  • Neo4j version: Enterprise 4.2.2
  • Neo4j Mode: Single instance
  • Driver version: 4.2.1
  • Operating system: Ubuntu 10.04
  • Steps to reproduce
from neo4j.time import Date
d = Date(2021, 4, 5)
import copy
d2 = copy.deepcopy(d)
# d2 = copy.copy(d)  # same actual/expected behaviour
assert d2 is not d
  • Expected behavior
assert d2 is not d
assert d2.year == d.year
  • Actual behavior
  File "/usr/lib/python3.8/copy.py", line 264, in _reconstruct
    y = func(*args)
  File "/usr/lib/python3.8/copyreg.py", line 91, in __newobj__
    return cls.__new__(cls, *args)
TypeError: __new__() missing 3 required positional arguments: 'year', 'month', and 'day'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions