This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author miserlou
Recipients miserlou
Date 2018-11-30.20:43:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543610582.95.0.788709270274.issue35367@psf.upfronthosting.co.za>
In-reply-to
Content
If I try to create a symlink which already exists, I get a FileExistsError. In this error message, the explanatory arrow is pointing in the wrong direction. This gave us a big scare in our logs!

Example:

```
$ ls
HELLO.txt
$ python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.symlink('HELLO.txt', 'GOODBYE.txt')
$ ls -lah *
lrwxr-xr-x  1 rjones  staff     9B Nov 30 15:36 GOODBYE.txt -> HELLO.txt
-rw-r--r--  1 rjones  staff     4B Nov 30 15:34 HELLO.txt
$ python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.symlink('HELLO.txt', 'GOODBYE.txt')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileExistsError: [Errno 17] File exists: 'HELLO.txt' -> 'GOODBYE.txt'
```

Notice that the arrow in the error message is pointing from HELLO to GOODBYE, but if you if you look at the `ls` output, it is pointing from GOODBYE to HELLO, which is the correct behavior.

The Python3 error message should be changed to reflect the correct direction of the symlink. 

This is a Python3 only bug, as the paths aren't displayed in Python2.

I can PR if this is accepted as a bug.

Thanks!
Rich
History
Date User Action Args
2018-11-30 20:43:03miserlousetrecipients: + miserlou
2018-11-30 20:43:02miserlousetmessageid: <1543610582.95.0.788709270274.issue35367@psf.upfronthosting.co.za>
2018-11-30 20:43:02miserloulinkissue35367 messages
2018-11-30 20:43:02miserloucreate