[issue9647] os.confstr() does not handle value changing length between calls

2019-07-29 Thread STINNER Victor
STINNER Victor added the comment: This issue is 9 years old and has patches: it is no newcomer friendly, I remove the "easy" keyword. -- keywords: -easy ___ Python tracker __

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-12 Thread David Watson
David Watson added the comment: Here are the alternative patches to allow more than two calls to confstr(). One patch set just keeps reallocating the buffer until it's big enough, while the other makes a limited number of attempts (in this case 20) before raising RuntimeError. -- keywor

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think that assert() is appropriate solution here. assert() is used to check internal logic, it shouldn't check conditions which rely on external world. Raising RuntimeError looks more appropriate to me. -- versions: -Python 2.6

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-07 Thread David Watson
David Watson added the comment: On Fri 5 Dec 2014, STINNER Victor wrote: > I added an assertion. Can we close this issue? Well, if no one complains about the interpreter dying with SIGABRT, that will suggest that the worries about OS bugs creating infinite loops were unfounded :) If you do want

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I didn't want to close the issue.) -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread STINNER Victor
STINNER Victor added the comment: I added an assertion. Can we close this issue? -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset a7a8947e9ce4 by Victor Stinner in branch 'default': Issue #9647: os.confstr() ensures that the second call to confstr() returns the https://hg.python.org/cpython/rev/a7a8947e9ce4 -- nosy: +python-dev ___

[issue9647] os.confstr() does not handle value changing length between calls

2014-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with Victor that two calls to confstr() should be enough. An example in confstr manpage uses two calls and I think there is no many software (if any) in the world which does more. -- keywords: +easy nosy: +serhiy.storchaka stage: -> needs pa

[issue9647] os.confstr() does not handle value changing length between calls

2010-10-02 Thread David Watson
David Watson added the comment: > If I understood correctly, you don't want the value to be truncated if the > variable grows between the two calls to confstr(). Which behaviour would you > expect? A Python exception? A return size larger than the buffer is *supposed* to indicate that the cur

[issue9647] os.confstr() does not handle value changing length between calls

2010-09-29 Thread STINNER Victor
STINNER Victor added the comment: If I understood correctly, you don't want the value to be truncated if the variable grows between the two calls to confstr(). Which behaviour would you expect? A Python exception? > but Victor Stinner has expressed concern that a buggy > confstr() could creat

[issue9647] os.confstr() does not handle value changing length between calls

2010-08-19 Thread David Watson
New submission from David Watson : This came up in relation to issue #9579; there is some discussion of it there. Basically, if os.confstr() has to call confstr() twice because the buffer wasn't big enough the first time, the existing code assumes the string is the same length that the OS report