[issue1154351] add get_current_dir_name() to os module

2019-09-09 Thread STINNER Victor
STINNER Victor added the comment: I don't see much traction to get this feature into Python. Only a few comments since 2005. I close the issue. The function implement is just a few lines of pure Python code. If you need it, it's easy to put it in your project. Sorry, but I'm not convinced th

[issue1154351] add get_current_dir_name() to os module

2019-09-09 Thread STINNER Victor
STINNER Victor added the comment: I rejected PR 10117 which adds os.get_current_dir_name(). Copy of my comment: https://github.com/python/cpython/pull/10117#issuecomment-529399532 The os module is thin wrappers to functions of the libc or even system calls. We don't implement heuristic using

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread Eryk Sun
Eryk Sun added the comment: > Windows getcwd() returns a path without resolved symbolic links This provides consistency. If the working directory were resolved, then accessing "../file.ext" after chdir("C:/Temp/link") could be inconsistent with accessing "C:/Temp/link/../file.ext". This is

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread Michael Hoffman
Michael Hoffman added the comment: `getcwd()` in many ways serves the purpose that a `lget_current_dir_name()` might. -- ___ Python tracker ___

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread STINNER Victor
STINNER Victor added the comment: os.stat() has a following_symlinks parameter because there is lstat(). There is no lgetcwd(), only getcwd(). I dislike the parameter choice. Use os.path.realpath() is you want to resolve symbolic links. -- ___ Pyt

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread Michael Hoffman
Michael Hoffman added the comment: > * For some libc functions we add options to existing functions rather of > duplicating the number of names in the os module. For example the dir_fd > option instead of *at() functions. Wouldn't be better to add a buulean > parameter (with platform-depend

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We provide Python implementations for fnmatch, glob, realpath even if there are corresponding libc functions. This makes them available even on platforms that doesn't have native implementations in libc, avoids C limitations, and allow to add new options.

[issue1154351] add get_current_dir_name() to os module

2018-10-29 Thread STINNER Victor
STINNER Victor added the comment: man get_current_dir_name(): get_current_dir_name() will malloc(3) an array big enough to hold the absolute pathname of the current working directory. If the environment variable PWD is set, and its value is correct, then that value wil

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Michael Hoffman
Michael Hoffman added the comment: glibc `getcwd()` and `get_current_dir_name()` are not the same. glibc `get_current_dir_name()` does, in fact, check the `PWD` environment variable. https://www.gnu.org/software/libc/manual/html_node/Working-Directory.html The get_current_dir_name function is

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Braden Groom
Braden Groom added the comment: Victor, FWIW I don't need this functionality and your suggestion on the PR seems reasonable to me. I only picked up this issue as a way to become familiar with contributing to the project. I'm okay with closing both the PR and the ticket. -- nosy: +br

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Marc Adam Anderson
Change by Marc Adam Anderson : -- nosy: -marcadam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread STINNER Victor
STINNER Victor added the comment: The glibc has a get_current_dir_name() function which returns the same value that getcwd(), the difference is that get_current_dir_name() allocates memory. If someone wants to add a function using PWD env var, a different function name should be found.

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Anthony Sottile
Anthony Sottile added the comment: Does this actually make sense for the `os` module? `PWD` is a variable set by your interactive shell and doesn't really make sense outside that context. I expect this function to be too easily confused with `os.getcwd()` and a source of bugs when the latter

[issue1154351] add get_current_dir_name() to os module

2018-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue1154351] add get_current_dir_name() to os module

2018-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue1154351] add get_current_dir_name() to os module

2018-10-25 Thread Braden Groom
Change by Braden Groom : -- pull_requests: +9450 stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list ma

[issue1154351] add get_current_dir_name() to os module

2013-03-21 Thread Berker Peksag
Changes by Berker Peksag : -- versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue1154351] add get_current_dir_name() to os module

2013-03-20 Thread Marc Adam Anderson
Marc Adam Anderson added the comment: This enhancement has been implemented. The code is based on hoffman's code. Tests for this enhancement, as well as tests for os.getcwd() have also been added. The docs have been updated and tested locally. -- keywords: +patch nosy: +marcadam Added

[issue1154351] add get_current_dir_name() to os module

2010-08-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.2 -Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue1154351] add get_current_dir_name() to os module

2009-02-15 Thread Daniel Diniz
Changes by Daniel Diniz : -- stage: -> test needed versions: +Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list ma