summaryrefslogtreecommitdiff
path: root/Python/frozenmain.c
AgeCommit message (Collapse)AuthorLines
2017-12-12bpo-32241: Add the const qualifire to declarations of umodifiable strings. ↵Serhiy Storchaka-1/+1
(#4748)
2017-11-15bpo-32030: Split Py_Main() into subfunctions (#4399)Victor Stinner-0/+8
* Don't use "Python runtime" anymore to parse command line options or to get environment variables: pymain_init() is now a strict separation. * Use an error message rather than "crashing" directly with Py_FatalError(). Limit the number of calls to Py_FatalError(). It prepares the code to handle errors more nicely later. * Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now only added to the sys module once Python core is properly initialized. * _PyMain is now the well identified owner of some important strings like: warnings options, XOptions, and the "program name". The program name string is now properly freed at exit. pymain_free() is now responsible to free the "command" string. * Rename most methods in Modules/main.c to use a "pymain_" prefix to avoid conflits and ease debug. * Replace _Py_CommandLineDetails_INIT with memset(0) * Reorder a lot of code to fix the initialization ordering. For example, initializing standard streams now comes before parsing PYTHONWARNINGS. * Py_Main() now handles errors when adding warnings options and XOptions. * Add _PyMem_GetDefaultRawAllocator() private function. * Cleanup _PyMem_Initialize(): remove useless global constants: move them into _PyMem_Initialize(). * Call _PyRuntime_Initialize() as soon as possible: _PyRuntime_Initialize() now returns an error message on failure. * Add _PyInitError structure and following macros: * _Py_INIT_OK() * _Py_INIT_ERR(msg) * _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case * _Py_INIT_FAILED(err)
2015-11-30Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failureMartin Panter-1/+3
2015-02-14merge 3.4 (#22633)Benjamin Peterson-6/+9
2015-02-14avoid reading unallocated memory when argc == 0 (closes #22633)Benjamin Peterson-6/+9
2014-08-01Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, renameVictor Stinner-1/+1
``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these functions.
2013-07-27Issue #15893: Improve error handling in main() and Py_FrozenMain()Victor Stinner-16/+23
* handle _PyMem_RawStrdup() failure * Py_FrozenMain() releases memory on error * Py_FrozenMain() duplicates the old locale, as done in main()
2013-07-27Py_FrozenMain() now uses _Py_char2wchar() to decode command line arguments, asVictor Stinner-18/+4
done in main()
2013-07-27Issue #18203: Replace PyMem_Malloc() with PyMem_RawMalloc() at Python ↵Victor Stinner-6/+6
initialization
2013-07-27Issue #15893: frozenmain.c now handles PyMem_Malloc() failureVictor Stinner-2/+9
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-72/+72
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2008-10-07#4004: Missing newline in some startup error messages.Amaury Forgeot d'Arc-4/+4
Patch by Victor.
2008-09-03Issue #3696: Error parsing arguments on OpenBSD <= 4.4 and Cygwin.Antoine Pitrou-1/+10
Patch by Amaury Forgeot d'Arc, reviewed by me.
2008-04-05Change command line processing API to use wchar_t.Martin v. Löwis-3/+36
Fixes #2128.
2002-06-30Patch #569753: Remove support for WIN16.Martin v. Löwis-5/+5
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
2002-01-12Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis-9/+0
2001-07-23Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer-2/+2
and PYTHONPATH).
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-07-22ANSIfy as many declarations as possible.Thomas Wouters-3/+3
2000-07-22Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters-3/+1
declarations yet, those come later.
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
1999-01-02Call PyInitFrozenExtensions() as requested by Mark Hammond (his patch).Guido van Rossum-0/+4
1998-08-04Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum-0/+5
1998-04-03Make calls into ../PC/frozen_dllmain.c on MS_WIN32.Guido van Rossum-0/+11
1998-02-06Set Py_FrozenFlag, to suppress error messages from getpath.c.Guido van Rossum-0/+2
1998-01-19Add unistd.h for isatty().Guido van Rossum-0/+4
1997-12-02Make stdin unbuffered too, when PYTHONUNBUFFERED is specified.Guido van Rossum-0/+1
1997-08-15Keep gcc -Wall happyGuido van Rossum-2/+2
1997-07-19frozenmain.c is now also in the library,Guido van Rossum-5/+1
with entry point Py_FrozenMain().
1997-07-19Tracking changes to Py_Main():Guido van Rossum-18/+4
- Got rid of inspection of some environment variables. - Got rid of Py_GetProgramName() and related logic. - Print the version header *after* successful initialization.
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1996-08-19getprogramname -> Py_GetProgramName.Guido van Rossum-2/+2
1996-05-28grand renaming; added copyright to some filesGuido van Rossum-7/+3
1995-08-04moved stuff around to resemble main.cGuido van Rossum-5/+8
1995-03-31renaming phase 3Guido van Rossum-15/+15
1995-01-04Added 1995 to copyright message.Guido van Rossum-2/+2
bltinmodule.c: fixed coerce() nightmare in ternary pow(). modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject(). pythonrun.c: move flushline() into and around print_error().
1994-08-30Merge back to main trunkGuido van Rossum-5/+28
1993-11-05Must initialize 'inspect' flagGuido van Rossum-1/+2
1993-07-05* Makefile: added all: and default: targets.Guido van Rossum-3/+1
* many files: made some functions static; removed "extern int errno;". * frozenmain.c: fixed bugs introduced on 24 June... * flmodule.c: remove 1.5 bw compat hacks, add new functions in 2.2a (and some old functions that were omitted). * timemodule.c: added MSDOS floatsleep version . * pgenmain.c: changed exit() to goaway() and added defn of goaway(). * intrcheck.c: add hack (to UNIX only) so interrupting 3 times will exit from a hanging program. The second interrupt prints a message explaining this to the user.
1993-06-24* pythonmain.c: -k option, usage message, more environment flags.Guido van Rossum-3/+18
(the latter also in frozenmain.c) * ceval.c: global 'killprint' flag raises exception when printing an expression statement's value (useful for finding stray output) * timemodule.c: add asctime() and ctime(). Change julian date to 1-based origin (as intended and documented). * Removed unused DO_TIMES stuff from timemodule.c. Added 'epoch' and 'day0' globals (year where time.time() == 0 and day of the week the epoch started).
1993-04-01Support for frozen scripts; added -i option.Guido van Rossum-0/+57