Commit Graph

9179 Commits

Author SHA1 Message Date
Raymond Hettinger 5aa478badf Module and tests:
* Map conditions to related signals.
* Make contexts unhashable.
* Eliminate used "default" attribute in exception definitions.
* Eliminate the _filterfunc in favor of a straight list.

Docs:
* Eliminate documented references to conditions that are not signals.
* Eliminate parenthetical notes such as "1/0 --> Inf" which are no
  longer true with the new defaults.
2004-07-09 10:02:53 +00:00
Raymond Hettinger eae05de91b * fix the print test
* add more __init__ tests
2004-07-09 04:51:24 +00:00
Raymond Hettinger a435c53e13 * balance the left/right search for getitem.
* use assertions instead of tests after internal calls that can't fail.
* expand test coverage
2004-07-09 04:10:20 +00:00
Walter Dörwald 302fa6dc0d Add another bunch of test cases for calendars with Sunday as the
first day of the week.
2004-07-08 17:14:17 +00:00
Vinay Sajip 3970c11157 Add exception handling for BaseRotatingFileHandler (SF #979252) 2004-07-08 10:24:04 +00:00
Vinay Sajip 4bbab2bde4 FileHandler now stores the basename as an absolute path (fix for SF #982049) 2004-07-08 10:22:35 +00:00
Anthony Baxter 3210b36a28 release dates 2004-07-08 05:59:43 +00:00
Tim Peters 27f883687b Whitespace normalization. 2004-07-08 04:22:35 +00:00
Neal Norwitz 1c0423a2da Exercise xrange a bit 2004-07-08 01:59:55 +00:00
Neal Norwitz d7be118626 Exercise some error conditions 2004-07-08 01:56:46 +00:00
Neal Norwitz bdcb9410c2 SF bug #978308, Spurious errors taking bool of dead pro
Need to return -1 on error.

Needs backport.
2004-07-08 01:22:31 +00:00
Raymond Hettinger bd7f76dd04 Tim gets his default traps. 2004-07-08 00:49:18 +00:00
Tim Peters 4e0e1b6a54 Whitespace normalization. 2004-07-07 20:54:48 +00:00
Andrew M. Kuchling 1263bd8b6c [Bug #925107] Make .readline() consider self.stop. This makes read() and readline() very similar, so they're refactored into _read. Patch by Johannes Gijsbers.
2.3 bugfix candidate.
2004-07-07 14:09:21 +00:00
Andrew M. Kuchling 6fe93cdeb3 For readable() objects, the previous value of 'flags' was ignored.
Rearrange code for writable() case to make the parallel logic clearer
2004-07-07 12:23:53 +00:00
Skip Montanaro d916142343 whitespace normalization 2004-07-06 21:53:27 +00:00
Thomas Heller a146feaa10 Fix SF#983164.
Patch from Mark Hammond:

bdist_wininst attempts to use the correct MSVC runtime for the current
version of Python. This doesn't work correctly when --target-version
is set. In that case, bdist_wininst still uses the *current*
sys.version (ie, 2.4) rather than the version specified as
--target-version. Thus, the msvc7 runtime based executable stub is
*always* used.

This patch "hard-codes" knowledge of earlier Python versions,
providing the correct result when Python 2.4 is used to build Python
2.3 and earlier distributions.

Remove the short variant (-v) of the --target-version command line
options, it conflicts with the --verbose/-v standard distutils switch.
2004-07-06 19:23:27 +00:00
Barry Warsaw 7ff7d2cb0b testGetServBy(): Use services that should be available both on *nix and
Windows (XP at least ;).  Test in this order: echo, daytime, domain.
2004-07-06 16:48:25 +00:00
Raymond Hettinger 513ffe8112 * Fix missing return after error message is set.
* Add a test case that would have caught it.
2004-07-06 13:44:41 +00:00
Raymond Hettinger 0aeac107ca * Add __eq__ and __ne__ so that things like list.index() work properly
for lists of mixed types.
* Test that sort works.
2004-07-05 22:53:03 +00:00
Raymond Hettinger 5548be2653 Test the logic for int(d). 2004-07-05 18:49:38 +00:00
Raymond Hettinger ca3cc2fe21 * Update the todo list.
* Make ConversionSyntax signals get trapped by default.
2004-07-05 18:48:22 +00:00
Raymond Hettinger e0f1581bab * Fixup docstrings
* Make capitals default part of DefaultContext
2004-07-05 05:36:39 +00:00
Raymond Hettinger 0ea241e9e2 Changed the rounding constant values to match their variable names.
This serves to made the context representation more useful (the names in
match the names out).

Removed the link to ReXX.  That document did not shed add anything to
information already in the spec.

Further tighten the public API to improve usability:

* Emax and Emin are set through Context().  Their defaults are set in the
  DefaultContext, so there is no need to expose DEFAULT_MAX_EXPONENT
  and DEFAULT_MIN_EXPONENT.

* The string functions isnan() and isinfinity() were only used internal to
  the module and were not among the test cases.  External use cases are
  served by the Decimal constructor.  So, made these private.
2004-07-04 13:53:24 +00:00
Raymond Hettinger b1b605ef54 Fix clear_flags(). Make a readable (not evalable) Context repr. 2004-07-04 01:55:39 +00:00
Kurt B. Kaiser 49a5fe107f Redirect the warning stream to the shell during the ScriptBinding check of user code
and format the warning similarly to an exception for both that check and for
warnings raised in the subprocess.

M NEWS.txt
M Pyshell.py
M ScriptBinding.py
M run.py
2004-07-04 01:25:56 +00:00
Raymond Hettinger 9ec3e3b6eb Namespace cleanups:
* delete temporary globals immediately after use
* move a global into a class variable
* Rename BasicDefaultContext and ExtendedDefaultContext
  to BasicContext and ExtendedContext.
2004-07-03 13:48:56 +00:00
Raymond Hettinger 6ea4845822 * Make the tests independent of the default precision.
* Change the default precision to 28 (to match VB's decimal type).
2004-07-03 12:26:21 +00:00
Vinay Sajip 17c52d8493 Refactored RotatingFileHandler to create a base class for rotating handlers. Added TimedRotatingFileHandler. 2004-07-03 11:48:34 +00:00
Vinay Sajip 779e0c9334 Changed basicConfig() to add keyword arguments. Changes are backward-compatible.
Added error checking to log() to check that level is an integer, and raise a TypeError if not (as long as raiseExceptions is set).
Minor documentation corrections.
2004-07-03 11:47:26 +00:00
Raymond Hettinger d9c0a7ae94 Work through several open todos:
* Added test for pickling contexts
* Renamed ExceptionList to Signals (to match wording in the spec)
* Simplified Context constructor by allowing flags=None to automatically
  generate a zeroed-out flags dictionary.
* inlined _convertString() which was used only once
* _rounding_decision is private, so excluded its contants from __all__.
* added an XXX comment with concerns about subclassing signals results in
  a deviation from the spec (maybe important, maybe not).
* Taught the test_suite to determine its own directory (modeled after code
  in regrtest.py).  Enables it to be run when the current directory is not
  the test directory.
* Added a clear_flags() method to the Context API to make it easier to do
  a common operation with flags.
* Fixed the trap_enablers defaults in BasicDefaultContext to match the spec.
2004-07-03 10:02:28 +00:00
Brett Cannon cc4e935ea5 threading.Thread objects will now print a traceback for an exception raised
during interpreter shutdown instead of masking it with another traceback about
accessing a NoneType when trying to print the exception out in the first place.

Closes bug #754449 (using patch #954922).
2004-07-03 03:52:35 +00:00
Walter Dörwald 59ad45689b Add tests that check the result of calendar.monthcalendar() for a set
of corner cases.
2004-07-02 19:00:09 +00:00
Fred Drake 0a4dd390bf Make weak references subclassable:
- weakref.ref and weakref.ReferenceType will become aliases for each
  other

- weakref.ref will be a modern, new-style class with proper __new__
  and __init__ methods

- weakref.WeakValueDictionary will have a lighter memory footprint,
  using a new weakref.ref subclass to associate the key with the
  value, allowing us to have only a single object of overhead for each
  dictionary entry (currently, there are 3 objects of overhead per
  entry: a weakref to the value, a weakref to the dictionary, and a
  function object used as a weakref callback; the weakref to the
  dictionary could be avoided without this change)

- a new macro, PyWeakref_CheckRefExact(), will be added

- PyWeakref_CheckRef() will check for subclasses of weakref.ref

This closes SF patch #983019.
2004-07-02 18:57:45 +00:00
Thomas Heller 32b8f8052a Fix for SF 982215: bdist_wininst - Next button not greyed out during file copy.
Patch from Mark Hammond.
Recompiled binary.

Already packported to the 2.3 branch.
2004-07-02 08:02:40 +00:00
Raymond Hettinger 214b1c3aae SF Bug #215126: Over restricted type checking on eval() function
The builtin eval() function now accepts any mapping for the locals argument.
Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing
down the normal case.  My timings so no measurable impact.
2004-07-02 06:41:07 +00:00
Fred Drake 83a6430717 Committing Tim's patch for SF bug #983585:
test_repr() fails with id() values that appear negative
2004-07-01 20:28:47 +00:00
Michael W. Hudson d7cc1bd809 Fix
[ 924301 ] A leak case with cmd.py & readline & exception

by ensuring that the readline completion function is always reset
even in the case of an exception being raised.  As a bonus, this
makes the documentation for pre & postloop accurate again.
2004-07-01 14:52:10 +00:00
Fred Drake 1f34eb17b5 fix small consistency nit 2004-07-01 14:28:36 +00:00
Raymond Hettinger 75cc1cb7e0 Move Decimal from the sandbox into production. 2004-07-01 11:15:39 +00:00
Raymond Hettinger 7c85fa4a52 Move Decimal from the sandbox into production. 2004-07-01 11:01:35 +00:00
Michael W. Hudson d5cf143482 Check in the updated version of patch #957240, which doesn't rely
on the marshalling characteristics of infinities.
2004-06-30 09:02:33 +00:00
Andrew M. Kuchling 08c08bb3d1 [Bug #912845] urllib2 only checks for a 200 return code, but 206 is also legal if a Range: header was supplied.
(Actually, should the first 'if' statement be modified to allow any 2xx status code?)
2004-06-29 13:19:19 +00:00
Andrew M. Kuchling 31352c5a30 Remove unused import. (If it's there for some deep, dark reason, it should have been commented.) 2004-06-29 13:17:29 +00:00
Andrew M. Kuchling bd3200fa2b Add test case for bug #912845: requesting an HTTP byte range doesn't work 2004-06-29 13:15:46 +00:00
Andrew M. Kuchling f1a2f9ec41 Docstring grammar fix 2004-06-29 13:07:53 +00:00
Brett Cannon fbac294d59 rsync is now a recognized protocol that uses "netloc" (i.e. specifies a network
location) in its addressing.

Closes bug #981299.
2004-06-29 04:02:40 +00:00
Raymond Hettinger 3b04ce824d Patch from Mark Hammond to fix a test error.
Now runs without exception on WinME/98.
2004-06-28 06:57:19 +00:00
Gregory P. Smith 19699a9351 Adds support for DB.pget and DBCursor.pget methods.
Based on a patch supplied by Ian Ward <ian@arevco.ca> on the pybsddb
mailing list 2004-03-26.
2004-06-28 04:06:49 +00:00
Barry Warsaw 11b91a0ea3 Added socket.getservbyport(), and make its second argument and that of
getservbyname() optional.  Update the tests and the docs.
2004-06-28 00:50:43 +00:00