Commit graph

3211 commits

Author SHA1 Message Date
Benjamin Peterson
7adbb5a35d #7050 fix a SystemError when using tuple unpacking and augmented assignment 2009-10-03 20:23:24 +00:00
Mark Dickinson
c3a12775e2 Issue #7019: An attempt to unmarshal bad long data could produce
unnormalized PyLong objects; make it raise ValueError instead.
2009-10-03 08:15:49 +00:00
Mark Dickinson
7e7a3ec901 Issue #7019: Unmarshalling of bad long data could produce unnormalized
PyLongs.  Raise ValueError instead.
2009-09-29 19:01:06 +00:00
Thomas Wouters
448db2155f Merged revisions 74841 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74841 | thomas.wouters | 2009-09-16 12:55:54 -0700 (Wed, 16 Sep 2009) | 23 lines


  Fix issue #1590864, multiple threads and fork() can cause deadlocks, by
  acquiring the import lock around fork() calls. This prevents other threads
  from having that lock while the fork happens, and is the recommended way of
  dealing with such issues. There are two other locks we care about, the GIL
  and the Thread Local Storage lock. The GIL is obviously held when calling
  Python functions like os.fork(), and the TLS lock is explicitly reallocated
  instead, while also deleting now-orphaned TLS data.

  This only fixes calls to os.fork(), not extension modules or embedding
  programs calling C's fork() directly. Solving that requires a new set of API
  functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
  warning explaining the problem to the documentation in the mean time.

  This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
  getting the import lock reallocated, seemingly to avoid this very same
  problem. This is not the right approach, because the import lock is a
  re-entrant one, and reallocating would do the wrong thing when forking while
  holding the import lock.

  Will backport to 2.6, minus the tiny AIX behaviour change.
........
2009-09-16 20:06:36 +00:00
Thomas Wouters
c4dcb3801e Fix issue #1590864, multiple threads and fork() can cause deadlocks, by
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.

This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.

This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.

Will backport to 2.6, minus the tiny AIX behaviour change.
2009-09-16 19:55:54 +00:00
Benjamin Peterson
93ed82048f revert unintended changes 2009-09-09 11:42:57 +00:00
Benjamin Peterson
8246968b12 tabbify 2009-09-09 11:40:54 +00:00
Benjamin Peterson
d692a71fdd revert r74699 since it loses useful error information 2009-09-07 13:02:15 +00:00
Benjamin Peterson
5515990ee1 PyObject_GetIter can set an error for its self just fine 2009-09-06 22:43:39 +00:00
Benjamin Peterson
c0ba828857 better col_offsets for "for" statements with tuple unpacking #6704
Patch from Frank Wierzbicki.
2009-08-15 22:59:21 +00:00
Sean Reifscheider
9279e7d177 - Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
NUL: Bogus TypeError detail string.
2009-08-01 23:54:55 +00:00
Amaury Forgeot d'Arc
982b2fa32d Better name a variable: 'buf' seems to imply a mutable buffer. 2009-07-25 16:22:06 +00:00
Benjamin Peterson
4879c907ce the Slice in x[::] has to have step as None to help the interpreter 2009-07-20 20:28:08 +00:00
R. David Murray
e38b0a8ec0 Merged revisions 73870,73879,73899-73900,73905-73906 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73870 | r.david.murray | 2009-07-06 21:06:13 -0400 (Mon, 06 Jul 2009) | 5 lines

  Issue 6070: when creating a compiled file, after copying the mode bits, on
  posix zap the execute bit in case it was set on the .py file, since the
  compiled files are not directly executable on posix.  Patch by Marco N.
........
  r73879 | r.david.murray | 2009-07-07 05:54:16 -0400 (Tue, 07 Jul 2009) | 3 lines

  Update issue 6070 patch to match the patch that was actually tested
  on Windows.
........
  r73899 | r.david.murray | 2009-07-08 21:43:41 -0400 (Wed, 08 Jul 2009) | 3 lines

  Conditionalize test cleanup code to eliminate traceback, which will
  hopefully reveal the real problem.
........
  r73900 | r.david.murray | 2009-07-08 22:06:17 -0400 (Wed, 08 Jul 2009) | 2 lines

  Make test work with -O.
........
  r73905 | r.david.murray | 2009-07-09 09:55:44 -0400 (Thu, 09 Jul 2009) | 3 lines

  Specify umask in execute bit test to get consistent results
  and make sure we test resetting all three execute bits.
........
  r73906 | r.david.murray | 2009-07-09 11:35:33 -0400 (Thu, 09 Jul 2009) | 5 lines

  Curdir needs to be in the path for the test to work on all buildbots.
  (I copied this from another import test, but currently this will fail if
  TESTFN ends up in /tmp...see issue 2609).
........
2009-07-19 01:44:23 +00:00
Hirokazu Yamamoto
fcaa2104aa Merged revisions 74040,74042 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74040 | hirokazu.yamamoto | 2009-07-17 15:20:46 +0900 | 1 line

  Issue #6415: Fixed warnings.warn sagfault on bad formatted string.
........
  r74042 | hirokazu.yamamoto | 2009-07-17 15:26:54 +0900 | 1 line

  NEWS about r74040.
........
2009-07-17 06:33:03 +00:00
Hirokazu Yamamoto
e78e5d2e51 Issue #6415: Fixed warnings.warn sagfault on bad formatted string. 2009-07-17 06:20:46 +00:00
R. David Murray
3310a10a68 Update issue 6070 patch to match the patch that was actually tested
on Windows.
2009-07-07 09:54:16 +00:00
R. David Murray
23a736a4f0 Issue 6070: when creating a compiled file, after copying the mode bits, on
posix zap the execute bit in case it was set on the .py file, since the
compiled files are not directly executable on posix.  Patch by Marco N.
2009-07-07 01:06:13 +00:00
Benjamin Peterson
7d6b01417f Merged revisions 73776 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73776 | benjamin.peterson | 2009-07-02 13:16:45 -0500 (Thu, 02 Jul 2009) | 1 line

  when print() gets unicode arguments, sep and end should be unicode by default #4618
........
2009-07-02 18:19:47 +00:00
Benjamin Peterson
753d16234f when print() gets unicode arguments, sep and end should be unicode by default #4618 2009-07-02 18:16:45 +00:00
Benjamin Peterson
4a3cf191f4 small optimization: avoid popping the current block until we have to 2009-07-01 23:45:19 +00:00
Georg Brandl
e323e0e91a Fix error handling in PyCode_Optimize, by Alexander Schremmer at EuroPython sprint. 2009-06-29 14:44:49 +00:00
Alexandre Vassalotti
7274cffa9e Update docstrings for sys.getdlopenflags() and sys.setdlopenflags(). 2009-06-29 01:01:51 +00:00
Benjamin Peterson
8f7b94eae9 use stack macros 2009-06-28 16:14:07 +00:00
Benjamin Peterson
b8338ab92c add two generic macros for peeking and setting in the stack 2009-06-28 16:08:02 +00:00
Benjamin Peterson
1a4ceb2f4b fix grammar 2009-06-23 01:18:57 +00:00
Benjamin Peterson
d9920c255d remove tmpname support since it's no longer used 2009-06-21 23:03:36 +00:00
Benjamin Peterson
f67caf8523 don't need to add the name 'lambda' as assigned 2009-06-21 23:01:07 +00:00
Benjamin Peterson
5ecf57adcf remove unused 'encoding' member from the compiler struct 2009-06-17 03:23:04 +00:00
Benjamin Peterson
8fa3e933c1 update ast version 2009-06-13 20:30:48 +00:00
Benjamin Peterson
a72be3b325 when no module is given in a 'from' relative import, make ImportFrom.module NULL 2009-06-13 20:23:33 +00:00
Benjamin Peterson
52c4bec76b give a better error message when deleting () 2009-06-13 17:08:53 +00:00
Benjamin Peterson
5d1ff94b9e set Print.values to NULL if there are no values 2009-06-13 16:19:19 +00:00
Benjamin Peterson
d1f5a59edb allow importing from a module named None if it has an 'as' clause 2009-06-13 13:06:21 +00:00
Benjamin Peterson
565e1b6bb7 prevent import statements from assigning to None 2009-06-13 03:46:30 +00:00
Benjamin Peterson
4afbba3d34 keep the slice.step field as NULL if no step expression is given 2009-06-13 01:40:00 +00:00
Alexandre Vassalotti
a6e3474d02 Add const qualifier to PyErr_SetFromErrnoWithFilename and to
PyErr_SetFromErrnoWithUnicodeFilename.
2009-06-12 20:57:12 +00:00
Benjamin Peterson
4efb5d0b82 remove check for case handled in sub-function 2009-06-11 22:29:23 +00:00
Benjamin Peterson
b266481ed8 revert r73361 2009-06-11 17:49:38 +00:00
Benjamin Peterson
e5fa5fe8fc remove duplicate check 2009-06-11 16:25:52 +00:00
Benjamin Peterson
a5a5728cf0 remove error checks already done in set_context() 2009-06-08 23:44:13 +00:00
Benjamin Peterson
8ea4ded9a6 remove useless assertion 2009-06-08 22:18:32 +00:00
Antoine Pitrou
6987d54116 Merged revisions 73064-73065 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73064 | antoine.pitrou | 2009-05-30 23:27:00 +0200 (sam., 30 mai 2009) | 4 lines

  Issue #5330: C functions called with keyword arguments were not reported by
  the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
........
  r73065 | antoine.pitrou | 2009-05-30 23:39:25 +0200 (sam., 30 mai 2009) | 3 lines

  The test for #5330 wasn't correct.
........
2009-05-30 21:43:48 +00:00
Antoine Pitrou
46dbe27f7e Issue #5330: C functions called with keyword arguments were not reported by
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
2009-05-30 21:27:00 +00:00
Jeffrey Yasskin
7937d939b1 Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-g
-Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without.
There's still a batch of non-prototype warnings in Xlib.h that I don't know how
to fix.
2009-05-29 03:44:31 +00:00
Philip Jenvey
dd0388a1c2 further hint to where the open docs really are 2009-05-28 03:12:16 +00:00
Benjamin Peterson
aafa18aa05 teach the peepholer about SETUP_WITH 2009-05-26 12:49:59 +00:00
Georg Brandl
944f684ce6 Allow multiple context managers in one with statement, as proposed
in http://codereview.appspot.com/53094 and accepted by Guido.

The construct is transformed into multiple With AST nodes so that
there should be no problems with the semantics.
2009-05-25 21:02:56 +00:00
Benjamin Peterson
49a6b0ef70 take into account the fact that SETUP_WITH pushes a finally block 2009-05-25 20:12:57 +00:00
Benjamin Peterson
1880d8b823 add a SETUP_WITH opcode
It speeds up the with statement and correctly looks up the special
methods involved.
2009-05-25 13:13:44 +00:00