Commit Graph

8020 Commits

Author SHA1 Message Date
Guido van Rossum ed538d8b39 Detabified.
Removed dead code.
2003-04-09 19:36:34 +00:00
Guido van Rossum a12fe4e81f - New function sys.call_tracing() allows pdb to debug code
recursively.
- pdb has a new command, "debug", which lets you step through
  arbitrary code from the debugger's (pdb) prompt.
2003-04-09 19:06:21 +00:00
Jason Tishler 70367d3a6c Patch #709178: remove -static option from cygwinccompiler
Currently, the cygwinccompiler.py compiler handling in
distutils is invoking the cygwin and mingw compilers
with the -static option.

Logically, this means that the linker should choose to
link to static libraries instead of shared/dynamically
linked libraries.

Current win32 binutils expect import libraries to have
a .dll.a suffix and static libraries to have .a suffix.
If -static is passed, it will skip the .dll.a
libraries. This is pain if one has a tree with both
static and dynamic libraries using this naming
convention, and wish to use the dynamic libraries.

The -static option being passed in distutils is to get
around a bug in old versions of binutils where it would
get confused when it found the DLLs themselves.

The decision to use static or shared libraries is site
or package specific, and should be left to the setup
script or to command line options.
2003-04-09 16:03:57 +00:00
Jack Jansen 0ae3220736 Detabbed. 2003-04-09 13:25:43 +00:00
Andrew M. Kuchling 058a84f36a Remove the --verify option in favor of the standard -n/--dry-run option 2003-04-09 12:35:51 +00:00
Skip Montanaro cfd55501bb add a #! line for unix weenies 2003-04-08 19:49:40 +00:00
Tim Peters 8805e66ec8 New tests identical to boom and boom2, except using new-style classes.
These never failed in 2.3, and the tests confirm it.  They still blow up
in the 2.2 branch, despite that all the gc-vs-__del__ fixes from 2.3
have been backported (and this is expected -- 2.2 needs more work than
2.3 needed).
2003-04-08 19:44:13 +00:00
Skip Montanaro fb2a6ccfc4 correct a couple docstring nits 2003-04-08 19:40:19 +00:00
Tim Peters 730f5535ba s/referrents/referents/g. Gotta love that referrers remains rife with rs. 2003-04-08 17:17:17 +00:00
Tim Peters 0f81ab6d88 Finished implementing gc.get_referrents(): dealt with error and end
cases, wrote docs, added a test.
2003-04-08 16:39:48 +00:00
Tim Peters f6b8045ca5 Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code.  Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.

Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.

To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong:  if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__".  But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted.  gc was
therefore incorrect in believing that the object had a finalizer.

The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.

While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer":  not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time.  Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.

So I believe the new method is better on all counts.

Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 19:21:15 +00:00
Raymond Hettinger f394df47fd SF bug #699934: Obscure error message
mwh pointed out that the error message did not
make sense if obtained by rearranging the bases.
2003-04-06 19:13:41 +00:00
Raymond Hettinger ff41c48a77 SF patch #701494: more apply removals 2003-04-06 09:01:11 +00:00
Tim Peters bf384c256e Reworked move_finalizer_reachable() to create two distinct lists:
externally unreachable objects with finalizers, and externally unreachable
objects without finalizers reachable from such objects.  This allows us
to call has_finalizer() at most once per object, and so limit the pain of
nasty getattr hooks.  This fixes the failing "boom 2" example Jeremy
posted (a non-printing variant of which is now part of test_gc), via never
triggering the nasty part of its __getattr__ method.
2003-04-06 00:11:39 +00:00
Tim Peters 2f74fddfc1 test_boom: More comments. Also check that len(gc.garbage) doesn't
change (it would be another kind of bug if the trash cycle weren't
reclaimed).
2003-04-05 17:46:04 +00:00
Raymond Hettinger c377cbfdaf SF bug #715145: unittest.py still uses != in failUnlessEqual 2003-04-04 22:56:42 +00:00
Jeremy Hylton dee38ac7dd Add Tim's gc boom test to the test suite. 2003-04-04 20:00:04 +00:00
Martin v. Löwis 7fb697b5d2 Revert Patch #670715: iconv support. 2003-04-03 04:49:12 +00:00
Walter Dörwald 44f527fea4 Change formatchar(), so that u"%c" % 0xffffffff now raises
an OverflowError instead of a TypeError to be consistent
with "%c" % 256. See SF patch #710127.
2003-04-02 16:37:24 +00:00
Barry Warsaw 7ba256f039 Fix a comment 2003-04-02 04:51:33 +00:00
Jack Jansen 9dd78101d7 Sigh... The get() and set() commands are not declared in the aete for
the Standard_Suite, but various other suites do expect it (the Finder
implements get() without declaring it itself). It is probably another
case of OSA magic. Adding them to the global base class.
2003-04-01 22:27:18 +00:00
Jack Jansen 842273bcd7 Regenerated with property names with _Prop_ prepended. 2003-04-01 22:05:14 +00:00
Jack Jansen bc956056d4 Properties (like enums) are not in the global namespace but only valid
within a certain context. Give them an _Prop_ prefix, so they don't
accidentally obscure an element from another suite (as happened with
the Finder). Comparisons I'm not sure about, so I left them as global
names.

Also got rid of the lists if declarations, they serve no useful purpose.
2003-04-01 22:01:58 +00:00
Jack Jansen 3279cb0315 Turned the suite compiler into an object. 2003-04-01 14:25:49 +00:00
Jack Jansen 18c9b13959 - All messages are now dependent on the --verbose option.
- Added a --dump option that doesn't generate the module but dumps
  the pretty-printed aete resource(s) on stdout.
2003-04-01 13:32:17 +00:00
Walter Dörwald 56fbcb525b Remove duplicate test. 2003-03-31 18:18:41 +00:00
Walter Dörwald 43440a621e Fix PyString_Format() so that '%c' % u'a' returns u'a'
instead of raising a TypeError. (From SF patch #710127)

Add tests to verify this is fixed.

Add various tests for '%c' % int.
2003-03-31 18:07:50 +00:00
Jack Jansen fc71026c8a Subclasses of ObjectSpecifier can now be packed and unpacked. This allows
you to say something like "talker.count(want=Address_Book.people)" in
stead of having to manually create the aetypes.Type(Address_Book.people.want)
OSA type.
2003-03-31 13:32:59 +00:00
Jack Jansen 397e914209 In TalkTo.send(), check that we have access to the window manager,
and initialize the event loop (if not done previously) to work around
a bug (IMHO) in MacOSX 10.2.
2003-03-31 13:29:32 +00:00
Jack Jansen 068a1e208f Regenerated again, now clases are sorted by code, and with synonyms after
the primary name.
2003-03-30 22:41:53 +00:00
Jack Jansen 2dc16f2a1e Classes have to be sorted by code, not name, and synonyms have to
be sorted after the main name, otherwise filling of properties and
elements messes up.

Sorting is always more difficult than expected:-)
2003-03-30 22:39:39 +00:00
Barry Warsaw 1a99cf045d Bump to version 2.5.1 2003-03-30 20:47:48 +00:00
Barry Warsaw 9c505ae3da test_whitespace_eater_unicode_2(): Test case for SF bug #710498. 2003-03-30 20:47:22 +00:00
Barry Warsaw ba1548a736 __unicode__(): Fix the logic for calculating whether to add a
separating space or not between encoded chunks.  Closes SF bug
#710498.
2003-03-30 20:46:47 +00:00
Neal Norwitz 742dde4ddd SF patch #706338, Fix a few broken links in pydoc by Greg Chapman 2003-03-30 20:31:34 +00:00
Martin v. Löwis 12a7f96aec Patch #712124: Remove obsolete comment. 2003-03-30 16:28:26 +00:00
Martin v. Löwis 103d6e7a3c Support '' as the argument for the setlocale emulation. Fixes #678259. 2003-03-30 15:42:13 +00:00
Martin v. Löwis 3163a3b4b2 Patch #545300: Support marked sections. 2003-03-30 14:25:40 +00:00
Skip Montanaro 89feabc7f5 The socket module now always uses the _socketobject wrapper class, even on
platforms which have dup(2).  The makefile() method is built directly on top
of the socket without duplicating the file descriptor, allowing timeouts to
work properly.  Includes a new test case (urllibnet) which requires the
network resource.

Closes bug 707074.
2003-03-30 04:54:24 +00:00
Jack Jansen a942b9931c Moved gensuitemodule from Mac/scripts to Lib/plat-mac. Documentation
remains to be done.
2003-03-29 23:04:01 +00:00
Neal Norwitz 7035c98c5c Move Mac/Windows specific expected skips from each platform list
to the ExpectedSkips class.  Add test_scriptpackages to Mac only list.
Add test_unicode_file to Windows only list.
2003-03-29 22:01:17 +00:00
Martin v. Löwis 043bbc7da3 Patch #707701: Expect '??' in event fields. Fixes #698517.
Will backport to 2.2.
2003-03-29 09:47:21 +00:00
Jack Jansen 694570efcf Regenerated with the new way to get terminology (through AppleEvents),
which sometimes seems to result in different terminology. It does
seem to be mostly compatible, though.
2003-03-29 00:13:17 +00:00
Jack Jansen d6ab153e5a On OSX the finder will return from an open() event before the application
has actually entered its event loop. As a stopgap, allow for a 10 second
grace period.
2003-03-28 23:42:37 +00:00
Jack Jansen d4885f87fa Sigh: didn't catch all lists that needed to be sorted. Regenerated again. 2003-03-28 23:38:00 +00:00
Skip Montanaro 9ddac3e166 make nt altsep forward slash - closes bug 709428
backport candidate
2003-03-28 22:23:24 +00:00
Jack Jansen 7377bec6ae Regenerated (from resource files) with sorting version of gensuitemodule.
This is a first step towards regenerating the modules with newer, MacOSX,
versions of these programs, and using the programmatic interface to
get at the terminology in stead of poking in resource files.
2003-03-28 22:07:22 +00:00
Jack Jansen c2a7f22216 Minimal test suite of the generated packages in plat-mac/lib-scriptpackages.
At the moment does little more than testing that the modules import
correctly and some classes can be instantiated.
2003-03-28 22:01:41 +00:00
Ka-Ping Yee d9e213eeca Hide private names beginning with _ (but don't hide __special__ names).
Clean up section headings; make the bars on the left less fat.
Adjust the display of properties slightly.
Don't show stuff inherited from the base 'object' type.
2003-03-28 16:35:51 +00:00
Ka-Ping Yee b38bbbd387 Make module lookup a little more robust (certain kinds of fiddling to
sys.modules previously produced an exception).
2003-03-28 16:29:50 +00:00
Ka-Ping Yee e9638ccadb Move testing code into "if __name__ == '__main__'" so it's not run on import. 2003-03-28 16:28:48 +00:00
Gregory P. Smith fe11d3e0d4 Adds support for the DBEnv->set_timeout() method. 2003-03-27 17:23:29 +00:00
Martin v. Löwis 3ae0f7a7cf Replace criterium with criterion. Fixes #705120. 2003-03-27 16:59:38 +00:00
Barry Warsaw e159d584d2 Temporary bump of the version number. 2003-03-26 17:58:11 +00:00
Barry Warsaw cd7051f698 typed_subpart_iterator(): Fix these to use non-deprecated APIs,
i.e. get_content_maintype() and get_content_subtype().

Also, add True, False for Python 2.2.x where x < 2 compatibility.
2003-03-26 17:57:25 +00:00
Barry Warsaw 8af56778fd typed_subpart_iterator(): Fix these to use non-deprecated APIs,
i.e. get_content_maintype() and get_content_subtype().
2003-03-26 17:56:21 +00:00
Walter Dörwald 97951de77c Add two tests for simple error cases. 2003-03-26 14:31:25 +00:00
Thomas Wouters 590fe02ebd CommandTests.testgetoutput():
Make sure we aren't masking any errors raised in tempfile.mkdtemp() by
    referencing the (then) unbound local 'dir'.
2003-03-25 18:50:19 +00:00
Jack Jansen 52fbe5330b Allow floating point values in ProgressBar. 2003-03-24 12:12:24 +00:00
Jack Jansen b46bebf518 Regenerated with Donovan Prestons patch #702620. 2003-03-23 22:07:28 +00:00
Kurt B. Kaiser 0529377cdf Correct error in last checkin noticed by Neal Norwitz. And some more. 2003-03-22 20:11:14 +00:00
Kurt B. Kaiser 11c53e2ea7 M PyShell.py
M run.py

1. Move subprocess socket handling to a subthread - "SockThread".
2. In the subprocess, implement a queue and global completion and exit
flags.  Execute code after it is passed through the queue.  (Currently,
user code is executed in SockThread.  The next phase of development will
move the tail of the queue to MainThread.)
3. Implement an RPC message used to shut down the execution server.
4. Improve normal and exception subprocess exits.

(At this checkin a "pass loop" interrupt doesn't work on any platform.  It
will be restored for all platforms once user code execution is moved to
MainThread.)
2003-03-22 19:40:19 +00:00
Kurt B. Kaiser e51529d79a Improve error message handling. 2003-03-22 19:15:58 +00:00
Just van Rossum 5c83bb0f4a use os.path.realpath() instead of os.readlink() 2003-03-21 22:22:19 +00:00
Barry Warsaw 5fe9ead82c Email version 2.5 -- I will now backport this to Python 2.2.3. 2003-03-21 18:57:59 +00:00
Guido van Rossum dd42edcc9d Rename variables _seq to _it and seq to it, to emphasize that this is
an iterator (which can only be used once!).
2003-03-21 14:54:19 +00:00
Jack Jansen bb829b7c02 Getting rid of macfs. 2003-03-21 12:55:38 +00:00
Jack Jansen 3e0196cc00 Adding unicode filename support to FSRefs broke things on MacOS9. "Fixed" by disabling unicode filenames on OS9. 2003-03-21 12:54:24 +00:00
Jack Jansen 7e0bc112b8 Patch 702620 by Donovan Preston: Fix AE inheritance. 2003-03-21 12:04:19 +00:00
Just van Rossum 82ad32ec39 only set $PYTHONHOME when building a standalone app. 2003-03-21 11:32:37 +00:00
Just van Rossum 15624d850b Patch #681927 from Robin Dunn: add option to add shared libraries or
frameworks to the bundle.
2003-03-21 09:26:59 +00:00
Neal Norwitz 7d8145268e Prevent the pty test from hanging by setting an alarm.
Currently, test_pty hangs on AIX & HPUX if run after test_openpty.
2003-03-21 01:39:14 +00:00
Guido van Rossum e3d1df0646 The message "*** skipping leakage tests ***" was causing the test to
fail in a non-debug build.  Only print this in verbose test mode.
2003-03-21 01:15:58 +00:00
Skip Montanaro f823f11c36 forgot Cliff's sniffer 2003-03-20 23:31:24 +00:00
Skip Montanaro b4a0417e91 new CSV file processing module - see PEP 305 2003-03-20 23:29:12 +00:00
Just van Rossum a87e44792c set $PYTHONHOME in the bootstrap script, for no good reason really,
except to avoid getpath.c giving unsollicited advice on stderr.
2003-03-20 21:37:05 +00:00
Tim Peters d50ade68ec SF bug 705836: struct.pack of floats in non-native endian order
pack_float, pack_double, save_float:  All the routines for creating
IEEE-format packed representations of floats and doubles simply ignored
that rounding can (in rare cases) propagate out of a long string of
1 bits.  At worst, the end-off carry can (by mistake) interfere with
the exponent value, and then unpacking yields a result wrong by a factor
of 2.  In less severe cases, it can end up losing more low-order bits
than intended, or fail to catch overflow *caused* by rounding.

Bugfix candidate, but I already backported this to 2.2.

In 2.3, this code remains in severe need of refactoring.
2003-03-20 18:32:13 +00:00
Neal Norwitz 26f42f6821 Skip the ioctl test if we can't open /dev/tty. This happens on
Solaris (and probably other Unixes) when run without a terminal
(eg, from cron or at).
2003-03-20 04:33:16 +00:00
Neal Norwitz 6e54f579a6 Fix SF bug #697556, test_posix fails: getlogin
getlogin() can fail for too many reasons, so remove the test
2003-03-18 13:30:14 +00:00
Barry Warsaw 6613fb8412 _encode_chunks(): Throw out empty chunks. 2003-03-17 20:36:20 +00:00
Barry Warsaw 240754933e test_long_lines_with_different_header(): Another test from Jason. 2003-03-17 20:35:14 +00:00
Barry Warsaw ab75840cd0 test_getaddresses_nasty(): A test for mimelib SF bug # 697641. 2003-03-17 18:36:37 +00:00
Barry Warsaw fa348c876f getaddrlist(): Make sure this consumes all the data, and if there is
no address there (perhaps because of invalid characters, it appends
('', '') to the result set.

Closes mimelib SF bug # 697641.
2003-03-17 18:35:42 +00:00
Martin v. Löwis c2ca32d9ae Test for UnicodeError instead of ImportError to determine whether
the test file name can be encoded.
2003-03-17 18:30:15 +00:00
Thomas Wouters 9e1c192525 binascii_a2b_base64: Properly return an empty string if the input was all
invalid, rather than returning a string of random garbage of the
    estimated result length. Closes SF patch #703471 by Hye-Shik Chang.

Will backport to 2.2-maint (consider it done.)
2003-03-17 11:24:29 +00:00
Jack Jansen 450bd873ac Capturing the exit status for the build process didn't work. Using
popen2.Popen4() makes it work. Fixes #702180.
2003-03-17 10:54:41 +00:00
Guido van Rossum 0070f007f4 Change the default number of repetitions to 3, both in the Timer class
(from 10) and in main() (from 1).

Add a -v option that shows the raw times.  Repeating it cranks up the
display precision.

Always use the "best of N" form of output.
2003-03-15 12:25:00 +00:00
Guido van Rossum d2b738ee7d If time.tzset doesn't exist, don't test it. 2003-03-15 12:01:52 +00:00
Guido van Rossum d11b62edd0 - New function time.tzset() provides access to the C library tzet()
function, if supported.  (SF patch #675422, by Stuart Bishop.)
2003-03-14 21:51:36 +00:00
Guido van Rossum 538f1d842c Implement some recommendations from Raymond H:
- Make all local variables in the template start with an underscore,
  to prevent name conflicts with the timed code.

- Added a method to print a traceback that shows source lines from the
  expanded template.

- Use that method in main().
2003-03-14 17:21:00 +00:00
Fred Drake 0834d77bc4 Accept commas in unquoted attribute values.
This closes SF patch #669683.
2003-03-14 16:21:57 +00:00
Michael W. Hudson 43ed43bfc1 Take out my (long since disabled) POSIX signal mask handling code.
I'm not going to have the time or energy to get this working x-platform
-- anyone who does is welcome to the code!
2003-03-13 13:56:53 +00:00
Kurt B. Kaiser 94afd3095e Move setting of ioready 'wait' earlier in call chain, to
rpc.SocketIO.main() and asyncreturn().  Improve comment.
2003-03-12 20:52:00 +00:00
Jack Jansen b1fbf855a3 Filter out the depracation warning for macfs. 2003-03-12 13:47:39 +00:00
Raymond Hettinger 83245b5828 SF bug #699934: Obscure error message
Clarify error message for mro conflicts.
2003-03-12 04:25:42 +00:00
Barry Warsaw ea8f6fa094 test_whitespace_eater_unicode(): Make this test Python 2.1 compatible. 2003-03-12 03:14:11 +00:00
Barry Warsaw ca53c12c8b Python 2.1 doesn't have True and False 2003-03-12 02:54:17 +00:00
Kurt B. Kaiser 7c22132069 M rpc.py
M run.py
1. Clarify that rpc.SocketIO._getresponse() currently blocks on socket.
2. Improve exception handling in subprocess when GUI terminates abruptly.
2003-03-11 22:55:56 +00:00
Jack Jansen dded84802a Allow unicode pathnames where FSRefs are expected. Fixes 696253. 2003-03-11 21:48:57 +00:00
Guido van Rossum 315aa361fc Add 'audio' resource.
ALERT! A month ago or so I made test_ossaudiodev.py require the
'audio' resource, but I didn't make the necessary changes to
regrtest.py.  This means that *nobody* has been testing the oss module
all that time!
2003-03-11 14:46:48 +00:00