pytest-datafiles icon indicating copy to clipboard operation
pytest-datafiles copied to clipboard

mode bits are not copied

Open traveltissues opened this issue 5 years ago • 1 comments

Mode bits are not copied by default (https://py.readthedocs.io/en/latest/path.html#py._path.local.LocalPath.copy). This results in unexpected modes in testing. It would be useful if there were some way to use the datafiles fixture and copy modes.

traveltissues avatar Oct 29 '19 13:10 traveltissues

That is indeed unfortunate. My gut reaction would be to set 'mode' and 'stat' to True.

If mode is True, will copy copy permission from path to target. If stat is True, copy permission, last modification time, last access time, and flags from path to target.

But that would of course be kind of a breaking change in case someone is relying on the current behaviour. To copy as exactly as possible seems more natural to me and not copying the mode bits was definitely never intended. Any thoughts anyone?

omarkohl avatar Mar 13 '22 19:03 omarkohl