Commit Graph

5549 Commits

Author SHA1 Message Date
Steve Purcell ca9aaf36e1 Synch with pyunit CVS:
- Adds Fred's patch 487662: "Better error message for assertEqual"
 - Removed small portion of code unused after Guido's patch
   490119: "Don't treat ^C as error"
2001-12-17 10:13:17 +00:00
Tim Peters 1422e9dc60 SF patch 493739 2 Bugfixes for 2.2c1 (RISC OS specific), from
Dietmar Schwertberger.
Bugfix candidate.
"""
RISCOS/Modules/getpath_riscos.c:
Include trailing '\0' when using strncpy [copy
strlen(...)+1 characters].

Lib/plat-riscos/riscospath.py:
Use riscosmodule.expand for os.path.abspath.
[fixes problems with site.py where
abspath("<Python$Dir>") returned
join(os.getcwd(), "<Python$Dir>") as e.g.
"SCSI::SCSI4.$.<Python$Dir>" because "<Python$Dir>"
wasn't recognised as an absolute path.]
"""
2001-12-15 22:12:47 +00:00
Guido van Rossum 796e1e0b30 Don't call resetwarnings(). Be more restrictive in what we filter out
instead.
2001-12-15 18:04:10 +00:00
Jack Jansen f839c27027 Added test_socketserver and test_unicode_file to tests expected to be
skipped on Mac OS X. Not sure yet about test_locale.py: this may be
due to my copy of Mac OS X (although it talks english fine enough).
2001-12-14 21:28:53 +00:00
Barry Warsaw 7675097d78 send(), ehlo(): Integrate patch #487310 by Fazal Majid. Consistently
call self.close() just before raising SMTPServerDisconnected.  This
allows you to, e.g. reconnect after a server timeout.

Merged from the 2.2c1 branch.
2001-12-14 20:34:20 +00:00
Jeremy Hylton 2a05bc72d6 Partial fix for problem in SF buf #487458
Rev 1.20 introduced a call to getpeername() in the dispatcher
constructor.  This only works for a connected socket.  Apparently
earlier versions of the code worked with un-connected sockets, e.g. a
listening socket.

It's not clear that the code is supposed to accept these sockets,
because it sets self.connected = 1 when passed a socket.  But it's
also not clear that it should be a fatal error to pass a listening
socket.

The solution, for now, is to put a try/except around the getpeername()
call and continue if it fails.  The self.addr attribute is used
primarily (only?) to produce a nice repr for the object, so it hardly
matters.  If there is a real error on a connected socket, it's likely
that subsequent calls will fail too.
2001-12-14 16:15:11 +00:00
Guido van Rossum e54616cb6f (Merge into trunk.)
Fix for SF bug #492345.  (I could've sworn I checked this in, but
apparently I didn't!)

This code:

    class Classic:
        pass

    class New(Classic):
        __metaclass__ = type

attempts to create a new-style class with only classic bases -- but it
doesn't work right.  Attempts to fix it so it works caused problems
elsewhere, so I'm now raising a TypeError in this case.
2001-12-14 04:19:56 +00:00
Jeremy Hylton f36cfef1ae Undo inadvertent change to test_scope in previous checkin 2001-12-13 20:00:26 +00:00
Fred Drake 68773e779a Add a comment explaining what these tests are for, and where to look for
tests of complex().
2001-12-13 19:57:53 +00:00
Fred Drake 526c7a0101 Ensure that complex() only accepts a string argument as the first arg,
and only if there is no second arg.
This closes SF patch #479551.
2001-12-13 19:52:22 +00:00
Jeremy Hylton 3095a4c228 Update output generated by test_scope 2001-12-13 19:47:51 +00:00
Jeremy Hylton ccae8377a3 Add test for SF bug [ #492403 ] exec() segfaults on closure's func_code 2001-12-13 19:45:04 +00:00
Fred Drake 723293cb49 Make tix_configure() work the same way configure() works for the basic
Tkinter classes.
Adjust a lot of docstrings.
Convert a few type checks to use isinstance() instead of type().
This is part of SF patch #485959.
2001-12-13 04:53:07 +00:00
Guido van Rossum 1990943095 Fix for SF #491953 (Andrew Dalke): ScrolledText.py has TabError
Untabified.
2001-12-12 12:47:57 +00:00
Fred Drake 1e7dfd3745 Wrapped a long line.
Converted to use "".startswith() to avoid slicing (& temp string creation).
2001-12-12 06:20:34 +00:00
Fred Drake d077ca1e7c Very small test suite for the calendar module, mostly to check a constraint
on the return values from isleap().  Also checks firstweekday() and
setfirstweekday().
2001-12-12 05:38:08 +00:00
Marc-André Lemburg 90294d01be Joe VanAndel wrote:
>
> When using 'distutils' (shipped with Python 2.1) I've found that my
> Python scripts installed with a first line of:
>
> #!/usr/bin/python2.1None
>
> This is caused by distutils trying to patch the first line of the python
> script to use the current interpreter.
2001-12-11 20:44:42 +00:00
Tim Peters 017052152b Fiddle test_class so it passes with -Qnew. 2001-12-11 19:28:47 +00:00
Tim Peters e93e477215 Fiddle test_augassign so it passes under -Qnew. 2001-12-11 19:20:15 +00:00
Martin v. Löwis df8adcd7ba Ignore SIGXFSZ. Fixes #490453. 2001-12-11 17:57:26 +00:00
Fred Drake d15db5c711 When using GCC, use the right option to add a directory to the list of dirs
searched for a dependency for runtime linking.
This closes SF bug #445902.
2001-12-11 05:04:24 +00:00
Guido van Rossum 29d260670e Additional coverage tests by Neil Norwitz.
(SF patch #491418, #491420, #491421.)
2001-12-11 04:37:34 +00:00
Fred Drake 2a64f4693d Regression test for SF bug #478534 -- exceptions could "leak" into a weakref
callback.
2001-12-10 23:46:02 +00:00
Finn Bock 2b29cb2593 Skipping some tests by adding the usual jython conditional test around:
- the repr of unicode. Jython only add the u'' if the string contains char
  values > 255.
- A unicode arg to unicode() is perfectly valid in jython.
- A test buffer() test. No buffer() on Jython

This closes patch "[ #490920 ] Jython and test_unicode".
2001-12-10 20:57:34 +00:00
Guido van Rossum 61d3637ff8 SF patch #491183 (Jeff Epler): ScrolledText.grid() doesn't work
Using grid methods on ScrolledText widgets does not
work as expected. It either fails to pack a widget, or
can even cause Tk to lock up.

The problem is that the .grid method is being called on
the text widget, not the frame widget. This can lead
to the well-known lockup in Tk when a frame's children
are managed by both the pack and grid managers. Even
if it doesn't lock up, the frame is never placed within
the intended widget.

Program fragment:
>>> import ScrolledText
>>> s = ScrolledText.ScrolledText()
>>> s.grid(row=0, column=0, rowspan=2)

The following patch uses the same hack to copy the
'grid' and 'place' geometry manager methods to the
ScrolledText instance as is already used for the 'pack'
manager.
2001-12-10 16:42:43 +00:00
Michael W. Hudson fb173cd471 Fix for
[ #409430 ] pydoc install broken
2001-12-10 16:15:44 +00:00
Michael W. Hudson 49bdaede1b Fix for
[ #477371 ] build_scripts can use wrong #! line

scripts now get "built" into a directory

build/scripts-$(PYTHON_VERSION)/
2001-12-10 15:28:30 +00:00
Finn Bock 793ead5696 A workaround for the missing buffer() builtin in jython.
This closes patch "[ #490850 ] Jython and test_StringIO".
2001-12-09 20:06:32 +00:00
Fredrik Lundh 82b230732f bug #133283, #477728, #483789, #490573
backed out of broken minimal repeat patch from July

also fixed a couple of minor potential resource leaks in pattern_subx
(Guido had already fixed the big one)
2001-12-09 16:13:15 +00:00
Finn Bock ed69aeedb9 test(): Avoid a UnboundLocalError when a method is missing from both the string
module and from string methods.

This closes patch "[ #490811 ] Jython and test_string".
2001-12-09 16:06:29 +00:00
Finn Bock d08011a0e1 Moved a print statement outside the jython platform test. Otherwise
the output fails to compare correctly for jython. This change was part
of the original patch #403666.
2001-12-09 10:19:25 +00:00
Finn Bock 4ab7adbd94 The initial patch #468662 was not applied quite verbatim. This should one
will fix the remaining Jython issues.

This closes patch "[ #490411 ] Jython and test_grammar.py".
2001-12-09 09:12:34 +00:00
Finn Bock ada1983950 Refcounting isn't available in Jython. Putting the jython test around it.
This closes patch "[ #490414 ] Jython and test_socket".
2001-12-09 08:57:46 +00:00
Guido van Rossum 146483964e Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
2001-12-08 18:02:58 +00:00
Guido van Rossum b931bf3c55 SF patch #490515 (Joe A) urllib.open_https() protocol issue
open_http():
    In urllib.py library module, URLopener.open_https()
    returns a class instance of addinfourl() with its
    self.url property missing the protocol.

    Instead of "https://www.someurl.com", it becomes
    "://www.someurl.com".
2001-12-08 17:09:07 +00:00
Finn Bock aa3dc45658 Enable support for jython:
1. Acknowledge the welknown difference that jython
allows continue in the finally clause.

2. Avoid using _testcapi when running with jython.

This closes patch "[ #490417 ] Jython and test_exceptions"
2001-12-08 10:15:48 +00:00
Guido van Rossum baefcebb55 Remove erroneous and confusing comment -- sre patterns *can* be
pickled and we do *not* expect exceptions from either pickle or
cPickle.
2001-12-08 05:11:15 +00:00
Fred Drake 2c8373bc23 Honor the mode argument to dumbdbm.open(); there is not good reason not to,
especially since the documentation described it in detail.
This partially closes SF bug #490098.
2001-12-07 21:54:46 +00:00
Tim Peters cbfc0343fc SF patch 490393: test___all__ and Jython; from Finn Bock.
Don't even try to import _socket when running under Jython.
2001-12-07 21:35:42 +00:00
Guido van Rossum 78f0dd3397 I found that when run as a script, this test suite ran its tests
twice!  Fixed this by avoiding the import of test_email, which loads
the module a second time in that situation, and fiddled the __main__
section to resemble other test suites using unittest.
2001-12-07 21:07:08 +00:00
Finn Bock 71be984b80 Align the number of %s with the number of format arguments.
This closes patch "[ #490330 ] String format bug in test_b2."
2001-12-07 18:21:56 +00:00
Guido van Rossum a35e2cee32 Move import dbhash out of test_sundry and into test_bsddb,
so that test_sundry won't fail if the bsddb module is absent.
2001-12-07 16:43:19 +00:00
Guido van Rossum 202dd1ef42 In unconditional except clauses, don't catch KeyboardInterrupt -- it's
annoying that often you have to hit ^C numerous times before it
works.  The solution: before the "except:" clause, insert "except
KeyboardInterrupt: raise".  This propagates KeyboardInterrupt out,
stopping the test in its tracks.
2001-12-07 03:39:34 +00:00
Fred Drake 9028d0a525 Visious hackery to solve a build-control problem related to our use of
distutils for the library modules built as shared objects.  A better solution
appears possible, but with the threat that the distutils becomes more
magical ("complex").
This closes SF bug #458343.
2001-12-06 22:59:54 +00:00
Andrew M. Kuchling 3ecc1ce529 [Bug #475009] Tighten the pattern for the first line, so we don't
adjust it when a versioned interpreter is supplied (#!.../python2 ...)
2001-12-06 21:29:28 +00:00
Fred Drake 21d45356b8 Whitespace normalization. 2001-12-06 21:01:19 +00:00
Fred Drake b94b849d65 Whitespace normalization. 2001-12-06 20:51:35 +00:00
Thomas Heller bcd8975740 Use a version number of 0.0.0 instead of ???. The latter leads to
invalid filenames on Windows when building without specifying a
version number in the setup script.

See also
http://mail.python.org/pipermail/distutils-sig/2001-November/002656.html

Bugfix candidate.
2001-12-06 20:44:19 +00:00
Fred Drake 2998a55f2d Attribute nodes did not always get their ownerDocument and ownerElement
properly set.  This fixes that.
2001-12-06 18:27:48 +00:00
Fred Drake 6b04ffe9e5 Be more careful about accessing attributes of the parent: if Tk has not been
initialized, this will be None, but the functions will still work (there will
simply be a bogus parent on the screen).  Allowing the parent to be None
is useful when testing the functions from an interactive interpreter.

Add an optional keyword paramter "show" to the _QueryString class; when given
it is used to set the -show option to the entry widget.  This allows passing
show="*" or the like to askstring(), making it useful for requesting
passwords/passphrases from the user.
This closes SF bug #438517.

Changed a docstring to be less font-lock-hostile.
2001-12-06 16:51:41 +00:00