Martin Panter
ca3263c50c
Issue #25677 : Correct syntax error caret for indented blocks.
Based on patch by Michael Layzell.
9 years ago
Serhiy Storchaka
85b0f5beb1
Added the const qualifier to char* variables that refer to readonly internal
UTF-8 represenatation of Unicode objects.
9 years ago
Serhiy Storchaka
06515833fe
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
9 years ago
Serhiy Storchaka
f5894dd646
Issue #28701 : Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
9 years ago
Victor Stinner
3466bde1cc
Avoid calling functions with an empty string as format string
Directly pass NULL rather than an empty string.
9 years ago
Victor Stinner
559bb6a713
Rename _PyObject_FastCall() to _PyObject_FastCallDict()
Issue #27809 :
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
9 years ago
Victor Stinner
71cb64acc2
PyErr_PrintEx() now uses fast call
Issue #27128 .
9 years ago
Martin Panter
46f50726a0
Issue #27076 : Doc, comment and tests spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
10 years ago
Martin Panter
3263f6874a
Issue #22836 : Keep exception reports sensible despite errors
10 years ago
Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
10 years ago
Serhiy Storchaka
2d06e84455
Issue #25923 : Added the const qualifier to static constant arrays.
10 years ago
Serhiy Storchaka
56f6e76c68
Issue #15989 : Fixed some scarcely probable integer overflows.
It is very unlikely that they can occur in real code for now.
10 years ago
Victor Stinner
6fb5bae252
Fix race condition in create_stdio()
Issue #24891 : Fix a race condition at Python startup if the file descriptor
of stdin (0), stdout (1) or stderr (2) is closed while Python is creating
sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set
to None if the creation of the object failed, instead of raising an OSError
exception. Initial patch written by Marco Paolini.
10 years ago
Berker Peksag
0bd5fb0112
Issue #24728 : Fix building without threads.
Patch by Louis Dassy.
11 years ago
Eric Snow
32439d6eb6
Issue #23911 : Move path-based bootstrap code to a separate frozen module.
11 years ago
Brett Cannon
f299abdafa
Issue #23731 : Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
11 years ago
Victor Stinner
84092ac370
Issue #23571 : Fix reentrant call to Py_FatalError()
Flushing sys.stdout and sys.stderr in Py_FatalError() can call again
Py_FatalError(). Add a reentrant flag to detect this case and just abort at the
second call.
11 years ago
Victor Stinner
ec4f9592f5
Issue #23571 : Py_FatalError() now tries to flush sys.stdout and sys.stderr
It should help to see exceptions when stderr if buffered: PyErr_Display() calls
sys.stderr.write(), it doesn't write into stderr file descriptor directly.
11 years ago
Victor Stinner
0e98a76b65
Issue #23571 : Enhance Py_FatalError()
* Display the current Python stack if an exception was raised but the exception
has no traceback
* Disable faulthandler if an exception was raised (before it was only disabled
if no exception was raised)
* To display the current Python stack, call PyGILState_GetThisThreadState()
which works even if the GIL was released
11 years ago
Victor Stinner
5200f55024
Issue #19428 : Handle PyMarshal_Read*() errors in run_pyc_file()
Detect also earlier PyMarshal_Read*() errors in zipimport.
11 years ago
Zachary Ware
c4821d62b4
Closes #22869 : Move PyOS_CheckStack back to pythonrun.c
11 years ago
Steve Dower
9b59dd4781
Issue #22869 : Remove duplicate stack check from pythonrun.c
11 years ago
Nick Coghlan
d600951748
Issue #22869 : Split pythonrun into two modules
- interpreter startup and shutdown code moved to a new
pylifecycle.c module
- Py_OptimizeFlag moved into the new module with the other
global flags
11 years ago
Victor Stinner
a5b335e62f
Issue #20597 , #21274 : Remove unused definition of PATH_MAX on GNU/Hurd,
MAXPATHLEN is now preferred.
11 years ago
Victor Stinner
ce43f38ace
Issue #20597 : Remove unused definition of PATH_MAX on Windows, MAXPATHLEN is
now preferred. Patch written by Jeffrey Armstrong.
11 years ago
Victor Stinner
0011124dc2
Issue #22043 : _PyTime_Init() now checks if the system clock works.
Other changes:
* The whole _PyTime API is private (not defined if Py_LIMITED_API is set)
* _PyTime_gettimeofday_info() also returns -1 on error
* Simplify PyTime_gettimeofday(): only use clock_gettime(CLOCK_REALTIME) or
gettimeofday() on UNIX. Don't fallback to ftime() or time() anymore.
11 years ago
Victor Stinner
98ea54c35c
Issue #22156 : Fix "comparison between signed and unsigned integers" compiler
warnings in the Python/ subdirectory.
12 years ago
Antoine Pitrou
9845c7ebc5
Issue #21425 : Fix flushing of standard streams in the interactive interpreter.
12 years ago
doko@ubuntu.com
4a173bc4ed
Fixes for KFreeBSD and the Hurd:
- Issue #21274 : Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.
- Issue #21276 : posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.
- Issue #21275 : Fix a socket test on KFreeBSD.
12 years ago
Victor Stinner
518e610977
Issue #19977 , #19036 : Always include <locale.h> in pythonrun.c
to get LC_CTYPE constant on Windows.
12 years ago
Victor Stinner
7143029d43
Issue #19977 : When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),
:py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the
``surrogateescape`` error handler, instead of the ``strict`` error handler.
12 years ago
Victor Stinner
15054c16c8
Issue #20526 , #19466 : Revert changes of issue #19466 which introduces a
regression: don't clear anymore the state of Python threads early during the
Python shutdown.
12 years ago
Victor Stinner
933538edde
Issue #20526 , #19466 : Revert changes of issue #19466 which introduces a
regression: don't clear anymore the state of Python threads early during the
Python shutdown.
12 years ago
Nick Coghlan
d979e4335d
Close #20500 : Don't trigger PyObject_Str assertion at shutdown
12 years ago
Serhiy Storchaka
65fd0592fb
Issue #2382 : SyntaxError cursor "^" now is written at correct position in most
cases when multibyte characters are in line (before "^"). This still not
works correctly with wide East Asian characters.
12 years ago
Victor Stinner
52ce3b04d0
Issue #19817 : Fix print_exception(), clear the exception on error
12 years ago
Victor Stinner
be0708f066
Closes #19831 : Stop tracemalloc later at Python shutdown to be able to use
tracemalloc in objects destructor
Replace atexit handler with an harcoded C function _PyTraceMalloc_Fini().
12 years ago
Victor Stinner
ed3b0bca3e
Issue #18874 : Implement the PEP 454 (tracemalloc)
12 years ago
Christian Heimes
985ecdcfc2
ssue #19183 : Implement PEP 456 'secure and interchangeable hash algorithm'.
Python now uses SipHash24 on all major platforms.
12 years ago
Victor Stinner
2f5bbc6a12
pythonrun.c: fix Py_GetPythonHome(), use Py_ARRAY_LENGTH() to get the size of
the env_home buffer, not PATH_MAX+1. env_home is declared using MAXPATHLEN+1,
and PATH_MAX is not declared on IRIX.
12 years ago
Victor Stinner
3f36a5736b
Issue #19515 : Remove identifiers duplicated in the same file.
Patch written by Andrei Dorian Duma.
12 years ago
Victor Stinner
dcf17f8a55
Issue #19466 : Fix typo. Patch written by Vajrasky Kok.
12 years ago
Victor Stinner
45956b9a33
Close #19466 : Clear the frames of daemon threads earlier during the Python
shutdown to call objects destructors. So "unclosed file" resource warnings are
now corretly emitted for daemon threads.
12 years ago
Victor Stinner
bd303c165b
Issue #19512 , #19515 : remove shared identifiers, move identifiers where they
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
12 years ago
Victor Stinner
efa7a0e155
print_error_text() doesn't encode the filename anymore
Use aslo PyUnicode_FromFormat() to format the line so only one call to
PyFile_WriteObject() is needed. tb_displayline() of Python/traceback.c has
similar implementation.
12 years ago
Victor Stinner
ad14ccd047
Issue #19512 : add _PyUnicode_CompareWithId() function
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString()
when both strings are equal and interned.
Add also _PyId_builtins identifier for "builtins" common string.
12 years ago
Victor Stinner
937114f704
print_exception(): don't encode the module name to UTF-8
Replace _PyUnicode_AsString()+strcmp() with PyUnicode_CompareWithASCIIString().
12 years ago
Victor Stinner
090543736f
Issue #19512 : add some common identifiers to only create common strings once,
instead of creating temporary Unicode string objects
Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
12 years ago
Victor Stinner
95701bdf40
Issue #19512 : Add PyRun_InteractiveOneObject() function
Only decode the filename once. PyRun_InteractiveOneObject() uses an identifier
for "<string>" string, so the byte string is only decoded once.
12 years ago
Victor Stinner
4ee41c5839
Issue #19512 : _print_total_refs() now uses an identifier to get "showrefcount"
key from sys._xoptions
12 years ago