[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2021-03-12 Thread Eryk Sun
Change by Eryk Sun : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list

[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2016-08-28 Thread Martin Panter
Martin Panter added the comment: Here is a relevant Posix bug thread: http://austingroupbugs.net/view.php?id=947 As well as Windows, apparently Solaris, OS X, and a recent version of Free BSD have more than eight bits of exit status. I don’t know if Python’s sys.exit() supports this though.

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: -ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24052 ___ ___ Python-bugs-list

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-05-02 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24052 ___

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-05-01 Thread R. David Murray
R. David Murray added the comment: I meant when it is otherwise out of range. That is, treat it like any other object that can't be returned as the return code: print it. But only if it can't otherwise be used as the exit code. -- ___ Python

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-05-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Maybe I've misunderstood RDM's comment, but if sys.exit(code) starts automatically printing the return code, that's going to break a lot of scripts. -- nosy: +steven.daprano ___ Python tracker

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-05-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2 prints large return code only by accident, because it have unsupported type (sys.exit supports only int, not long). This is considered as a bug (issue14376) because small return codes of type long (0L or 1L) are printed too. I don't think this

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-30 Thread R. David Murray
R. David Murray added the comment: Printing the actual value feels more consistent with the documented API, so I'm in favor of that (ie: don't let errors pass silently). I'm sure someone somewhere is depending on this :(, but I see you have versions marked for 3.5 only, which makes sense to

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread eryksun
eryksun added the comment: -- import sys -- sys.exit(2**63) 9223372036854775808 The above is only Python 2.x behavior. On Windows, sys.maxint is 2147483647 (even for 64-bit Windows), so 2**63 is a Python long. Thus handle_system_exit takes the PyFile_WriteObject branch, with the actual

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread Ethan Furman
Ethan Furman added the comment: Windows 7 C:\Python27python Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. -- import sys -- sys.exit(2**63) 9223372036854775808 C:\Python27python Python 2.7.5

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: -- sys.exit(2**63) 9223372036854775808 Interesting. So it is probably not unheard of in the Windows world to use errors codes like 1000,1001,..1024,.. to avoid conflicts with system codes. Maybe on POSIX systems, sys.code(code) should print code and

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread Alexander Belopolsky
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- title: sys.exit(code) returns success to the OS for some values of code - sys.exit(code) returns success to the OS for some nonzero values of code ___ Python tracker

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread Ethan Furman
Ethan Furman added the comment: If anything changes here it needs to be O/S dependent. MS Windows can work with DWORD return values, so truncating to 8-bits is wrong for that platform. -- nosy: +ethan.furman ___ Python tracker

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree that the truncation limits should be OS dependent and preserve the values to the extent possible on a given platform. I just want to avoid a situation when sys.exit(code) returns zero for a non-zero code. BTW, what does sys.exit(2**63) return

[issue24052] sys.exit(code) returns success to the OS for some nonzero values of code

2015-04-24 Thread eryksun
eryksun added the comment: I believe a better behavior for sys.exit() would be to truncate the code values to 8-bit range so that non-zero status would always be returned as non-zero, but possibly different value. OK, so long as it's just for POSIX systems. Windows ExitProcess, ExitThread,