New submission from Vajrasky Kok:

Steps to reproduce the bug:
1. Download cute cat picture from internet. Name it CuteCat.jpg.

>>> import os
>>> os.listdir('.')
['CuteCat.jpg']

2. Create symbolic link.

>>> os.symlink('CuteCat.jpg', 'Aaawww.lnk')
>>> os.listdir('.')
['Aaawww.lnk', 'CuteCat.jpg']

3. Do it again.

>>> os.symlink('CuteCat.jpg', 'Aaawww.lnk')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
FileExistsError: [Errno 17] File exists: 'CuteCat.jpg'

Amusingly, it only happens on 3.4 (both Windows and Linux). 3.3 gives correct 
error message (in Linux, I did not test it on Windows). 2.7 omits the file 
information (in Linux, I did not test it on Windows). I'll check again the 
behaviour on Windows for 2.7 and 3.3.

Do we need unit test for this? Will we change the error message again in the 
future? For now, I omit it. Let me know if we need unit test.

----------
components: Extension Modules, Windows
files: fix_error_message_on_creating_already_existed_symbolic_link.patch
keywords: patch
messages: 204899
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Misleading error on creating already existed symlink
type: behavior
versions: Python 3.4
Added file: 
http://bugs.python.org/file32920/fix_error_message_on_creating_already_existed_symbolic_link.patch

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

Reply via email to