This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年06月07日 21:13 by kisielk, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| exit_code.patch | jeffknupp, 2012年07月03日 14:07 | exit code patch | review | |
| Messages (7) | |||
|---|---|---|---|
| msg162501 - (view) | Author: Kamil Kisiel (kisielk) | Date: 2012年06月07日 21:13 | |
Python returns a different exit status when an exception is raised and -m is used as opposed to just running a module. A short example, let's call it foo.py: def main(): raise ValueError() if __name__ == '__main__': main() When run with python foo.py the exit status of the process is 1. If run with python -mfoo the exit status of the process is 255. |
|||
| msg162666 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年06月12日 11:53 | |
Technically, it returns -1 (which later gets coerced to an unsigned value). However, there's no good reason for the inconsistency - the offending line (663) in main.c should be changed to be: sts = (RunModule(module, 1) != 0); It is currently just: sts = RunModule(module, 1); An additional test in test_cmd_line_script is also needed to ensure that both variants give a returncode of 1 in the future. |
|||
| msg164602 - (view) | Author: Jeff Knupp (jeffknupp) * | Date: 2012年07月03日 14:07 | |
Fixed for 3.3. Does this need to be back ported as well? |
|||
| msg164603 - (view) | Author: Jeff Knupp (jeffknupp) * | Date: 2012年07月03日 14:08 | |
And by 'Fixed' I of course meant 'Patched, awaiting review'. |
|||
| msg164667 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年07月05日 02:33 | |
New changeset fcbd3bda7c0f by Senthil Kumaran in branch '3.2': Fix issue # 15033 - Return the proper exitcode for failure when modules are invoked using -m switch. Patch contributed by Jeff Knupp http://hg.python.org/cpython/rev/fcbd3bda7c0f New changeset 1186d68715cc by Senthil Kumaran in branch 'default': Fix issue # 15033 - Return the proper exitcode for failure when modules are invoked using -m switch. Patch contributed by Jeff Knupp http://hg.python.org/cpython/rev/1186d68715cc |
|||
| msg164668 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年07月05日 02:50 | |
New changeset 55b3de6d701e by Senthil Kumaran in branch '2.7': Fix closes issue # 15033 - Return the proper exitcode for failure when modules are invoked using -m switch. Patch contributed by Jeff Knupp http://hg.python.org/cpython/rev/55b3de6d701e |
|||
| msg164669 - (view) | Author: Senthil Kumaran (orsenthil) * (Python committer) | Date: 2012年07月05日 02:53 | |
Thanks for the patch Jeff and thanks for the guidance, Nick. Committed this in all branches. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:31 | admin | set | github: 59238 |
| 2012年07月05日 02:53:25 | orsenthil | set | status: open -> closed nosy: + orsenthil messages: + msg164669 resolution: fixed stage: patch review -> resolved |
| 2012年07月05日 02:50:44 | python-dev | set | messages: + msg164668 |
| 2012年07月05日 02:34:00 | python-dev | set | nosy:
+ python-dev messages: + msg164667 |
| 2012年07月04日 23:09:24 | Arfrever | set | nosy:
+ Arfrever |
| 2012年07月03日 20:56:28 | pitrou | set | stage: needs patch -> patch review |
| 2012年07月03日 14:08:38 | jeffknupp | set | messages: + msg164603 |
| 2012年07月03日 14:07:46 | jeffknupp | set | files:
+ exit_code.patch nosy: + jeffknupp messages: + msg164602 keywords: + patch |
| 2012年07月02日 20:53:15 | eric.araujo | set | keywords:
+ easy stage: needs patch |
| 2012年06月12日 11:53:56 | ncoghlan | set | messages: + msg162666 |
| 2012年06月08日 18:02:07 | eric.araujo | set | nosy:
+ ncoghlan, eric.araujo versions: + Python 3.3, - Python 2.6 |
| 2012年06月07日 21:13:38 | kisielk | create | |