[issue12801] C realpath not used by os.path.realpath

2014-07-24 Thread STINNER Victor
STINNER Victor added the comment: I agree, Python should not use the C function realpath() for all the reasons give in the issue. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue12801] C realpath not used by os.path.realpath

2014-07-24 Thread Charles-François Natali
Charles-François Natali added the comment: Shall we close this, since realpath(3) is fundamentally broken, and pathlib now does The Right Thing? -- ___ Python tracker ___ __

[issue12801] C realpath not used by os.path.realpath

2012-02-26 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue12801] C realpath not used by os.path.realpath

2012-02-25 Thread Charles-François Natali
Charles-François Natali added the comment: > - os.realpath() uses canonicalize_file_name() if available, or use > realpath() with a buffer of MAXPATHLEN bytes MAXPATHLEN is not necessarily defined (e.g. on the Hurd): if it's not defined, it is set either to MAX_PATH (if it's defined an greate

[issue12801] C realpath not used by os.path.realpath

2012-02-21 Thread STINNER Victor
STINNER Victor added the comment: realpath.patch: - Add os.realpath() - posixpath.realpath() uses os.realpath(), or os.getcwd() if the path is an empty string - os.realpath() uses canonicalize_file_name() if available, or use realpath() with a buffer of MAXPATHLEN bytes Don't use realpath

[issue12801] C realpath not used by os.path.realpath

2011-10-30 Thread Charles-François Natali
Charles-François Natali added the comment: Another problem with the POSIX realpath(3): it can fail with ENOENT if the target path doesn't exist, whereas the current Python implementation "succeeds" even if a component in the path doesn't exist. Note the quotes around "succeeds", because I'm no

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread Charles-François Natali
Charles-François Natali added the comment: > POSIX the standard, or the implementers?? > Both :-) For those wondering why we can't use PATH_MAX (ignoring the buffer overallocation), here's why: https://www.securecoding.cert.org/confluence/display/cplusplus/FIO02-CPP.+Canonicalize+path+names+o

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: > I've been quite disappointed by POSIX lately... POSIX the standard, or the implementers?? -- ___ Python tracker ___

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Alas, it doesn't seem to hold for OpenBSD: > http://old.nabble.com/Make-realpath(3)-conform-to-SUSv4-td32031895.html > > A patch supporting NULL was committed two months ago, which means we > probably can't push this forward. > > I've been quite disappointed

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread Charles-François Natali
Charles-François Natali added the comment: > Well, if we use two different paths based on the libc version, it might not > be a good idea, since behaviour can be different in some cases. Indeed. > It would be nice to know if some modern platforms have a non-compliant > realpath(). Alas, it

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, if we use two different paths based on the libc version, it might not be a good idea, since behaviour can be different in some cases. It would be nice to know if some modern platforms have a non-compliant realpath(). --

[issue12801] C realpath not used by os.path.realpath

2011-08-29 Thread jan matejek
Changes by jan matejek : -- nosy: +matejcik ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: Le mercredi 24 août 2011 23:45:00, vous avez écrit : > Charles-François Natali added the comment: > > Patch to get #ifdef REALPATH_SUPPORT_NULL: > I'm not really familiar with autotools, but I have the impression that > this will only check that the given code

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > Patch to get #ifdef REALPATH_SUPPORT_NULL: I'm not really familiar with autotools, but I have the impression that this will only check that the given code snippet compiles (and it will), and we want to check that a NULL buffer is supported at runtime

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: > I prefer to reuse _Py_wrealpath because we will have > to add special cases: realpath(NULL) and also maybe > canonicalize_file_name(). I read that canonicalize_file_name(name) just calls realpath(name, NULL), so we can maybe avoid this GNU exception. I real

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: Patch to get #ifdef REALPATH_SUPPORT_NULL: diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -1539,6 +1539,17 @@ if test "$have_pthread_t" = yes ; then #endif ]) fi + +AC_MSG_CHECKING(for realpath with NULL) +realpath_suppor

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread STINNER Victor
STINNER Victor added the comment: i12801.patch is not correct: on Windows, you should never encode a filename to bytes. Use PyUnicode_Decode() + _Py_wrealpath(), or a #ifdef (as many other posixmodule functions). I prefer to reuse _Py_wrealpath because we will have to add special cases: real

[issue12801] C realpath not used by os.path.realpath

2011-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: > It would probably be simpler, safer and more efficient to simply call > the POSIX function instead (but it most be exposed somewhere, by > posixmodule.c I suppose). Indeed. > Would it be a good idea to use the full docstring of posixpath.realpath >

[issue12801] C realpath not used by os.path.realpath

2011-08-21 Thread Éric Araujo
Éric Araujo added the comment: + Return a string representing the canonicalized pathname of *path*. This sounds a bit strange to me; “Return a string representing the canonical version of *path*”. Would it be a good idea to use the full docstring of posixpath.realpath to os.realpath and th

[issue12801] C realpath not used by os.path.realpath

2011-08-20 Thread Ross Lagerwall
Ross Lagerwall added the comment: An initial patch. The first problem is that before, os.path.realpath('') == os.path.realpath('.') but this is not true for realpath(3). Thus, the test suite does not run because it relies on this behaviour. -- keywords: +patch Added file: http://bugs.

[issue12801] C realpath not used by os.path.realpath

2011-08-20 Thread STINNER Victor
STINNER Victor added the comment: The Python implementation (os.path.realpath) was introduced 10 years ago by the issue #461781. The Python implemtation has known bugs: - #9949: os.path.realpath on Windows does not follow symbolic links - #11397: os.path.realpath() may produce incorrect res

[issue12801] C realpath not used by os.path.realpath

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : We have our own quirky implementation of C realpath() in posixpath.py. It would probably be simpler, safer and more efficient to simply call the POSIX function instead (but it most be exposed somewhere, by posixmodule.c I suppose). -- components: Lib