Attention is currently required from: fixeria, pespin.
1 comment:
File scripts/osmotestconfig.py:
Patch Set #5, Line 80: ign = shutil.ignore_patterns('*.cfg', '*tmp_dummy_sock')
I also don't like the proposed approach, agreeing with @pespin that putting project specific filenam […]
`shutil` (see [here](https://docs.python.org/3/library/shutil.html) for documentation) itself includes filename-pattern exclusion only it seems. I've just taken a look at the documentation and found this:
```
Changed in version 3.2: Added the copy_function argument to be able to provide a custom copy function. Added the ignore_dangling_symlinks argument to silence dangling symlinks errors when symlinks is false.
```
which I suppose would via (some library of) Python3 enable us to pass something like (pseudo-code...)
```
if src_file is a special file
return
else
copy src_file to destination
```
as a custom copy function.
Did a short online research and it appears that Python3 does not provide file type detection (feel free to correct me if I'm wrong), so a system call to System V `file` command could be used.
Iirc the exception thrown from `shutil.copytree()` was all but specific about what was going on. Maybe some enhanced exception handling using the auditing event triggered would also do the trick, I don't know enough about this though.
I still feel like the current change is a simple fix for now that won't break anything and can still be followed up upon easily with some more sophisticated solution if need be.
To view, visit change 30980. To unsubscribe, or for help writing mail filters, visit settings.