[New-bugs-announce] [issue14917] Make os.symlink on Win32 detect if target is directory

Larry Hastings report at bugs.python.org
Fri May 25 18:16:01 CEST 2012


New submission from Larry Hastings <larry at hastings.org>:

The prototype for os.symlink on Windows adds a "target_is_directory" flag, which indicates whether or not the destination is a directory.

Surely we could detect that and pass in the correct value ourselves?  A quick GetFileAttributes() call would do.  I doubt this would make the function much slower, as it's about to write to that area of the disk anyway.  And if os.symlink is a performance-critical function on Windows I'll eat my hat.

Since os.symlink support for Windows shipped in 3.2, we can't get rid of the argument at the same time.  But we could just ignore it, and since it's marked as optional people could start removing it, and maybe we could deprecate it.

----------
components: Windows
messages: 161587
nosy: larry
priority: low
severity: normal
stage: needs patch
status: open
title: Make os.symlink on Win32 detect if target is directory
type: enhancement
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14917>
_______________________________________


More information about the New-bugs-announce mailing list