Commit Graph

31106 Commits

Author SHA1 Message Date
Martin v. Löwis 729d47db09 Patch #1024670: Support int objects in PyLong_AsUnsignedLong[Mask]. 2004-09-20 06:17:46 +00:00
Martin v. Löwis f13337dd38 Fix lib-tk PythonPath. 2004-09-19 18:36:45 +00:00
Edward Loper 052d0cd291 - Added "testfile" function, a simple function for running & verifying
all examples in a given text file. (analagous to "testmod")
- Minor docstring fixes.
- Added module_relative parameter to DocTestFile/DocTestSuite, which
  controls whether paths are module-relative & os-independent, or
  os-specific.
2004-09-19 17:19:33 +00:00
Raymond Hettinger 1be1a79ff9 SF bug #1030557: PyMapping_Check crashes when argument is NULL
Make PySequence_Check() and PyMapping_Check() handle NULL inputs.  This
goes beyond what most of the other checks do, but it is nice defensive
programming and solves the OP's problem.
2004-09-19 06:00:15 +00:00
Brett Cannon 8b4e886ed9 When this file is sourced in, or used as, one's vimrc file it will set the proper settings to follow the style guidelines laid out in PEPs 7 & 8 as best it can without forcing extraneous settings.
Suggested settings are commented out and included at the end of the file.

The goal is to have this file prevent as much as possible from deviating from the style guidelines.  It is not meant to collect every cool macro possible for Python.  Any useful settings for features included with Vim can be included and commented out, but anything overly extraneous should be left out.
2004-09-19 05:43:13 +00:00
Raymond Hettinger 636a6b100f SF patch #1020845: Decimal performance enhancements
(Contributed by Nick Coghlan.)

Various code cleanups and optimizations (saves about 40% on testsuite
execution time and on the telco benchmark).

* caches results of various operations on self (esp. checks for being
  a special value).

* _WorkRep now uses ints and longs for intermediate computations.
2004-09-19 01:54:09 +00:00
Edward Loper 6cc1350807 - Updated example output to match actual output
- Minor wording changes
- Changed the docs to reflect the fact that multiple option directives
  can be specified on a single line (and updated the directive
  production list, as well).
2004-09-19 01:16:44 +00:00
Barry Warsaw 33db656dbf Update Template/PEP 292 documentation to current implementation. 2004-09-18 21:13:43 +00:00
Edward Loper 0273f5b6b2 In DocFileTest:
- Fixed bug in handling of absolute paths.
  - If run from an interactive session, make paths relative to the
    directory containing sys.argv[0] (since __main__ doesn't have
    a __file__ attribute).
2004-09-18 20:27:04 +00:00
Martin v. Löwis c9f53b4905 Link with ws2_32 instead of wsock32. 2004-09-18 16:16:34 +00:00
Martin v. Löwis 725f8c83a2 Patch #1021596: Check for None to determine whether _urandomfd is
uninitialized.
2004-09-18 16:07:58 +00:00
Martin v. Löwis b0c670ce39 Convert boolean results back to strings. Fixes #807871.
Will backport to 2.3.
2004-09-18 16:01:23 +00:00
Martin v. Löwis 5d52e781d9 Make curses.h inclusion conditional as in the original patch #1012280.
Backported to 2.3.
2004-09-18 10:07:03 +00:00
Martin v. Löwis ae2830c55c Patch #1012280: Include curses.h for term.h check. Fixes #933795.
Will backport to 2.3.
2004-09-18 09:54:52 +00:00
Martin v. Löwis f3c5611fef Patch #1029061: Always extract member names from the tarinfo. 2004-09-18 09:08:52 +00:00
Martin v. Löwis 39a317890f Patch #1025790: Add status code constants to httplib. 2004-09-18 09:03:49 +00:00
Barry Warsaw 17cb60083c At the cost of a modest (but useful in its own right) change in the semantics
of the Template.delimiter attribute, we make use of the delimiter in the
escaped group, and in the safe_substitute() method more robust.

Now, .delimiter should be the unescaped delimiter literal, e.g. '$' or '&', or
whatever.  The _TemplateMetaclass will re.escape() this value when it builds
the pattern.
2004-09-18 00:06:34 +00:00
Fred Drake 2e6fb4634c remove gzipped archives from the list of expected distributions 2004-09-17 20:23:47 +00:00
Sean Reifschneider 6011a3c874 SF Patch 1022011: Add a command-line argument --no-autoreq, which sets the
"AutoReq: 0" to disable automatic dependency searching.
2004-09-17 08:34:12 +00:00
Sean Reifschneider 57a6a41e54 SF Patch 1022003: Change bdist_rpm _topdir to use
os.path.abspath(self.rpm_base) instead of os.getcwd() + '/' + self.rpm_base
2004-09-17 08:23:22 +00:00
Raymond Hettinger cfc3192677 SF bug #1014215: Unspecific errors with metaclass
High level error message was stomping useful detailed messages from lower
level routines.

The new approach is to augment string error messages returned by the low
level routines.  The provides both high and low level information.  If
the exception value is not a string, no changes are made.

To see the improved messages in action, type:
   import random
   class R(random): pass
   class B(bool): pass
2004-09-16 16:41:57 +00:00
Skip Montanaro 6543b45b0c Initialize sep and seplen to suppress warning from gcc. 2004-09-16 03:28:13 +00:00
Tim Peters 528ca53b74 SF bug #1028306: date-datetime comparison
Treat comparing a date to a datetime like a mixed-type comparison.
2004-09-16 01:30:50 +00:00
Tim Peters c74298a72b Whitespace normalization. 2004-09-16 00:09:19 +00:00
Brett Cannon 0a1af4aeb0 Remove tabs. 2004-09-15 23:26:23 +00:00
Thomas Heller ca0d2cb66e Add a missing line continuation character. 2004-09-15 11:41:32 +00:00
Martin v. Löwis 9996828caa Patch #1026986: Add OpenBSD 3.5 and 3.6 to list of broken systems. 2004-09-15 06:02:54 +00:00
Martin v. Löwis 74a249e1a9 Strip square brackets from IPv6 address. 2004-09-14 21:45:36 +00:00
Skip Montanaro 82d0eecf42 mention httplib ipv6 fix 2004-09-14 17:58:31 +00:00
Skip Montanaro cae14d2714 missed the obvious test case and corresponding fix 2004-09-14 17:55:21 +00:00
Michael W. Hudson 1fd00a1b71 Make the word "module" appear in the error string for calling the
module type with silly arguments.  (The exact name can be quibbled
over, if you care).

This was partially inspired by bug #1014215 and so on, but is also
just a good idea.
2004-09-14 17:19:09 +00:00
Michael W. Hudson 1593f502e8 Move a comment back to its rightful location. 2004-09-14 17:09:47 +00:00
Skip Montanaro 10e6e0e61a Search from the end of the host/port combination to find the colon which
separates ip address from the port to accommodate ipv6 addresses.
2004-09-14 16:32:02 +00:00
Walter Dörwald 065a32f550 Make the hint about the None default less ambiguous. 2004-09-14 09:45:10 +00:00
Walter Dörwald 782afc5927 Enhance the docstrings for unicode.split() and string.split()
to make it clear that it is possible to pass None as the
separator argument to get the default "any whitespace" separator.
2004-09-14 09:40:45 +00:00
Martin v. Löwis 266a436fe2 Remove claims that Python source code is ASCII. Fixes #1026038. 2004-09-14 07:52:22 +00:00
Raymond Hettinger 879ddf30d0 Tweak the wording. Improve examples. Make more brief. 2004-09-14 06:32:20 +00:00
Raymond Hettinger 29c6a79b7d Cover string.Template in the tutorial's library tour. 2004-09-14 05:21:42 +00:00
Raymond Hettinger 6d191113a6 Fix small bugs in Template code.
* The parameterization of "delimiter" was incomplete.
* safe_substitute's code for braced delimiters should only be executed
  when braced is not None.
* Invalid pattern group names now raise a ValueError.  Formerly, the
  convert code would fall off the end and improperly return None.

Beefed-up tests.

* Test delimiter override for all paths in substitute and safe_substitute.
* Alter unittest invocation to match other modules (now it itemizes the
  tests as they are run).
2004-09-14 02:34:08 +00:00
Raymond Hettinger 23f1241dc6 SF #1027105: HardwareRandom should be renamed OSRandom
Renamed the new generator at Trevor's recommendation.
The name HardwareRandom suggested a bit more than it
delivered (no radioactive decay detectors or such).
2004-09-13 22:23:21 +00:00
Barry Warsaw 3e773fb622 The 4th group is now 'invalid' instead of 'bogus'. 2004-09-13 20:53:27 +00:00
Barry Warsaw b5c6b5bfe8 Raymond's good suggestion to re-order the tests in the convert() helper so the
most common paths are tested first.  Also, that 'invalid' is better than
'bogus'.
2004-09-13 20:52:50 +00:00
Trent Mick 8ea5bdf784 Patch for compilation on IRIX from rwgk on http://python.org/sf/728330 2004-09-13 17:48:41 +00:00
Barry Warsaw b6234a95c1 substitute(), safe_substitute(): Paul Moore provides a better hack for dealing
with positional arguments.
2004-09-13 15:25:15 +00:00
Barry Warsaw c7cd20c8c6 Added a test for # positional arguments > 1. 2004-09-13 15:24:43 +00:00
Andrew M. Kuchling 7642f7af0d Credit patch from Raymond 2004-09-13 15:06:50 +00:00
Tim Peters 8278860e52 Document testmod's new exclude_empty argument. 2004-09-13 15:03:17 +00:00
Tim Peters 958cc89037 exclude_empty: make the default True for DocTestFinder, and introduce it
with default False for testmod().  The real point of introducing this was
so that output from doctest.master.summarize() would be the same as in
2.3, and doctest.master in 2.4 is a backward-compatability hack used only
by testmod().
2004-09-13 14:53:28 +00:00
Barry Warsaw 302bd589ad Add tests for keyword arguments and combining mapping and keyword arguments. 2004-09-13 14:35:59 +00:00
Barry Warsaw 46b629c101 Accepted Raymond's patch to combine mapping and keyword arguments, with slight
modification.  Also, renamed the positional argument to '__mapping' to further
reduce the chance of duplicate keyword arguments.
2004-09-13 14:35:04 +00:00