Steve Dower <steve.do...@python.org> added the comment:

I agree with Eryk (unsurprisingly, we discussed this change *a lot* back when 
it was made ~3 years ago).

os.readlink is the lowest-level API that gives a reliable result.

os.path.realpath is the high-level API that probably does what most users want 
most of the time (and relies on os.readlink being reliable).

We can't change either of these to more of a middle-ground without taking away 
the ability for users to implement their own behaviour. So there's no 
behavioural issue here. (The behavioural issue we fixed in 3.8 was that 
realpath didn't resolve anything at all, so we're not reverting back to that.)

If you'd like a new API added to either retrieve the display path or to read a 
link and try to partially normalise the result without resolving any more 
links, please open an issue specifically for that (targeting Python 3.10). You 
probably also want to prototype a wrapper around readlink() to do it, and be 
prepared to have many potential edge cases thrown against it.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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

Reply via email to