summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
AgeCommit message (Collapse)AuthorLines
2010-12-28Add sys.flags.quiet attribute for the new -q option, as noted missing by ↵Georg Brandl-0/+1
Eric in #1772833.
2010-12-04Add an "optimize" parameter to compile() to control the optimization level, ↵Georg Brandl-4/+12
and provide an interface to it in py_compile, compileall and PyZipFile.
2010-12-03Merge branches/pep-0384.Martin v. Löwis-2/+10
2010-11-30Remove redundant includes of headers that are already included by Python.h.Georg Brandl-4/+0
2010-11-20Issue #10255: Fix reference leak in Py_InitializeEx(). Patch by NeilAntoine Pitrou-0/+2
Schemenauer.
2010-11-10Issue #10372: Import the warnings module only after the IO library isAntoine Pitrou-7/+9
initialized, so as to avoid bootstrap issues with the '-W' option.
2010-10-30Merged revisions 85980 via svnmerge fromHirokazu Yamamoto-0/+3
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85980 | hirokazu.yamamoto | 2010-10-31 00:08:15 +0900 | 1 line Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah. ........
2010-10-30Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah.Hirokazu Yamamoto-0/+3
2010-10-29Merged revisions 85817,85904 via svnmerge fromBenjamin Peterson-4/+3
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85817 | benjamin.peterson | 2010-10-23 22:41:46 -0500 (Sat, 23 Oct 2010) | 1 line tighten loop ........ r85904 | benjamin.peterson | 2010-10-28 22:28:14 -0500 (Thu, 28 Oct 2010) | 1 line decrement offset when it points to a newline (#10186 followup) ........
2010-10-29decrement offset when it points to a newline (#10186 followup)Benjamin Peterson-1/+3
2010-10-24tighten loopBenjamin Peterson-4/+1
2010-10-24Merged revisions 85814 via svnmerge fromBenjamin Peterson-2/+0
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85814 | benjamin.peterson | 2010-10-23 21:52:05 -0500 (Sat, 23 Oct 2010) | 1 line remove broken code accounting an offset the size of the line #10186 ........
2010-10-24remove broken code accounting an offset the size of the line #10186Benjamin Peterson-2/+0
2010-10-23Issue #10077: Fix logging of site module errors at startup.Victor Stinner-1/+4
2010-10-19Recorded merge of revisions 85569-85570 via svnmerge fromVictor Stinner-3/+14
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85569 | victor.stinner | 2010-10-16 15:14:10 +0200 (sam., 16 oct. 2010) | 4 lines Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expects filenames encoded to the filesystem encoding with surrogateescape error handler (to support undecodable bytes), instead of UTF-8 in strict mode. ........ r85570 | victor.stinner | 2010-10-16 15:42:53 +0200 (sam., 16 oct. 2010) | 4 lines Fix ast_error_finish() and err_input(): filename can be NULL Fix my previous commit (r85569). ........
2010-10-19initfsencoding(): get_codeset() failure is now a fatal errorVictor Stinner-13/+6
Don't fallback to utf-8 anymore to avoid mojibake. I never got any error from his function.
2010-10-17_PyImport_FixupExtension() and _PyImport_FindExtension() uses FS encodingVictor Stinner-4/+4
* Rename _PyImport_FindExtension() to _PyImport_FindExtensionUnicode(): the filename becomes a Unicode object instead of byte string * Rename _PyImport_FixupExtension() to _PyImport_FixupExtensionUnicode(): the filename becomes a Unicode object instead of byte string
2010-10-16Fix ast_error_finish() and err_input(): filename can be NULLVictor Stinner-1/+6
Fix my previous commit (r85569).
2010-10-16Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expectsVictor Stinner-3/+9
filenames encoded to the filesystem encoding with surrogateescape error handler (to support undecodable bytes), instead of UTF-8 in strict mode.
2010-10-15Use locale encoding if Py_FileSystemDefaultEncoding is not setVictor Stinner-258/+0
* PyUnicode_EncodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_DecodeFSDefault() use the locale encoding instead of UTF-8 if Py_FileSystemDefaultEncoding is NULL * redecode_filenames() functions and _Py_code_object_list (issue #9630) are no more needed: remove them
2010-10-15redecode_filename(): don't need to initialize variablesVictor Stinner-1/+1
2010-10-13Issue #9992: Remove PYTHONFSENCODING environment variable.Victor Stinner-16/+6
2010-09-29Issue #9630: Redecode filenames when setting the filesystem encodingVictor Stinner-0/+258
Redecode the filenames of: - all modules: __file__ and __path__ attributes - all code objects: co_filename attribute - sys.path - sys.meta_path - sys.executable - sys.path_importer_cache (keys) Keep weak references to all code objects until initfsencoding() is called, to be able to redecode co_filename attribute of all code objects.
2010-09-20Issue #9901: Destroying the GIL in Py_Finalize() can fail if some otherAntoine Pitrou-5/+8
threads are still running. Instead, reinitialize the GIL on a second call to Py_Initialize().
2010-09-13Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properlyAntoine Pitrou-0/+4
re-created on a subsequent call to Py_Initialize(). The problem (a crash) wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
2010-08-18Issue #8622: Add PYTHONFSENCODING environment variable to override theVictor Stinner-22/+43
filesystem encoding. initfsencoding() displays also a better error message if get_codeset() failed.
2010-08-17Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().Victor Stinner-5/+5
2010-08-08Issue #477863: Print a warning at shutdown if gc.garbage is not empty.Antoine Pitrou-0/+3
2010-08-08Merged revisions 83854 via svnmerge fromAntoine Pitrou-1/+1
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83854 | antoine.pitrou | 2010-08-08 22:46:42 +0200 (dim., 08 août 2010) | 4 lines Issue #5319: Print an error if flushing stdout fails at interpreter shutdown. ........
2010-08-08Issue #5319: Print an error if flushing stdout fails at interpreterAntoine Pitrou-1/+1
shutdown.
2010-08-05Issue #9079: Added _PyTime_gettimeofday(_PyTime_timeval *tp) to C APIAlexander Belopolsky-0/+2
exposed in Python.h. This function is similar to POSIX gettimeofday(struct timeval *tp), but available on platforms without gettimeofday().
2010-06-17Merged revisions 82059,82061 via svnmerge fromVictor Stinner-1/+1
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82059 | victor.stinner | 2010-06-18 01:08:50 +0200 (ven., 18 juin 2010) | 5 lines Issue #6543: Write the traceback in the terminal encoding instead of utf-8. Fix the encoding of the modules filename. Reindent also traceback.h, just because I hate tabs :-) ........ r82061 | victor.stinner | 2010-06-18 01:17:37 +0200 (ven., 18 juin 2010) | 2 lines Issue #6543: Mention the author of the patch, Amaury Forgeot d'Arc ........
2010-06-17Issue #6543: Write the traceback in the terminal encoding instead of utf-8.Victor Stinner-1/+1
Fix the encoding of the modules filename. Reindent also traceback.h, just because I hate tabs :-)
2010-06-11Issue #8965: initfsencoding() doesn't change the encoding on Mac OS XVictor Stinner-17/+19
File system encoding have to be hardcoded to "utf-8" on Mac OS X. r81190 introduced a regression: the encoding was changed depending on the locale.
2010-06-08Merged revisions 81844 via svnmerge fromVictor Stinner-1/+1
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81844 | victor.stinner | 2010-06-08 23:00:13 +0200 (mar., 08 juin 2010) | 6 lines Py_FatalError(): don't sys sys.last_xxx variables Call PyErr_PrintEx(0) instead of PyErr_Print() to avoid a crash if Py_FatalError() is called in an early stage of Python initialization (if PySys is not yet initialized). ........
2010-06-08Py_FatalError(): don't sys sys.last_xxx variablesVictor Stinner-1/+1
Call PyErr_PrintEx(0) instead of PyErr_Print() to avoid a crash if Py_FatalError() is called in an early stage of Python initialization (if PySys is not yet initialized).
2010-05-21Issue #3798: sys.exit(message) writes the message to sys.stderr file, insteadVictor Stinner-4/+6
of the C file stderr, to use stderr encoding and error handler
2010-05-20Recorded merge of revisions 81364 via svnmerge fromVictor Stinner-1/+3
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81364 | victor.stinner | 2010-05-19 22:40:50 +0200 (mer., 19 mai 2010) | 3 lines Issue #8766: Initialize _warnings module before importing the first module. Fix a crash if an empty directory called "encodings" exists in sys.path. ........
2010-05-19Issue #8766: Initialize _warnings module before importing the first module.Victor Stinner-1/+3
Fix a crash if an empty directory called "encodings" exists in sys.path.
2010-05-19Issue #6697: Check that _PyUnicode_AsString() result is not NULLVictor Stinner-5/+21
2010-05-17Merged revisions 81250-81253 via svnmerge fromVictor Stinner-0/+4
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81250 | victor.stinner | 2010-05-17 03:13:37 +0200 (lun., 17 mai 2010) | 2 lines Issue #6697: Fix a crash if code of "python -c code" contains surrogates ........ r81251 | victor.stinner | 2010-05-17 03:26:01 +0200 (lun., 17 mai 2010) | 3 lines PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead of strict) error handler to escape surrogates ........ r81252 | victor.stinner | 2010-05-17 10:58:51 +0200 (lun., 17 mai 2010) | 6 lines handle_system_exit() flushs files to warranty the output order PyObject_Print() writes into the C object stderr, whereas PySys_WriteStderr() writes into the Python object sys.stderr. Each object has its own buffer, so call sys.stderr.flush() and fflush(stderr). ........ r81253 | victor.stinner | 2010-05-17 11:33:42 +0200 (lun., 17 mai 2010) | 6 lines Fix refleak in internal_print() introduced by myself in r81251 _PyUnicode_AsDefaultEncodedString() uses a magical PyUnicode attribute to automatically destroy PyUnicode_EncodeUTF8() result when the unicode string is destroyed. ........
2010-05-17handle_system_exit() flushs files to warranty the output orderVictor Stinner-0/+4
PyObject_Print() writes into the C object stderr, whereas PySys_WriteStderr() writes into the Python object sys.stderr. Each object has its own buffer, so call sys.stderr.flush() and fflush(stderr).
2010-05-15Issue #8610: Load file system codec at startup, and display a fatal error onVictor Stinner-20/+42
failure. Set the file system encoding to utf-8 (instead of None) if getting the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
2010-05-14Merged revisions 81156 via svnmerge fromVictor Stinner-1/+1
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81156 | victor.stinner | 2010-05-14 02:59:09 +0200 (ven., 14 mai 2010) | 5 lines Issue #4653: fix typo in flush_std_files() Don't call sys.stderr.flush() if sys has no stderr attribute or if sys.stderr==None. ........
2010-05-14Issue #4653: fix typo in flush_std_files()Victor Stinner-1/+1
Don't call sys.stderr.flush() if sys has no stderr attribute or if sys.stderr==None.
2010-05-09Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou-1549/+1549
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from 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. ........ ................
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-1543/+1543
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. ........
2010-05-09Merged revisions 81016 via svnmerge fromJean-Paul Calderone-0/+4
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81016 | jean-paul.calderone | 2010-05-08 23:18:57 -0400 (Sat, 08 May 2010) | 9 lines Merged revisions 81007 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81007 | jean-paul.calderone | 2010-05-08 16:06:02 -0400 (Sat, 08 May 2010) | 1 line Skip signal handler re-installation if it is not necessary. Issue 8354. ........ ................
2010-05-09Merged revisions 81007 via svnmerge fromJean-Paul Calderone-0/+4
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81007 | jean-paul.calderone | 2010-05-08 16:06:02 -0400 (Sat, 08 May 2010) | 1 line Skip signal handler re-installation if it is not necessary. Issue 8354. ........
2010-05-08err_input(): don't encode/decode the unicode messageVictor Stinner-13/+12