Message386634
The "shutil.copyfile" raises a "SameFileError" exception if the src and dts files are the same.
There is no option to allow the same files(like in case of shutil.copytree(dirs_exist_ok=False)).
For example:
import shutil
shutil.copyfile("test.txt", "test.txt")
Output:
>>> python3 test.py
Traceback (most recent call last):
File "test.py", line 3, in <module>
shutil.copyfile("test.txt", "test.txt")
File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'test.txt' and 'test.txt' are the same file |
|
Date |
User |
Action |
Args |
2021-02-08 17:32:01 | milanbalazs | set | recipients:
+ milanbalazs |
2021-02-08 17:32:01 | milanbalazs | set | messageid: <1612805521.88.0.931585192254.issue43165@roundup.psfhosted.org> |
2021-02-08 17:32:01 | milanbalazs | link | issue43165 messages |
2021-02-08 17:32:01 | milanbalazs | create | |
|