Christian Heimes
e8e4283cec
Remove redundant check for tb != NULL to shut up Coverity . It has been set to Py_None a couple of lines earlier.
CID 1291697 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking tb suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
11 years ago
Steve Dower
8fc8980c96
Issue #23524 : Replace _PyVerify_fd function with calls to _set_thread_local_invalid_parameter_handler.
11 years ago
Benjamin Peterson
55c14355ac
fix building without threads ( closes #23877 )
11 years ago
Victor Stinner
13019fdef3
Issue #22117 : Add a new _PyTime_FromSeconds() function
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
11 years ago
Serhiy Storchaka
53fa8b2a4b
Fixed few compiler warnings.
11 years ago
Zachary Ware
c4821d62b4
Closes #22869 : Move PyOS_CheckStack back to 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
Christian Heimes
49e61806f5
Issue #18603 : Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the
Python executable and not removed by the linker's optimizer.
12 years ago
Nick Coghlan
1805a62f1f
Issue #16129 : Py_SetStandardStreamEncoding cleanups
- don't call PyErr_NoMemory with interpreter is not initialised
- note that it's OK to call _PyMem_RawStrDup here
- don't include this in the limited API
- capitalise "IO"
- be explicit that a non-zero return indicates an error
- include versionadded marker in docs
12 years ago
Nick Coghlan
7d270ee05d
Issue #16129 : Add `Py_SetStandardStreamEncoding`
This new pre-initialization API allows embedding
applications like Blender to force a particular
encoding and error handler for the standard IO streams.
Also refactors Modules/_testembed.c to let us start
testing multiple embedding scenarios.
(Initial patch by Bastien Montagne)
12 years ago
Antoine Pitrou
24201d497c
Issue #18776 : atexit callbacks now display their full traceback when they raise an exception.
12 years ago
Serhiy Storchaka
bf28d2dcad
Issue #18818 : The "encodingname" part of PYTHONIOENCODING is now optional.
12 years ago
Antoine Pitrou
4879a963d4
Issue #18756 : os.urandom() now uses a lazily-opened persistent file descriptor, so as to avoid using many file descriptors when run in parallel from multiple threads.
13 years ago
Victor Stinner
55a1220bdb
pythonrun.c: use MAXPATHLEN instead of PATH_MAX
PATH_MAX is not available on "MIPS IRIX 6.5.30 [SB] 3.x" buildbot
13 years ago
Victor Stinner
daf455554b
Issue #18571 : Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
13 years ago
Victor Stinner
14e461d5b9
Close #11619 : The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
13 years ago
Antoine Pitrou
7eaf3f7080
Issue #18808 : Non-daemon threads are now automatically joined when a sub-interpreter is shutdown (it would previously dump a fatal error).
13 years ago
Christian Heimes
ad73a9cf97
Issue #16400 : Add command line option for isolated mode.
-I
Run Python in isolated mode. This also implies -E and -s. In isolated mode
sys.path contains neither the script’s directory nor the user’s
site-packages directory. All PYTHON* environment variables are ignored,
too. Further restrictions may be imposed to prevent the user from
injecting malicious code.
13 years ago
Antoine Pitrou
32d483c39b
Fix style
13 years ago
Victor Stinner
ba30883f60
Issue #18520 : Fix initstdio(), handle PySys_SetObject() failure
13 years ago
Victor Stinner
62ce62a3a1
Issue #18520 : initsite() is a little bit more verbose when import site fails
13 years ago
Victor Stinner
1c8f059019
Issue #18520 : Add a new PyStructSequence_InitType2() function, same than
PyStructSequence_InitType() except that it has a return value (0 on success,
-1 on error).
* PyStructSequence_InitType2() now raises MemoryError on memory allocation failure
* Fix also some calls to PyDict_SetItemString(): handle error
13 years ago
Victor Stinner
d786ad55ef
Issue #18520 : Fix initsigs(), handle PyOS_InitInterrupts() error
PyOS_InitInterrupts() can raise error when importing the signal module
13 years ago