Dave Abrahams added the comment:
on Sat Aug 04 2012, Larry Hastings report-AT-bugs.python.org wrote:
Larry Hastings added the comment:
What does the following script print out?
import os
os.chdir('/tmp')
os.symlink('--success--', 'foo')
print(this should print --success-- :)
Larry Hastings added the comment:
Since everything is working fine, and the documentation arguably needs no
update, I'm closing this.
--
resolution: - works for me
stage: - committed/rejected
status: open - closed
___
Python tracker
R. David Murray added the comment:
The first of those acts as I would expect: os.path.realpath is operating only
on the path, so if the last element is a symbolic link it doesn't have any
reason to look for the target of that link.
The second one does seem less intuitive.
I'm not sure the
Larry Hastings added the comment:
I just tried it, and os.readlink('/tmp/broken-symlink') worked fine. What OS
are you using?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15531
___
Dave Abrahams added the comment:
MacOS 10.7
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15531
___
___
Python-bugs-list mailing list
Larry Hastings added the comment:
What does the following script print out?
import os
os.chdir('/tmp')
os.symlink('--success--', 'foo')
print(this should print --success-- :)
print(os.readlink('foo'))
os.unlink('foo')
--
___
Python tracker
New submission from Dave Abrahams:
the docs for os.path don't mention the following facts which I think are
important (in fact I assumed the facts would be the reverse):
os.path.realpath(l) works when l is a broken symbolic link, returning the path
to the (missing) target
os.path.readlink(l)