Update copy.py and test_copy.py from CPython v3.12
#5175
Merged
copy.py and test_copy.py from CPython v3.12
#5175