summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
AgeCommit message (Collapse)AuthorLines
2008-06-01Typo: encoding -> codeset.Martin v. Löwis-1/+1
2008-06-01Move sys_stream and sys_isatty out of the have-langinfo block.Martin v. Löwis-1/+1
2008-06-01New environment variable PYTHONIOENCODING.Martin v. Löwis-28/+73
2008-05-26Renamed PyString to PyBytesChristian Heimes-14/+14
2008-05-26First step of the C API rename:Christian Heimes-2/+2
renamed Include/bytesobject.h to Include/bytearrayobject.h renamed Include/stringobject.h to Include/bytesobject.h added Include/stringobject.h with aliases
2008-05-11#2816: clarify error messages for EOF while scanning strings.Georg Brandl-2/+2
2008-05-06Implemented PEP 370Christian Heimes-0/+1
2008-04-12Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon-59/+14
'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
2008-03-26C89 compliance: Microsoft compilers want variable declarations at the topAmaury Forgeot d'Arc-4/+2
2008-03-26Initialize PyCompilerFlags cf_flags with 0Christian Heimes-0/+2
2008-03-26Patch #2477: Added from __future__ import unicode_literalsChristian Heimes-7/+23
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
2008-03-26Merged revisions ↵Christian Heimes-1/+26
61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........
2008-03-18Backport of the print function, using a __future__ import.Eric Smith-4/+5
This work is substantially Anthony Baxter's, from issue 1633807. I just freshened it, made a few minor tweaks, and added the test cases. I also created issue 2412, which is to check for 2to3's behavior with the print function. I also added myself to ACKS.
2008-02-18Perform correct handling of stack overflow for windows: Catch the correct ↵Kristján Valur Jónsson-2/+8
exception code and reset the overflow condition when handled.
2008-02-08Deallocate content of the dict free list on interpreter shutdownChristian Heimes-0/+1
2008-01-27Added clear cache methods to clear the internal type lookup cache for ref ↵Christian Heimes-0/+3
leak test runs.
2008-01-07Patch #602345 by Neal Norwitz and me: add -B option and ↵Georg Brandl-0/+3
PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
2007-11-29Issue #1402: PyInterpreterState_Clear() may still invoke user codeAmaury Forgeot d'Arc-5/+5
(in deallocation of running threads, for example), so the PyGILState_Release() function must still be functional. On the other hand, _PyGILState_Fini() only frees memory, and can be called later. Backport candidate, but only after some experts comment on it.
2007-04-25Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit ↵Kristján Valur Jónsson-0/+1
typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
2007-03-12Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. ↵Collin Winter-0/+4
Fixed by patch #922167. Will backport.
2007-03-12Bug #1678647: write a newline after printing an exception in anyGeorg Brandl-2/+2
case, even when converting the value to a string failed.
2007-03-07Patch #703779: unset __file__ in __main__ after running a file. ThisGeorg Brandl-3/+11
makes the filenames the warning module prints much more sensible when a PYTHONSTARTUP file is used.
2007-03-07Variant of patch #697613: don't exit the interpreter on a SystemExitGeorg Brandl-0/+6
exception if the -i command line option or PYTHONINSPECT environment variable is given, but break into the interactive interpreter just like on other exceptions or normal program exit. (backport)
2007-03-06Bug #1674503: close the file opened by execfile() in an error condition.Georg Brandl-2/+2
2007-01-23SF patch #1630975: Fix crash when replacing sys.stdout in sitecustomizeThomas Wouters-3/+6
When running the interpreter in an environment that would cause it to set stdout/stderr/stdin's encoding, having a sitecustomize that would replace them with something other than PyFile objects would crash the interpreter. Fix it by simply ignoring the encoding-setting for non-files. This could do with a test, but I can think of no maintainable and portable way to test this bug, short of adding a sitecustomize.py to the buildsystem and have it always run with it (hmmm....)
2006-09-06with and as are now keywords. There are some generated files I can't recreate.Neal Norwitz-0/+7
2006-08-21Handle a few more error conditions.Neal Norwitz-0/+5
Klocwork 301 and 302. Will backport.
2006-08-12PyModule_GetDict() can fail, produce fatal errors if this happens on startup.Neal Norwitz-0/+4
Klocwork #298-299.
2006-08-12Whoops, how did that get in there. :-) Revert all the parts of 51227 that ↵Neal Norwitz-3/+0
were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed
2006-08-12Check returned pointer is valid.Neal Norwitz-0/+3
Klocwork #233
2006-07-22Fix more memory allocation issues found with failmalloc.Neal Norwitz-6/+17
2006-07-21Handle more memory allocation failures without crashing.Neal Norwitz-4/+13
2006-07-17Reported by Klocwork #151.Neal Norwitz-2/+13
v2 can be NULL if exception2 is NULL. I don't think that condition can happen, but I'm not sure it can't either. Now the code will protect against either being NULL.
2006-06-10Patch #1495999: Part two of Windows CE changes.Martin v. Löwis-0/+2
- update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
2006-05-28PyErr_Display(), PyErr_WriteUnraisable(): Coverity found a cut-and-pasteTim Peters-13/+15
bug in both: `className` was referenced before being checked for NULL.
2006-05-27Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones-4/+8
2006-04-18Change those parts of the Python-api that were functions in 2.4, andThomas Heller-4/+96
are now macros to exported functions again. Fixes [ 1465834 ] bdist_wininst preinstall script support is broken in 2.5a1.
2006-04-18Remove types from type_list if they have no objectsMartin v. Löwis-2/+9
and unlist_types_without_objects is set. Give dump_counts a FILE* argument.
2006-04-13spread the extern "C" { } magic pixie dust around. Python itself builds nowAnthony Baxter-0/+9
using a C++ compiler. Still lots and lots of errors in the modules built by setup.py, and a bunch of warnings from g++ in the core.
2006-04-12Ignore the references to the dummy objects used as deleted keysArmin Rigo-1/+1
in dicts and sets when computing the total number of references.
2006-04-03Bug #1421664: Set sys.stderr.encodingMartin v. Löwis-0/+10
2006-03-28In format strings slinging Py_ssize_t, unconditionallyTim Peters-9/+6
interpolate PY_FORMAT_SIZE_T instead of #if'ing on MS_WIN64.
2006-03-26Years in the making.Tim Peters-1/+1
objimpl.h, pymem.h: Stop mapping PyMem_{Del, DEL} and PyMem_{Free, FREE} to PyObject_{Free, FREE} in a release build. They're aliases for the system free() now. _subprocess.c/sp_handle_dealloc(): Since the memory was originally obtained via PyObject_NEW, it must be released via PyObject_FREE (or _DEL). pythonrun.c, tokenizer.c, parsermodule.c: I lost count of the number of PyObject vs PyMem mismatches in these -- it's like the specific function called at each site was picked at random, sometimes even with memory obtained via PyMem getting released via PyObject. Changed most to use PyObject uniformly, since the blobs allocated are predictably small in most cases, and obmalloc is generally faster than system mallocs then. If extension modules in real life prove as sloppy as Python's front end, we'll have to revert the objimpl.h + pymem.h part of this patch. Note that no problems will show up in a debug build (all calls still go thru obmalloc then). Problems will show up only in a release build, most likely segfaults.
2006-03-07Address an coverity issue. Coverity was complaining about a line that's fine,Guido van Rossum-1/+2
but an earlier line checked for v != NULL unnecessarily.
2006-03-06Fix warnings on x86 (32-bit).Neal Norwitz-1/+2
2006-03-05Use %Id for size_t-ish things on Win64.Martin v. Löwis-1/+1
2006-03-04Use Py_ssize_t for _Py_RefTotal.Neal Norwitz-6/+12
I tried to handle Win64 properly, but please review.
2006-03-04TabifyNeal Norwitz-34/+34
2006-03-04Get rid of run_err_mod(). It was only used in two places.Neal Norwitz-14/+4
One place it wasn't necessary since mod was already checked. Inline the check that mod != NULL for the other use.
2006-03-02Fix refleak in PyErr_Display().Brett Cannon-15/+14