Issue 13775: Access Denied message on symlink creation misleading for an existing file/directory target. (original) (raw)

Created on 2012-01-12 01:06 by santoso.wijaya, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)

msg151101 - (view)

Author: Santoso Wijaya (santoso.wijaya) *

Date: 2012-01-12 01:06

Consider:

os.symlink('.\test', 'Lib\bar') Traceback (most recent call last): File "", line 1, in WindowsError: [Error 5] Access is denied: '.\test'

Where Lib\bar is previously created. The symlink creation is rightly rejected, but with a misleading message. The failure is because 'Lib\bar' already exists, not because of '.\test'.

msg151102 - (view)

Author: Santoso Wijaya (santoso.wijaya) *

Date: 2012-01-12 01:09

Simple patch.

msg151147 - (view)

Author: Martin v. Löwis (loewis) * (Python committer)

Date: 2012-01-12 18:52

I fail to see the bug. The output is correct, you are just misinterpreting it. It gives you the error code, error message, and original filename. It doesn't actually claim that the access to test is denied.

Now, changing the file in the message to the dest file doesn't really improve things. It fixes your case, but breaks cases involving problems with the source file.

So if any change is made, it should include both source and dest in the exception.

msg178514 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2012-12-29 16:57

See also .

msg186750 - (view)

Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer)

Date: 2013-04-13 16:30

, , and all are virtually about the same bug. There is no working patch in any issue, but the discussion in is longer.

History

Date

User

Action

Args

2022-04-11 14:57:25

admin

set

github: 57984

2013-04-13 16:30:06

serhiy.storchaka

set

status: open -> closed
superseder: Bad error message in os.rename, os.link, and os.symlink
messages: +

resolution: duplicate
stage: resolved

2012-12-29 16:57:36

serhiy.storchaka

set

nosy: + serhiy.storchaka
messages: +

2012-01-12 18:52:13

loewis

set

nosy: + loewis
messages: +

2012-01-12 01:09:25

santoso.wijaya

set

files: + issue13775_py33.patch
keywords: + patch
messages: +

2012-01-12 01:06:47

santoso.wijaya

create