Victor Stinner
94ba691ed3
main() now displays an error message before exiting if a command line argument
cannot be decoded
14 years ago
Victor Stinner
f933e1ab6f
Issue #4388 : On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment variable
is not set, the locale encoding is ISO-8859-1, whereas most programs (including
Python) expect UTF-8. Python already uses UTF-8 for the filesystem encoding and
to encode command line arguments on this OS.
15 years ago
Victor Stinner
168e117e0a
Add an optional size argument to _Py_char2wchar()
_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.
15 years ago
Victor Stinner
052a04d34a
Revert r85435 (and r85440): decode command line arguments from utf-8
Python exits with a fatal error if the command line contains an undecodable
argument. PyUnicode_FromString() fails at the first undecodable byte because it
calls the error handler, but error handlers are not ready before Python
initialization.
15 years ago
Victor Stinner
a21350976e
main(): catch PyUnicode_FromString() failure (exit)
15 years ago
Victor Stinner
90bbaa57f9
Issue #9992 : On Mac OS X, decode command line arguments from utf-8 instead of
the locale encoding.
15 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
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.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
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.
........
16 years ago
Ronald Oussoren
d61deca27c
Move _Py_char2wchar from python.c to main.c.
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.
16 years ago
Collin Winter
dfa66c1dda
Fix the --with-cxx-main build.
16 years ago
Philip Jenvey
e53de3dc4a
#7301 : decode $PYTHONWARNINGS in the same way as argv, test non-ascii values
16 years ago
Martin v. Löwis
8ed91b2768
Issue #6097 : Escape UTF-8 surrogates resulting from mbstocs conversion
of the command line.
17 years ago
Martin v. Löwis
43c57785d3
Rename utf8b error handler to surrogateescape.
17 years ago
Martin v. Löwis
011e842033
Issue #5915 : Implement PEP 383, Non-decodable Bytes in
System Character Interfaces.
17 years ago
Georg Brandl
26338d1cfd
another instance of #804543 : use strdup() when saving the result of setlocale() because it could be overwritten by subsequent setlocale()s.
17 years ago
Benjamin Peterson
08a8f5fff9
restore compilation on OpenBSD #4146
17 years ago
Amaury Forgeot d'Arc
d0ca955d9f
#4004 : Missing newline in some startup error messages.
Patch by Victor.
17 years ago
Antoine Pitrou
fff953048f
Issue #3696 : Error parsing arguments on OpenBSD <= 4.4 and Cygwin.
Patch by Amaury Forgeot d'Arc, reviewed by me.
18 years ago
Martin v. Löwis
790465fd90
Change command line processing API to use wchar_t.
Fixes #2128 .
18 years ago
Tim Peters
4643bd9a9c
Apparently FreeBSD enables some HW floating-point exceptions by default.
This can cause core dumps when Python runs. Python relies on the 754-
(and C99-) mandated default "non-stop" mode for FP exceptions. This
patch from Ben Laurie disables at least one FP exception on FreeBSD at
Python startup time.
23 years ago
Mark Hammond
fe51c6d66e
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
for Py_Main().
Thanks to Kalle Svensson and Skip Montanaro for the patches.
24 years ago
Thomas Wouters
bd4bc4e9e9
Even more ANSIfication: fix as many function pointers and declarations as
possible.
26 years ago
Fredrik Lundh
faa209d6bd
- ANSI-fication
(patch #100805 by Peter Schneider-Kamp)
26 years ago
Guido van Rossum
9c1201fe39
Py_Main() must be DL_EXPORT too.
27 years ago
Guido van Rossum
be10c20adf
Now include Python.h
28 years ago
Guido van Rossum
7c14103d77
Keep gcc -Wall happy
29 years ago
Guido van Rossum
4c04be64b3
This is now the "real" main program -- it calls Py_Main(argc, argv)
which is in the library and does all the work.
29 years ago