[Python-Dev] Backward compatibility of shutil.rmtree (original) (raw)
Hynek Schlawack hs at ox.cx
Sun May 20 23:20:50 CEST 2012
- Previous message: [Python-Dev] Backward compatibility of shutil.rmtree
- Next message: [Python-Dev] Backward compatibility of shutil.rmtree
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Two of them differ in the new version: os.fwalk() is used instead of os.listdir() and os.unlinkat() instead of os.remove(). It would be os.flistdir instead of os.listdir, not os.fwalk, right?
It’s actually os.fwalk. It has been implemented by Charles-François as a dependency of the ticket because it seemed generally useful – therefore I used it for the implementation.
(There has been also been the idea to re-implement the default rmdir with os.walk to make them more similar; but that's a different story.)
The way this interface is defined, it's IMO best to do "precise" reporting, i.e. pass the exact function that caused the failure. I'd weaken the documentation to just specify that the error-causing function is reported, indicating that the exact set of functions may depend on the operating system and change across Python versions.
So you suggest to not mention all the possible functions at all? That seems useful to me, as the list will (hopefully) grow anyway and nailing it down is getting less useful with every new implementation.
Regards, Hynek
- Previous message: [Python-Dev] Backward compatibility of shutil.rmtree
- Next message: [Python-Dev] Backward compatibility of shutil.rmtree
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]