Commit Graph

1884 Commits

Author SHA1 Message Date
Alex Martelli
b34ac7371c regressing the performance bugfix -- Guido wants the performance bug left
alone, because there can be no guarantee re the semantics of += vs + .
2003-10-25 23:22:55 +00:00
Alex Martelli
af1b4c95f9 changed builtin_sum to use PyNumber_InPlaceAdd -- unchanged semantics but
fixes performance bug with sum(lotsoflists, []).
2003-10-25 12:47:09 +00:00
Walter Dörwald
4958f2741a Backport checkin:
Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:34:48 +00:00
Jeremy Hylton
7fe9f6da18 Backport fix for SF808594: leak on lambda with duplicate arguments. 2003-09-22 04:41:21 +00:00
Martin v. Löwis
6280f00d49 Patch #805613: Fix usage of the PTH library. 2003-09-20 11:13:18 +00:00
Raymond Hettinger
c866ac776c Backport leak fix for new code objects. 2003-09-16 04:36:33 +00:00
Martin v. Löwis
abb296712f Patch #794826: Add __file__ in dynamically loaded modules for multiple
interpreters. Fixes #698282.
2003-09-04 18:46:39 +00:00
Walter Dörwald
afa2448b2a Backport checkin:
Fix a crash: when sq_item failed the code continued blindly and used the
NULL pointer. (Detected by Michael Hudson, patch provided by Neal Norwitz).

Fix refcounting leak in filtertuple().
2003-08-18 18:34:09 +00:00
Walter Dörwald
07089028f1 Backport checkin:
Fix refcount leak in the UnicodeError constructor:
When parsing the constructor arguments failed, a
reference to the argument tuple was leaked.
2003-08-14 21:00:28 +00:00
Walter Dörwald
0098d86433 Backport checkins:
* Enhance message for UnicodeEncodeError and UnicodeTranslateError.
  If there is only one bad character it will now be printed in a
  form that is a valid Python string.
* Add a unicode prefix to the characters in the UnicodeEncodeError
  and UnicodeTranslateError message.
2003-08-12 17:38:22 +00:00
Michael W. Hudson
0eb81f24a6 Repeat my refcount & cut&paste fixes on the branch. 2003-08-11 12:21:40 +00:00
Martin v. Löwis
144b440fc2 Move initialization of sys.std{in,out}.encoding to Py_Initialize.
Verify that the encoding actually exists. Fixes #775985.
2003-08-09 09:48:29 +00:00
Jason Tishler
fac083d14a Patch 775605: Cygwin pthread_sigmask() workaround patch
Cygwin's pthread_sigmask() implementation appears to be buggy. This
patch works around this problem by using sigprocmask() instead.

This patch is implemented in a general way so it could be used by other
platforms too. If this approach is deemed too risky, then I can work up
a patch that just hacks Python/thread_pthread.h for Cygwin.

Note that I tested this patch against 2.3c1 under Red Hat Linux 8.0 too.

[snip]
And finally, I need someone to regenerate pyconfig.h.in and configure
with the same versions of the autotools that are normally used by
Python.

Neal kindly regenerated pyconfig.h.in and configure for me.
2003-07-22 15:20:49 +00:00
Mark Hammond
5f4e8ca376 Correct previous patch looking for warnings module: sys.modules, not
sys.__modules__.
2003-07-16 01:54:38 +00:00
Mark Hammond
edd07737d7 Fix [ 771097 ] frozen programs fail due to implicit import of "warnings".
If the initial import of warnings fails, clear the error.  When the module
is actually needed, if the original import failed, see if it has managed
to find its way to sys.modules yet and if so, remember it.
2003-07-15 23:03:55 +00:00
Jeremy Hylton
1955fcf67a SF patch 763201: handling of SyntaxErrors in symbol table build
Fixes for three related bugs, including errors that caused a script to
be ignored without printing an error message.  The key problem was a bad
interaction between syntax warnings and syntax errors.  If an
exception was already set when a warning was issued, the warning could
clobber the exception.

The PyErr_Occurred() check in issue_warning() isn't entirely
satisfying (the caller should know whether there was already an
error), but a better solution isn't immediately obvious.

Bug fix candidate.
2003-07-15 20:23:26 +00:00
Martin v. Löwis
f9ce67d65f Initialize thread_id to 0 in unthreaded build. Fixes #770247. 2003-07-13 10:41:53 +00:00
Fred Drake
1e5fc55c4d - fix typo
- there's a weird variable name here (zimpimport), but I'll leave that
  for someone that's familiar with the ZIP import support
2003-07-11 15:01:02 +00:00
Tim Peters
e5e065b669 New function sys.getcheckinterval(), to complement setcheckinterval(). 2003-07-06 18:36:54 +00:00
Tim Peters
2e7e7df969 An Anonymous Coward on c.l.py posted a little program with bizarre
behavior, creating many threads very quickly.  A long debugging session
revealed that the Windows implementation of PyThread_start_new_thread()
was choked with "laziness" errors:

1. It checked MS _beginthread() for a failure return, but when that
   happened it returned heap trash as the function result, instead of
   an id of -1 (the proper error-return value).

2. It didn't consider that the Win32 CreateSemaphore() can fail.

3. When creating a great many threads very quickly, it's quite possible
   that any particular bootstrap call can take virtually any amount of
   time to return.  But the code waited for a maximum of 5 seconds, and
   didn't check to see whether the semaphore it was waiting for got
   signaled.  If it in fact timed out, the function could again return
   heap trash as the function result.  This is actually what confused
   the test program, as the heap trash usually turned out to be 0, and
   then multiple threads all got id 0 simultaneously, confusing the
   hell out of threading.py's _active dict (mapping id to thread
   object).  A variety of baffling behaviors followed from that.

WRT #1 and #2, error returns are checked now, and "thread.error: can't
start new thread" gets raised now if a new thread (or new semaphore)
can't be created.  WRT #3, we now wait for the semaphore without a
timeout.

Also removed useless local vrbls, folded long lines, and changed callobj
to a stack auto (it was going thru malloc/free instead, for no discernible
reason).

Bugfix candidate.
2003-07-04 04:40:45 +00:00
Neal Norwitz
c5131bc256 Fix SF #762455, segfault when sys.stdout is changed in getattr
Will backport.
2003-06-29 14:48:32 +00:00
Guido van Rossum
b8b6d0c2c6 Add PyThreadState_SetAsyncExc(long, PyObject *).
A new API (only accessible from C) to interrupt a thread by sending it
an exception.  This is not always effective, but might help some people.
Requested by Just van Rossum and Alex Martelli.  It is intentional
that you have to write your own C extension to call it from Python.

Docs will have to wait.
2003-06-28 21:53:52 +00:00
Jeremy Hylton
c44dbc46fe Better error message 2003-06-21 21:35:25 +00:00
Raymond Hettinger
b9572c3456 Removed bytecode transformation for sequence packing/unpacking.
It depended on the previously removed basic block checker to
prevent a jump into the middle of the transformed block.

Clears SF 757818: tuple assignment -- SystemError: unknown opcode
2003-06-20 16:13:17 +00:00
Neil Schemenauer
00b0966f20 Don't use the module object setattr when importing submodules. Instead,
operate on the module dictionary directly.  This prevents spurious
depreciation warnings from being raised if a submodule name shadows
a builtin name.
2003-06-16 21:03:07 +00:00