[Python-ideas] os.path.cansymlink(path)

Geoffrey Spear geoffspear at gmail.com
Thu Jul 24 19:33:28 CEST 2014


On Thu, Jul 24, 2014 at 12:51 PM, anatoly techtonik <techtonik at gmail.com> wrote:
> This is a live code from current virtualenv.py:
>
>     if hasattr(os, 'symlink'):
>         logger.info('Symlinking Python bootstrap modules')
>
> This code is wrong, because OS support for
> symlinks doesn't guarantee that mounted filesystem
> can do this, resulting in OSError at runtime. So, the
> proper check would be to check if specific path
> supports symlinking.
>
> The idea is:
>
>     os.path.cansymlink(path)  - Return True if filesystem
>         of specified path can be symlinked.
>
> Yes/No/Opinions?

Surely the third-party module you found that wrong code in has their
own communication channels?


More information about the Python-ideas mailing list