[issue9185] os.getcwd causes infinite loop on solaris

2012-08-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset bfa5d0ddfbeb by Trent Nelson in branch '2.7': Issue #15765: Fix quirky NetBSD getcwd() behaviour. http://hg.python.org/cpython/rev/bfa5d0ddfbeb -- nosy: +python-dev ___ Python tracker

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-19 Thread Stefan Krah
Stefan Krah added the comment: Thanks for testing! - Fix also backported to release26-maint in r82975. Closing this one. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-19 Thread Zsolt Cserna
Zsolt Cserna added the comment: I confirm that test_posix passes after applying the patch issue9185-2.patch on solaris 8. Thank you. Now solaris and openbsd have a clean os.getcwd() implementation. -- ___ Python tracker

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-19 Thread Zsolt Cserna
Zsolt Cserna added the comment: I confirm that test_posix passes after applying the patch issue9185-2.patch on solaris 8. Thank you. Now solaris and openbsd have a clean os.getcwd() implementation. -- ___ Python tracker

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Stefan Krah
Stefan Krah added the comment: Antoine, thanks! Committed in release27-maint (r82853). Zsolt, could you confirm that issue9185-2.patch (or r82853) works for you? -- ___ Python tracker

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Nice! The patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Stefan Krah
Stefan Krah added the comment: OpenBSD has the same getcwd() bug. It was uncovered by raising current_path_length to 4099 in test_posix. Here is a new patch that enables the changed posix_getcwd() function on Solaris and OpenBSD only. I've tested the patch on Linux, OpenSolaris, OpenBSD and Fr

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > 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 ke

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou 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

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Hm, on Linux I can't use os.getcwd() with paths longer than PATH_MAX > as things are now: Oh, right. I was assuming 1024 for PATH_MAX when doing my tests, but it really is 4096. > > Second, the test_posix change is a bit too tolerant. IMO it should > check t

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Stefan Krah
Stefan Krah added the comment: Thanks for having a look at the patch! Antoine Pitrou wrote: > I'm not sure I understand the cause of the problem. Does getcwd() fail on > Solaris when the path length is higher than PATH_MAX, even if you pass a big > enough buffer? If the path length exceeds

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure I understand the cause of the problem. Does getcwd() fail on Solaris when the path length is higher than PATH_MAX, even if you pass a big enough buffer? First, your patch makes getcwd() return an error when the path length is longer than PATH_MA

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-13 Thread Stefan Krah
Stefan Krah added the comment: Here's a patch. If PATH_MAX is defined, a static buffer is used. I left the arbitrary path length version since apparently some systems (HURD) don't have any limits for PATH_MAX. In case anyone is mystified how to reproduce the original problem on OpenSolaris: #

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-07 Thread Stefan Krah
Stefan Krah added the comment: I agree that there should be a workaround. In py3k the function is implemented like you suggest. -- stage: -> needs patch ___ Python tracker ___ _

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-07 Thread Zsolt Cserna
Zsolt Cserna added the comment: You are right, but this bug could be easily avoided by using one of the suggested solutions. In my experience a fix sized buffer (whose size is MAXLPATHLEN - or 1024 if not defined) is usually passed to getcwd and the errno is propagated back to the caller if t

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-07 Thread Stefan Krah
Stefan Krah added the comment: I've encountered this a while ago on OpenSolaris. According to the man page http://docs.sun.com/app/docs/doc/816-5168/getcwd-3c?a=view this would be a bug in getcwd(): ERANGE The size argument is greater than 0 and less than the length of the pathname plus 1

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-07 Thread Zsolt Cserna
Zsolt Cserna added the comment: There would be also a solution to allocate a fix buffer with MAXLPATHLEN size and call the getcwd function only one time - if MAXLPATHLEN is available. -- ___ Python tracker __

[issue9185] os.getcwd causes infinite loop on solaris

2010-07-07 Thread Zsolt Cserna
New submission from Zsolt Cserna : os.getcwd() causes infinite loop on solaris10 when the length of the current directory is greater than 1024 (them limit of the maximum absolute path). os.getcwd is implemented by a while loop in python, see the function posix_getcwd in posixmodule.c. That whi