This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author StreakyCobra
Recipients StreakyCobra, r.david.murray, serhiy.storchaka
Date 2017-02-23.19:59:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487879958.31.0.968292212813.issue29635@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the additional information!

> The 'cd' man page says that 'cd -P' should "perform actions equivalent to the chdir() function".

Just wondering, do you know what is the function called by `cd`/`cd -L` then? It doesn't seems to be a bash internal tweak because `/usr/bin/pwd -L` is able to get the symlink path, and this binary is not part of bash.

> You'll have to make a case for it being useful enough to add.

The use case is for shells written in Python, like for instance `xonsh` [1,2]. Being powered by Python, the only way to change directory is by using `os.chdir()`. It is then not possible to mimic the bash `cd` function without using workarounds, like for instance storing the symlink path in a variable, and even this doesn't allow to use `/usr/bin/pwd -L` in scripts because it would always returns the physical location.

Having such described functions (yet to be named) would permit python shells to offer users differentiated `cd` and `cd -P` commands, as well as having `pwd -L` in scripts behaving the same than in traditional shells.

[1] http://xon.sh/
[2] https://github.com/xonsh/xonsh
History
Date User Action Args
2017-02-23 19:59:18StreakyCobrasetrecipients: + StreakyCobra, r.david.murray, serhiy.storchaka
2017-02-23 19:59:18StreakyCobrasetmessageid: <1487879958.31.0.968292212813.issue29635@psf.upfronthosting.co.za>
2017-02-23 19:59:18StreakyCobralinkissue29635 messages
2017-02-23 19:59:18StreakyCobracreate