[Python-ideas] Implementation of shutil.move
aquavitae69 at gmail.com
Mon Aug 15 15:58:45 CEST 2011
> You have to modify at least the C functions
> as well as the pure python implementation
Thanks for the info - it will save me looking for it :-)
Well, that's basically what I was getting at. I don't like the idea of
> silently falling back to the unsafe thing one bit. It wouldn't be so
> bad to have something that tries to do it without any race conditions
> etc., and raises an exception if this isn't possible.
This may sound harsh. If you proposed changes don't survive hostiles
> environment then there is no reason in implementing them at all. It's
> the false sense of security Nick was talking about earlier. At best your
> solution is slightly less insecure but still insecure and a loophole for
> exploits. IMHO you should update the docs and explain why and how some
> operations are subjected to race conditions.
So a new function, say safe_copy(), tries to copy securely. If it can't,
then an exception is raised. The user can then do something like:
logging.warning('Unsafe copy in progress')
My question now is whether there is really a need for this. The other
option is, as Christian says, to document the problem and perhaps present an
recipe for avoiding it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas