Commit Graph

4827 Commits

Author SHA1 Message Date
Barry Warsaw d1795705de Test that uu.py will not override an existing file if out_file isn't
given and the path is gleaned from the uu header.
2001-08-17 20:00:11 +00:00
Barry Warsaw 59dae8ad36 decode(): Raise a uu.Error if no out_file is given but the file
specified in the uu header already exists.  No additional
    workaround is provided since out_file=pathname is a deprecated
    interface, so it is better to simply pass a file-like object into
    out_file anyway.  This closes SF bug #438083.

Use isinstance() tests instead of type comparisons.
2001-08-17 19:59:34 +00:00
Tim Peters de642bdc5d A self-contained piece of Michael Hudson's patch
#449043 supporting __future__ in simulated shells
in support of PEP 264.

Much has changed from the patch version:
+ Repaired bad hex constant for nested_scopes.
+ Defined symbolic CO_xxx names so global search will find these uses.
+ Made the exported list of feature names explicit, instead of abusing
  __all__ for this purpose (and redefined __all__ accordingly).
+ Added gross .compiler_flag verification to test___future__.py, and
  reworked it a little to make use of the newly exported explicit list
  of feature names.
2001-08-17 19:49:02 +00:00
Guido van Rossum b0a98e9c94 Address SF #451547. The approach is a bit draconian: any object that
is pickled as a global must now exist by the name under which it is
pickled, otherwise the pickling fails.  Previously, such things would
fail on unpickling, or unpickle as the wrong global object.  I'm
hoping that this won't break existing code that is playing tricks with
this.

I need a volunteer to do this for cPickle too.
2001-08-17 18:49:52 +00:00
Martin v. Löwis 339d0f720e Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
2001-08-17 18:39:25 +00:00
Guido van Rossum 70297d3bd4 Change the 227 response parser to use a more liberal regular
expression.  This is needed for certain servers that (in violation of
the standard) don't return the parentheses in the response.

This fixes SF bug #441712 by Henrik Weber (not exactly using his
patch).
2001-08-17 17:24:29 +00:00
Guido van Rossum 84a79a8d25 classic(),metods(): add tests to verify that a bound method without a
class has a correct repr().
2001-08-17 13:58:31 +00:00
Guido van Rossum 93018760bc classic(), methods(): add another test relating to unbound methods:
when an unbound method of class A is stored as a class variable of
class B, and class B is *not* a subclass of class A, that method
should *not* get bound to B instances.
2001-08-17 13:40:47 +00:00
Guido van Rossum 7e1ff69271 Add early binding of methods to the 2nd metaclass example. 2001-08-17 11:55:58 +00:00
Guido van Rossum 309b566704 metaclass(): add tests for metaclasses written in Python: one that
subclasses type, one that doesn't (the latter isn't fully functional
yet).
2001-08-17 11:43:17 +00:00
Barry Warsaw f6365e0107 Added a test for module repr truncation when the package name is
really long.  Closes SF bug #437984.
2001-08-16 20:42:38 +00:00
Guido van Rossum 501c7c7d0e classobject.c:instancemethod_descr_get(): when a bound method is
assigned to a class variable and then accessed via an instance, it
should not be rebound.

test_descr.py:methods(): test for the condition above.
2001-08-16 20:41:56 +00:00
Andrew M. Kuchling db7aed5219 [Patch #441691] preprocess() method for Borland C compiler.
I have no way of testing this.
2001-08-16 20:17:41 +00:00
Tim Peters 4d2dded044 test_descr started breaking in yet another way in the same place. 2001-08-16 19:50:51 +00:00
Fred Drake 3791838339 New unit test for the mimetypes module, to avoid future regressions. 2001-08-16 18:36:59 +00:00
Fred Drake c81a06998f Another egregious error that copied the encodings info over the suffix
info.  Caught by the tests that I'm writing now.
2001-08-16 18:14:38 +00:00
Martin v. Löwis c47016ee74 Use (c)StringIO for collecting bytes. Fixes bug #451622. 2001-08-16 17:06:44 +00:00
Tim Peters 63a8d69476 Repair some accidents causing Windows failures:
+ test_compare.  While None compares less than anything else, it's not
  always the case that None has the smallest id().
+ test_descr.  The output of %p (pointer) formats varies across platforms.
  In particular, on Windows it doesn't produce a leading "0x".
2001-08-16 16:56:16 +00:00
Fred Drake c019ecb7fe Bad bug: the MimeTypes.readfp() was supposed to take a file object as a
parameter, but did not.  This was found because it can create failures
elsewhere based on the presence of mime.types files in some common locations
the module searches by default.

(I will be writing a test for this module shortly!)
2001-08-16 15:54:28 +00:00
Andrew M. Kuchling b1d6029437 [Patch #444854 from twburton]
Add executable extension, needed to get the program name right on Win32
2001-08-16 14:08:02 +00:00
Andrew M. Kuchling 6fb8d3a3d6 [Patch #442530 from twburton]
Provide include_dirs argument to all calls to ._preprocess and ._compile
    Fix typo: pattern.search(pattern) should be pattern.search(line)
2001-08-16 13:56:40 +00:00
Guido van Rossum 297abadc6b The change of type(None).__name__ from 'None' to 'NoneType' broke this
test in a trivial way.  Fixed.
2001-08-16 08:32:39 +00:00
Guido van Rossum a4ff6ab093 Add tests for overridable operators that have default interpretations
(__hash__ etc.), in static and dynamic classes, overridden and
default.
2001-08-15 23:57:59 +00:00
Just van Rossum ba634b2ec3 Rewrote Jack's latest change so it does what it intended to do... 2001-08-15 21:20:42 +00:00
Guido van Rossum 28962cc0ea Given a class without __cmp__ or __eq__, cmp() of two instances of
that class should compare the id() of those instances.  Add a test
that verifies this.  This test currently fails; I believe this is
caused by object.c:2.132 (Patch #424475 by loewis).
2001-08-15 21:02:20 +00:00
Guido van Rossum b5a136b05d Add a test to verify that bound methods work correctly. 2001-08-15 17:51:17 +00:00
Jack Jansen 31b5323c84 Don't remove non-directories from sys.path on the mac: files
can be on sys.path too.
2001-08-15 12:07:46 +00:00
Tim Peters e5614630fb Move one of the tests into the "PEP 255" section, to reflect a change in
the PEP.
2001-08-15 04:41:19 +00:00
Jeremy Hylton 9272b14d62 Fix typo in astgen script 2001-08-14 21:18:30 +00:00
Guido van Rossum 80e36750c8 Add a test for a weird bug I just discovered: a dynamic subclass
doesn't have a __dict__!
2001-08-14 20:00:33 +00:00
Jeremy Hylton 7713ac2ff1 Regenerated from new ast.txt and new astgen.py 2001-08-14 18:59:01 +00:00
Barry Warsaw 033daa49ea Test the new semantics for setting and deleting a function's __dict__
attribute.  Deleting it, or setting it to a non-dictionary result in a
TypeError.  Note that getting it the first time magically initializes
it to an empty dict so that func.__dict__ will always appear to be a
dictionary (never None).

Closes SF bug #446645.
2001-08-14 18:28:28 +00:00
Barry Warsaw b9c1d3dedf reload(exceptions) should not raise an ImportError, but should act
just like reload(sys).  Test that this is so.  Closes SF bug #422004.
2001-08-13 23:07:00 +00:00
Tim Peters 04601063e8 Repair Unix-specific assumptions that caused this to fail on Windows. 2001-08-13 22:25:24 +00:00
Barry Warsaw 406d46e185 found_terminator(): Add a debug print showing the data. 2001-08-13 21:18:01 +00:00
Fred Drake 3a28ca8fb8 Nick Mathewson: test suite for the class browser support module. 2001-08-13 20:26:19 +00:00
Fred Drake 03f7a70345 Nick Mathewson: Make sure the recursion is handled properly.
This is part of SF patch #440292.
2001-08-13 20:20:51 +00:00
Guido van Rossum 97dbec97bc Remove redundant import (PyChecker).
Update greeting message to avoid the long copyright notice.
2001-08-13 15:58:26 +00:00
Guido van Rossum 4a5555b19d Remove unused variable 'imports' from readmodule_ex(). 2001-08-13 15:55:19 +00:00
Guido van Rossum 8f15bd8500 Remove redundant 'import string' (PyChecker). 2001-08-13 15:48:06 +00:00
Guido van Rossum ef8f4dee07 Remove redundant imports (PyChecker). 2001-08-13 15:37:02 +00:00
Guido van Rossum a79bbaca54 Remove redundant 'import sys' (PyChecker). 2001-08-13 15:34:41 +00:00
Guido van Rossum f9f48812d0 Remove two redundant statements (PyChecker). 2001-08-13 15:30:22 +00:00
Guido van Rossum bfbc18dbf9 Remove redundant assignment l = [] from poll3() -- copy-and-paste
error.
2001-08-13 15:21:55 +00:00
Guido van Rossum 8710681400 Commenting out the getfillable() method -- it's broken, and nobody
remembers what it is supposed to do. :-(
2001-08-13 15:04:33 +00:00
Andrew M. Kuchling 7c2cf73811 Remove redefinition of has_option() method 2001-08-13 14:58:32 +00:00
Andrew M. Kuchling 8ea9227b1b Remove empty __init__ (PyChecker) 2001-08-13 14:55:17 +00:00
Andrew M. Kuchling f31d31373e Remove redefinition of writelines() method
Remove unused variable and import
2001-08-13 14:54:12 +00:00
Andrew M. Kuchling 77f9caf633 Remove unused variable (PyChecker) 2001-08-13 14:52:37 +00:00
Andrew M. Kuchling 1f877ef199 Remove some dead code (PyChecker) 2001-08-13 14:50:44 +00:00