summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #11918: OS/2 and VMS are no more supported because of the lack ofVictor Stinner2011-04-261-0/+1
| | | | maintainer.
* Issue #11393: Add the new faulthandler moduleVictor Stinner2011-03-301-0/+1
|
* Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon2011-02-221-2/+1
|
* Remove call to nonexisting function (relic from Python 2.x) under #ifdef ↵Eli Bendersky2011-01-141-1/+0
| | | | __INSURE__. Issue 9844
* Issue #10841: set binary mode on files; the parser translates newlinesVictor Stinner2011-01-071-3/+6
| | | | | | On Windows, set the binary mode on stdin, stdout, stderr and all io.FileIO objects (to not translate newlines, \r\n <=> \n). The Python parser translates newlines (\r\n => \n).
* Add sys.flags.quiet attribute for the new -q option, as noted missing by ↵Georg Brandl2010-12-281-3/+2
| | | | Eric in #1772833.
* #1772833: add -q command line option.Georg Brandl2010-12-041-3/+10
|
* Remove redundant includes of headers that are already included by Python.h.Georg Brandl2010-11-301-1/+0
|
* PyUnicode_EncodeFS() raises an exception if _Py_wchar2char() failsVictor Stinner2010-11-081-1/+1
| | | | | | * Add error_pos optional argument to _Py_wchar2char() * PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if _Py_wchar2char() fails
* Issue #10089: Add support for arbitrary -X options on the command-line.Antoine Pitrou2010-10-211-3/+6
| | | | They can be retrieved through a new attribute `sys._xoptions`.
* run_file(): encode the filename with PyUnicode_EncodeFSDefault() instead ofVictor Stinner2010-10-171-2/+2
| | | | PyUnicode_AsUTF8String()
* Add an optional size argument to _Py_char2wchar()Victor Stinner2010-10-161-2/+4
| | | | | | _Py_char2wchar() callers usually need the result size in characters. Since it's trivial to compute it in _Py_char2wchar() (O(1) whereas wcslen() is O(n)), add an option to get it.
* Py_Main() uses _Py_wchar2char() to encode the filename in error messagesVictor Stinner2010-10-141-11/+11
|
* Issue #9992: Remove PYTHONFSENCODING environment variable.Victor Stinner2010-10-131-3/+0
|
* Create fileutils.c/.hVictor Stinner2010-10-071-208/+0
| | | | | | | * _Py_fopen() and _Py_stat() come from Python/import.c * (_Py)_wrealpath() comes from Python/sysmodule.c * _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c * (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c
* Rewrite RunMainFromImporter()Victor Stinner2010-10-061-25/+35
| | | | | | | | | * fix argv0 reference counter if PyList_SetItem() fails * don't use complex if conditions, but a simple indentation and "goto error" * simplify error handling (remove Py_XDECREF(importer) from the error label) * don't set sys_path to NULL (it's useless, sys_path is a borrowed reference and sys_path is not a static variable) * try to write only one instruction per line for better readability
* Isse #8589: Decode PYTHONWARNINGS from utf-8 on Mac OS XVictor Stinner2010-09-121-2/+6
| | | | Instead of the locale encoding.
* Issue #8589: surrogateescape error handler is not available at startupVictor Stinner2010-09-101-6/+11
| | | | | Py_Main() uses _Py_wchar2char() + PyUnicode_FromWideChar() instead of PyUnicode_DecodeFSDefault(), because the PyCodec machinery is not ready yet.
* PYTHONFSENCODING is not available on Windows or Mac OS XVictor Stinner2010-08-191-7/+9
|
* Improve error message if the command is not decodableVictor Stinner2010-08-181-0/+1
|
* Issue #8622: Add PYTHONFSENCODING environment variable to override theVictor Stinner2010-08-181-0/+1
| | | | | | filesystem encoding. initfsencoding() displays also a better error message if get_codeset() failed.
* Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the ↵Nick Coghlan2010-08-171-3/+2
| | | | module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory
* Create _Py_wchar2char() function, reverse of _Py_char2wchar()Victor Stinner2010-08-131-7/+87
| | | | | * Use _Py_wchar2char() in _wstat() and _Py_wfopen() * Document _Py_char2wchar()
* Reimplement addbuilddir() in C inside getpath.c, so as to execute itAntoine Pitrou2010-08-131-5/+7
| | | | | at interpreter startup before importing any non-builtin modules. Should fix #9589.
* Issue #9425: Create run_file() subfunctionVictor Stinner2010-08-071-24/+36
| | | | | | * Call Py_MakePendingCalls() before converting the filename from wchar_t* to char* * Use PyUnicode_AsUTF8String() instead of _PyUnicode_AsString()
* Issue #9425: Create run_command() subfunctionVictor Stinner2010-08-071-15/+23
| | | | Use PyUnicode_AsUTF8String() instead of _PyUnicode_AsString()
* Issue #8589: Decode PYTHONWARNINGS environment variable with the file systemVictor Stinner2010-05-191-4/+5
| | | | | encoding and surrogateespace error handler instead of the locale encoding to be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
* Issue #6697: Fix a crash if code of "python -c code" contains surrogatesVictor Stinner2010-05-171-4/+8
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-610/+610
| | | | | | | | | | 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. ........
* Move _Py_char2wchar from python.c to main.c.Ronald Oussoren2010-04-181-0/+104
| | | | | | | This fixes issue #8441: python.c is not included in the framework while main.c is and without this patch you get a link error when building Python.framework on OSX.
* strings from _Py_char2wchar need PyMem_FreePhilip Jenvey2010-04-141-1/+1
|
* #7301: decode $PYTHONWARNINGS in the same way as argv, test non-ascii valuesPhilip Jenvey2010-04-141-13/+35
|
* Merged revisions 79936 via svnmerge fromBenjamin Peterson2010-04-111-13/+18
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79936 | philip.jenvey | 2010-04-10 15:27:15 -0500 (Sat, 10 Apr 2010) | 3 lines fix PYTHONWARNINGS handling to not modify the original env value and improve its tests ........
* woops these strings aren't kept around, free themPhilip Jenvey2010-04-071-0/+1
|
* Merged revisions 79878-79880 via svnmerge fromPhilip Jenvey2010-04-071-0/+19
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79878 | philip.jenvey | 2010-04-06 16:24:45 -0700 (Tue, 06 Apr 2010) | 4 lines #7301: add the environment variable $PYTHONWARNINGS to supplement the -W command line option patch from Brian Curtin ........ r79879 | benjamin.peterson | 2010-04-06 16:32:27 -0700 (Tue, 06 Apr 2010) | 1 line tell people to update python.man, too ........ r79880 | philip.jenvey | 2010-04-06 16:38:57 -0700 (Tue, 06 Apr 2010) | 1 line document new PYTHONWARNINGS env var ........
* Merged revisions 78826 via svnmerge fromVictor Stinner2010-03-121-4/+10
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78826 | victor.stinner | 2010-03-10 23:30:19 +0100 (mer., 10 mars 2010) | 5 lines Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt (SIGINT). If an error occurs while importing the site module, the error is printed and Python exits. Initialize the GIL before importing the site module. ........
* Merged revisions 75570 via svnmerge fromAntoine Pitrou2009-10-201-29/+0
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75570 | antoine.pitrou | 2009-10-20 23:29:37 +0200 (mar., 20 oct. 2009) | 6 lines Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which fixes the problem of some exceptions being thrown at shutdown when the interpreter is killed. Patch by Adam Olsen. ........
* Merged revisions 74051-74052 via svnmerge fromAlexandre Vassalotti2009-07-171-3/+3
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r74051 | alexandre.vassalotti | 2009-07-17 03:54:23 -0400 (Fri, 17 Jul 2009) | 2 lines Initialize variables in PyCurses_getsyx() to avoid compiler warnings. ........ r74052 | alexandre.vassalotti | 2009-07-17 04:09:04 -0400 (Fri, 17 Jul 2009) | 3 lines Fix GCC warning about fprintf used without a string literal and without format arguments. ........
* This fixes issue5143 and includes a test.Ronald Oussoren2009-02-121-3/+16
| | | | | Issue5143 notes that getpath.c and main.c pass a 'char*' where a 'wchar_t*' is expected on OSX.
* Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-lineAntoine Pitrou2009-01-091-4/+3
| | | | | | flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me.
* #4747: on Windows, starting a module with a non-ascii filename would print a ↵Amaury Forgeot d'Arc2009-01-011-4/+7
| | | | | | | | | | useless "SyntaxError: None" when the script contains a "# coding:" declaration. The Python API expects char* to be utf-8 encoded. wcstombs should be avoided here. Reviewed by Benjamin. Will backport to 3.0
* #3705: Command-line arguments were not correctly decoded when theAmaury Forgeot d'Arc2008-11-111-21/+19
| | | | | | | | | terminal does not use UTF8. Now the code propagates the unicode string as far as possible, and avoids the conversion to char* which implicitely uses utf-8. Reviewed by Benjamin.
* #3626: On cygwin, starting "python z" would not display any error message:Amaury Forgeot d'Arc2008-10-301-2/+11
| | | | printf("%ls") fails if the wide string is 1 char long :-(
* Revert r33661, which broke all buildbots.Amaury Forgeot d'Arc2008-09-091-19/+21
|
* #3705: Fix crash when given a non-ascii value on the command line for the ↵Amaury Forgeot d'Arc2008-09-091-21/+19
| | | | | | | | "-c" and "-m" parameters Second part, for Windows. Reviewed by Antoine Pitrou
* Issue #3705: py3k aborts if "-c" or "-m" is given a non-ascii value.Antoine Pitrou2008-09-061-19/+31
| | | | Reviewed by Benjamin Peterson.
* Fixed wording of python --help text.Christian Heimes2008-09-031-2/+2
| | | | The -b option was still using the old name 'buffer' instead of 'bytearray'.
* Remove meaning of -ttt, but still accept -t option on cmdline for compatibility.Georg Brandl2008-06-041-2/+1
|
* Revert r63934 -- it was mixing two patches.Georg Brandl2008-06-041-1/+2
|
* Remove meaning of -ttt, but still accept -t option on cmdline for compatibility.Georg Brandl2008-06-041-2/+1
|