301 Commits

Author SHA1 Message Date
Martin v. Löwis
8a64048a22 Backport of r64212
Issue #1683: prevent forking from interfering in threading storage.
2008-12-13 14:59:04 +00:00
Benjamin Peterson
d1c7d07d67 make sure to give a 'as' and 'with' parser warning even after import statements #3936 2008-09-25 20:46:05 +00:00
Martin v. Löwis
73c01d4101 Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
2008-02-14 11:26:18 +00:00
Guido van Rossum
1c4282b41b Silence a compiler warning. 2008-01-25 06:11:53 +00:00
Christian Heimes
d2f4cb8cca Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support. 2008-01-23 14:20:41 +00:00
Georg Brandl
7bdff2c8e5 Issue #1882: when compiling code from a string, encoding cookies in the
second line of code were not always recognized correctly.
 (backport from rev. 60168)
2008-01-21 18:35:52 +00:00
Guido van Rossum
e15fab4298 Backport revision 58471, replace PyErr_Print() with PyErr_Clear(). 2007-11-15 20:39:53 +00:00
Martin v. Löwis
fc787d515d Patch #1031213: Decode source line in SyntaxErrors back to its original
source encoding.
2007-09-04 14:20:25 +00:00
Martin v. Löwis
9d179ce4f9 Prefix AST symbols with _Py_. Fixes #1637022. 2007-01-19 06:42:33 +00:00
Georg Brandl
a6b9ce185e Fix a bug in the parser's future statement handling that led to "with"
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
 (backport from rev. 51993)
2006-09-24 12:35:40 +00:00
Neal Norwitz
9ac8953568 Handle malloc failure.
Klocwork 281
2006-08-13 18:13:36 +00:00
Neal Norwitz
6bf1a8fe8b Handle NULL nodes while parsing. I'm not entirely sure this is correct.
There might be something else that needs to be done to setup the error.

Klocwork #295.
2006-08-12 01:49:12 +00:00
Neal Norwitz
71e05f1e0c Don't truncate if size_t is bigger than uint 2006-06-12 02:07:57 +00:00
Andrew M. Kuchling
12ca69bc0e Fix comment typo 2006-06-06 17:10:41 +00:00
Neal Norwitz
d21a7fffb1 Patch #1357836:
Prevent an invalid memory read from test_coding in case the done flag is set.
In that case, the loop isn't entered.  I wonder if rather than setting
the done flag in the cases before the loop, if they should just exit early.

This code looks like it should be refactored.

Backport candidate (also the early break above if decoding_fgets fails)
2006-06-02 06:23:00 +00:00
Martin v. Löwis
777367103c Patch #1475845: Raise IndentationError for unexpected indent. 2006-05-04 05:51:03 +00:00
Skip Montanaro
a0b6338823 C++ compiler cleanup: cast signed to unsigned 2006-04-18 00:53:06 +00:00
Martin v. Löwis
7580149bde Patch #1355883: Build Python-ast.c and Python-ast.h
independently. Fixes #1355883.
2006-04-14 15:02:32 +00:00
Martin v. Löwis
0cc56e5c59 Introduce asdl_int_seq, to hold cmpop_ty. 2006-04-13 12:29:43 +00:00
Anthony Baxter
7b782b61c5 more low-hanging fruit to make code compile under a C++ compiler. Not
entirely happy with the two new VISIT macros in compile.c, but I
couldn't see a better approach.
2006-04-11 12:01:56 +00:00
Neal Norwitz
08062d6665 As discussed on python-dev, really fix the PyMem_*/PyObject_* memory API
mismatches.  At least I hope this fixes them all.

This reverts part of my change from yesterday that converted everything
in Parser/*.c to use PyObject_* API.  The encoding doesn't really need
to use PyMem_*, however, it uses new_string() which must return PyMem_*
for handling the result of PyOS_Readline() which returns PyMem_* memory.

If there were 2 versions of new_string() one that returned PyMem_*
for tokens and one that return PyObject_* for encodings that could
also fix this problem.  I'm not sure which version would be clearer.
This seems to fix both Guido's and Phillip's problems, so it's good enough
for now.  After this change, it would be good to review Parser/*.c
for consistent use of the 2 memory APIs.
2006-04-11 08:19:15 +00:00
Martin v. Löwis
01b810106c Make _kind types global for C++ compilation.
Explicitly cast void* to int to cmpop_ty.
2006-04-11 08:06:50 +00:00
Anthony Baxter
114900298e Fix the code in Parser/ to also compile with C++. This was mostly casts for
malloc/realloc type functions, as well as renaming one variable called 'new'
in tokensizer.c. Still lots more to be done, going to be checking in one
chunk at a time or the patch will be massively huge. Still compiles ok with
gcc.
2006-04-11 05:39:14 +00:00
Neal Norwitz
2c4e4f9839 SF patch #1467512, fix double free with triple quoted string in standard build.
This was the result of inconsistent use of PyMem_* and PyObject_* allocators.
By changing to use PyObject_* allocator almost everywhere, this removes
the inconsistency.
2006-04-10 06:42:25 +00:00
Jeremy Hylton
76c21bdb46 Make path calculation platform independent 2006-04-04 12:11:12 +00:00