New submission from Jason R. Coombs <jar...@jaraco.com>:

In https://github.com/jaraco/path/issues/186, the Path project discovered a 
regression with Python 3.8. It seems that if one creates a symlink with an 
absolute path. I used `shutil.copytree('temp', 'temp2', True)` and it produced 
this result:

```
~ # dir temp
 Volume in drive C has no label.
 Volume Serial Number is B8F4-40BB

 Directory of C:\Users\jaraco\temp

2020-05-16  11:05 PM    <DIR>          .
2020-05-16  11:05 PM    <DIR>          ..
2020-05-16  11:05 PM    <SYMLINK>      bar [c:\Users\jaraco\temp\foo]
2020-05-16  11:04 PM                 0 foo
               2 File(s)              0 bytes
               2 Dir(s)  17,495,805,952 bytes free
~ # dir temp2
 Volume in drive C has no label.
 Volume Serial Number is B8F4-40BB

 Directory of C:\Users\jaraco\temp2

2020-05-16  11:05 PM    <DIR>          .
2020-05-16  11:05 PM    <DIR>          ..
2020-05-16  11:06 PM    <SYMLINK>      bar [\\?\c:\Users\jaraco\temp\foo]
2020-05-16  11:04 PM                 0 foo
               2 File(s)              0 bytes
               2 Dir(s)  17,495,846,912 bytes free
```

As you can see, in the copy, bar has an additional `\\?\` prefix on the symlink 
path. On Python 3.7 and earlier, the copy was made without mutating the 
metadata.

----------
components: Windows
keywords: 3.8regression
messages: 369091
nosy: jaraco, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: shutil.copyfile mutates symlink for absolute path
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40654>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to