[issue9185] os.getcwd causes infinite loop on solaris

Stefan Krah report at bugs.python.org
Tue Jul 13 15:28:10 CEST 2010


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

Antoine Pitrou <report at bugs.python.org> wrote:
> > If you change 1027 to 4098, the test currently fails on Linux, too. I
> > think the only
> > reason why it never failed is that most systems have PATH_MAX=4096.
> 
> Ok, then perhaps the test should be fixed?

I wasn't really precise. The test fails on Linux, but for a different reason.
Linux legitimately sets ENAMETOOLONG and raises OSError. This only becomes
apparent when using 4098 in the test.

Solaris, on the other hand, does not even raise, since it keeps setting
ERANGE and thus does not leave the loop in posix_getcwd(). IOW, only the
fix in posixmodule.c allows the test to fail properly in the first place.

If you prefer, of course it's possible to be conservative and make the new
version of posix_getcwd() Solaris specific.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9185>
_______________________________________


More information about the Python-bugs-list mailing list