[issue44579] shutil.copy() inefficient implementation in Windows

2021-07-07 Thread sfmc
New submission from sfmc : In Windows shutil.copy() uses _copyfileobj_readinto which copies file in user mode. In Windows there is an fast API to copy file in kernel mode: CopyFile (see https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfile). -- components

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-05-02 Thread sfmc
sfmc added the comment: > How about keeping a substitute or mapped drive from the input path > if resolving the root path on the drive prefixes the overall real > path? That would be pretty easy to implement. So if the resolved path is accessible from the original path's drive,

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-30 Thread sfmc
sfmc added the comment: > If you don't need to resolve symlinks, just use os.path.abspath() in Windows > and os.path.realpath() in POSIX. As I said, we already fixed it in our scripts. The problem is with Python debugger and third-party tools - we can't make changes there. The envir

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-30 Thread sfmc
sfmc added the comment: I see the point: the real path may not be accessible from the substitute drive: - if symlink (or junction) is used, pointing to path not visible from the substitute drive. - if different security context is used (e.g. different user or UAC

[issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths

2021-04-28 Thread sfmc
New submission from sfmc : For example if I mount directory C:\example\dir to Z:\ the os.path.realpath('Z:\\') returns the real directory. Use following commands in Windows to reproduce the issue: md C:\example\dir subst Z: C:\example\dir python.exe -c "import os;