Commit Graph

33064 Commits

Author SHA1 Message Date
Tim Peters
15231548d2 doubletounicode(), longtounicode():
Py_SAFE_DOWNCAST can evaluate its first argument multiple
times in a debug build.  This caused two distinct assert-
failures in test_unicode run under a debug build.  Rewrote
the code in trivial ways so that multiple evaluation of the
first argument doesn't hurt.
2006-02-16 01:08:01 +00:00
Tim Peters
c7f6cf6247 getpythonregpath(): Squash compiler warning about
mixing signed and unsigned types in comparison.
Relatedly, `dataSize` is declared as DWORD, not as
int, so change relevant cast from (int) to (DWORD).
2006-02-16 00:35:06 +00:00
Thomas Wouters
4701af5bf5 Remove two unused Py_ssize_t variables (merge glitches, looks like.) 2006-02-15 23:10:32 +00:00
Thomas Wouters
b1410fb433 Avoid unused variables when SIZEOF_SIZE_T == SIZEOF_LONG. Also normalize
whitespace.
2006-02-15 23:08:56 +00:00
Vinay Sajip
55aafab04f Added some more versionchanged markup. 2006-02-15 21:47:32 +00:00
Martin v. Löwis
a87c445177 Remove C99ism. 2006-02-15 19:56:18 +00:00
Martin v. Löwis
2ae3c91db2 Drop py:lastmerged. 2006-02-15 18:58:59 +00:00
Martin v. Löwis
18e165558b Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
Fred Drake
4482929734 use correct function in example 2006-02-15 06:55:57 +00:00
Neal Norwitz
79415523d6 Find test failures consistently 2006-02-15 06:07:32 +00:00
Tim Peters
219c164a47 randombits(): Stop compiler warning about mixing
signed with unsigned types in comparison.
2006-02-15 03:01:30 +00:00
Martin v. Löwis
9fb181bab3 Add _lsprof. 2006-02-14 21:25:29 +00:00
Martin v. Löwis
856bf9a4e9 Add build support for AMD64. 2006-02-14 20:42:55 +00:00
Tim Peters
cffcfed126 New test code failed to close the file. This caused
test_file to fail on Windows in reality (can't delete
a still-open file), but a new bare "except:" hid that
test_file failed on Windows, and leaving behind the
still-open TESTFN caused a cascade of bogus failures
in later tests.

So, close the file, and stop hiding failure to unlink.
2006-02-14 17:41:18 +00:00
Armin Rigo
967aa8b349 * Refcount leak. It was just a reference to Py_None, but still.
* Allow the 3rd argument to generator.throw() to be None.
  The 'raise' statement does the same, and anyway it follows the
  general policy that optional arguments of built-ins should, when
  reasonable, have a default value specifiable from Python.
2006-02-14 15:50:44 +00:00
Neal Norwitz
88b78d8cd4 Support 2.4 (released versions) better. (rsync was not working with adding the *. Only some files/dirs were copied, not everything.) 2006-02-14 08:14:16 +00:00
Neal Norwitz
c16dd48ee1 Doc some user visible changes 2006-02-13 02:04:37 +00:00
Neal Norwitz
389cea8efc Try to improve name based on discussion on python-checkins with Jim Jewett 2006-02-13 00:35:21 +00:00
Thomas Wouters
c45251a485 SF patch #1397960: When mixing file-iteration and
readline/readlines/read/readinto, loudly break by raising ValueError, rather
than silently deliver data out of order or hitting EOF prematurely.

Probably not a bugfix candidate, even though it affects no 'working' code.
2006-02-12 11:53:32 +00:00
Armin Rigo
f5b3e36493 Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
2006-02-11 21:32:43 +00:00
Tim Peters
cbcdfdc112 Whitespace normalization. 2006-02-11 18:32:21 +00:00
Georg Brandl
8ed1ca8fe1 Even more copyright year locations! 2006-02-11 18:22:59 +00:00
Martin v. Löwis
a55e55e9f3 Patch #428494: Prefer linking against ncursesw over ncurses library 2006-02-11 15:55:14 +00:00
Georg Brandl
b69406dc09 Update general copyright years to 2006. 2006-02-11 15:30:36 +00:00
Martin v. Löwis
f84d1b9375 Introduce Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE.
Proposed by Tim Peters.
2006-02-11 09:27:05 +00:00
Thomas Wouters
03ca23d892 Explain the clearing of the stack in a comment in Python/ceval.c's
call_function(), rather than commenting on the lack of an explanation in a
comment.
2006-02-10 22:51:45 +00:00
Jack Jansen
c49250264d One more mod for support of C++ classes. 2006-02-10 22:15:09 +00:00
Martin v. Löwis
82bca63c2b Avoid linking python with readline. 2006-02-10 20:49:30 +00:00
Jack Jansen
03904bf20b For overriding C++ methods we also need to know whether a parameter
is an output parameter or not. Added support for that.
2006-02-10 16:17:24 +00:00
Armin Rigo
2bc23f512d The default timer unit was incorrectly measured in milliseconds instead
of seconds, producing numbers 1000 times too large.  It would be nice to
write a test for this, but how...  (thanks mwh)
2006-02-10 13:19:53 +00:00
Vinay Sajip
b4549c4a7e Added information on function name added to LogRecord, and the 'extra' keyword parameter. 2006-02-09 08:54:11 +00:00
Vinay Sajip
ed1992f2aa Added function name to LogRecord. 2006-02-09 08:48:36 +00:00
Vinay Sajip
260ce43252 Propagate exceptions from shutdown() if raiseExceptions is not set.
Added 'extra' keyword argument handling to logging calls, as discussed on python-dev.
2006-02-09 08:34:14 +00:00
Vinay Sajip
1eb77a50c8 Added lock acquisition/release around shared data structure manipulation 2006-02-09 08:31:00 +00:00
Neal Norwitz
bd3490abdb Be a little less sensitive to failures. Only check for the result from
regrtest.py.  If we grep for just "fail", that finds bsddb deadlock
messages, which presumably are just warnings.  They don't cause
a test failure.
2006-02-09 05:08:56 +00:00
Brett Cannon
82a9394237 Add doc discussing how AST compiler is structured and designed.
It is out of date, though, thanks to lacking info on the arena API.  It also
should eventually be removed in favor of updating PEP 339.
2006-02-09 02:43:14 +00:00
Barry Warsaw
e58df82919 Port relevant patches for SF 1409455 to the trunk for email 3.0/Python 2.5.
Will port to Python 2.4.
2006-02-08 14:34:21 +00:00
Armin Rigo
a871ef2b3e Added the cProfile module.
Based on lsprof (patch #1212837) by Brett Rosen and Ted Czotter.
With further editing by Michael Hudson and myself.
History in svn repo: http://codespeak.net/svn/user/arigo/hack/misc/lsprof

* Module/_lsprof.c is the internal C module, Lib/cProfile.py a wrapper.
* pstats.py updated to display cProfile's caller/callee timings if available.
* setup.py and NEWS updated.
* documentation updates in the profiler section:
   - explain the differences between the three profilers that we have now
   - profile and cProfile can use a unified documentation, like (c)Pickle
   - mention that hotshot is "for specialized usage" now
   - removed references to the "old profiler" that no longer exists
* test updates:
   - extended test_profile to cover delicate cases like recursion
   - added tests for the caller/callee displays
   - added test_cProfile, performing the same tests for cProfile
* TO-DO:
   - cProfile gives a nicer name to built-in, particularly built-in methods,
     which could be backported to profile.
   - not tested on Windows recently!
2006-02-08 12:53:56 +00:00
Andrew M. Kuchling
5eefdca654 Update projected release date 2006-02-08 11:36:09 +00:00
Jack Jansen
35f82d7051 Fixed an oversight and a misunderstanding of PEP253:
- Call tp_dealloc on the static baseclass, not dynamic (which leads to
  infinite loops with more than one baseclass)
- Call tp_new and tp_init on baseclasses (overridable)
-This line, and those below, will be ignored--

M    bgen/bgenObjectDefinition.py
2006-02-07 22:28:09 +00:00
Vinay Sajip
e0f85926d6 Removed defensive test in Handler.close 2006-02-07 13:55:52 +00:00
Vinay Sajip
f0a95eca45 Saved and restored logging._handlerList at the same time as saving/restoring logging._handlers. 2006-02-07 13:44:48 +00:00
Neal Norwitz
05110aaef5 Add versionadded note for new methods 2006-02-07 07:23:26 +00:00
Neal Norwitz
082b2df33f Bug #876637, prevent stack corruption when socket descriptor
is larger than FD_SETSIZE.

This can only be acheived with ulimit -n SOME_NUMBER_BIGGER_THAN_FD_SETSIZE
which is typically only available to root.  Since this wouldn't normally
be run in a test (ie, run as root), it doesn't seem too worthwhile to
add a normal test.  The bug report has one version of a test.  I've
written another.  Not sure what the best thing to do is.

Do the check before calling internal_select() because we can't set
an error in between Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.
This seemed the clearest solution, ie handle before calling internal_select()
rather than inside.  Plus there is at least one place outside
of internal_select() that needed to be handled.

Will backport.
2006-02-07 07:04:46 +00:00
Neal Norwitz
19cbcad20e Fix indentation (whitespace only). 2006-02-07 06:59:20 +00:00
Neal Norwitz
02876df9de Check return results for errors 2006-02-07 06:58:52 +00:00
Martin v. Löwis
0075690ced Patch #1412872: zipfile: use correct system type on unixy systems. 2006-02-05 17:09:41 +00:00
Neal Norwitz
55cd82fe0a Get test_logging to not hang when running under regrtest.py -R ::
Not sure why/how _handlers/_handlerList is out of sync.  This could
indicate a deeper problem.

In test_logging, the only absolutely necessary change to get working
was tcpserver.abort = 1.  But we don't want to wait infinitely
to join the threads, so give a 2.0 second timeout.

There doesn't appear to be a need for a local abort variable
in serve_until_stopped, so just use the instance member.

Note the problem is only on HEAD, not in 2.4.
2006-02-05 08:21:08 +00:00
Neal Norwitz
0e6bc8c260 Patch #1407135, bug #1424041, make mmap.mmap(-1, length) work the same
on both Unix (SVR4 and BSD) and Windows.  Restores behaviour of passing -1
for anonymous memory on Unix.  Use MAP_ANONYMOUS instead of _ANON since
the latter is deprecated according to Linux (gentoo) man pages.

Should we continue to allow mmap.mmap(0, length) to work on Windows?
0 is a valid fd.

Will backport bugfix portions.
2006-02-05 05:45:43 +00:00
Neal Norwitz
d1cfc8ade1 Whitespace normalization 2006-02-05 03:36:57 +00:00