Commit Graph

10085 Commits

Author SHA1 Message Date
Johannes Gijsbers 6b220b0355 Use os.geteuid() for checking whether we are root, as suggested by
Michael Hudson.
2004-12-12 15:52:57 +00:00
Raymond Hettinger a9ef5e565d SF bug #1083202L UnboundLocalError raised by atexit module
The sys module could be called before being imported.
2004-12-11 02:49:40 +00:00
Marc-André Lemburg bb4f1bdd8b locale.py now uses an updated locale alias table (built using
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
alias file); the encoding lookup was enhanced to use Python's
encoding alias table

As sige-effect, this fixes SF bug [ 1080864 ] locale.py doesn't recognize
valid locale setting.
2004-12-10 21:58:14 +00:00
Marc-André Lemburg 9ab8818c87 Rearranged mappings to value sorting order. 2004-12-10 21:54:35 +00:00
Tim Peters 7f06187d31 Whitespace normalization. 2004-12-07 21:17:46 +00:00
Fred Drake 333da5f000 remove the other half of one of the regsub-related comments; the other
half was removed in revision 1.25
2004-12-07 14:08:24 +00:00
Raymond Hettinger 6c1e0fe7ba Remove reference to old pickle feature. 2004-12-07 08:26:10 +00:00
Raymond Hettinger 57aef9cb29 Remove outdated references to the regsub module. 2004-12-07 07:55:07 +00:00
Raymond Hettinger a6b45cc31d Eliminate the deprecated option to return None instead of a tuple of arguments in __reduce__(). 2004-12-07 07:05:57 +00:00
Brett Cannon 84667c063a Change code in setup.py for parsing LDFLAGS and CPPFLAGS to use optparse
instead of getopt.  Required making use of gettext._ as optional (optparse
changed OK'ed by Greg Ward in private email).
2004-12-07 03:25:18 +00:00
Johannes Gijsbers 25946ddac9 Patch #1075928: AUTH PLAIN in smtplib.
smtplib can not log in to some server using command AUTH PLAIN, it sends
``user\0user\0pass'' to the server, but ``\0user\0pass'' has better
compatibility.
2004-12-06 21:25:26 +00:00
Johannes Gijsbers b8b09d0513 SF bug #1076467: don't run test_on_error as root, as the permission
errors don't get provoked that way. Also add a bunch of cross-references
to bugs.
2004-12-06 20:50:15 +00:00
Brett Cannon c8aa848ece Have test_mkalias_relative check that sys.prefix already exists; otherwise test
is pointless.

Also add a note to the docs for the 'test' package that test cases should check
first that any conditions needed in the operating system are met before having
a test run.

Closes bug #1077302.  THanks, Ian Holsman.
2004-12-06 06:08:59 +00:00
Peter Astrand 5f5e141589 Changed signature of call function to avoid confusion: this 'args' is not the same as the one to the Popen constructor 2004-12-05 20:15:36 +00:00
Raymond Hettinger c7979f16ec Removed deprecated tzparse module. 2004-12-05 11:38:18 +00:00
Raymond Hettinger b2594050ea Added optional None arguments to itertools.islice(). 2004-12-05 09:25:51 +00:00
Raymond Hettinger 3489cad30a Removed the deprecated bin parameter from the pickle module. 2004-12-05 05:20:42 +00:00
Raymond Hettinger 4ebe364277 Remove the deprecated statcache module. 2004-12-05 04:55:14 +00:00
Raymond Hettinger 1bc82f891c Removed deprecated method arguments from the shelve module. 2004-12-05 03:58:17 +00:00
Barry Warsaw 7cf9ce2440 Fixes for SF #1076485, which I'll apply to the CVS head too. The problem was
caused by a self._input.readline() call that wasn't checking for the
NeedsMoreData marker.

msg_43.txt contains a message that illustrates the problem, when
email.message_from_*() is called.  That interface uses the Parser API, which
splits reads into 8192 byte chunks.  It so happens that for the test message,
the 8192 chunk falls inside a message/delivery-status, which is where in the
FeedParser the readline() call was that didn't check for NeedsMoreData.

I also added an assert to unreadline() so it'll be more evident if an attempt
to push back NeedsMoreData ever happens again.

Bump the email package version number.
2004-12-05 03:45:42 +00:00
Raymond Hettinger 6c92d76abc Removed deprecated method from pstats. 2004-12-05 03:28:00 +00:00
Raymond Hettinger f3fa9460de Removed deprecated use_statcache argument. 2004-12-05 01:58:09 +00:00
Raymond Hettinger 664347be94 SF bug #1078905: Docs for unittest run() methods are misleading 2004-12-04 21:21:53 +00:00
Raymond Hettinger 46ea4c810f For the benefit of historians . . . 2004-12-04 20:07:30 +00:00
Raymond Hettinger 784ab76c87 Remove the deprecated whrandom module. 2004-12-04 10:50:51 +00:00
Raymond Hettinger 3b0c7c20a1 SF patch #1077353: add key= argument to min and max
(First draft of patch contributed by Steven Bethard.)
2004-12-03 08:30:39 +00:00
Marc-André Lemburg 58d89dba7d Restore Python 2.1 compatibility (os.extsep was introduced in Python 2.2). 2004-12-02 20:14:16 +00:00
Raymond Hettinger 4901a1f267 Add key= argument to heapq.nsmallest() and heapq.nlargest(). 2004-12-02 08:59:14 +00:00
Thomas Heller 0e920a7244 Recompiled binaries after source changes. 2004-12-01 19:43:34 +00:00
Peter Astrand 738131d391 Raise TypeError if bufsize argument is not an integer. Patch 1071755, slightly modified. 2004-11-30 21:04:45 +00:00
Peter Astrand 6fdf3cbb13 Corrected example for replacing shell pipeline. Fixes bug 1073790. 2004-11-30 18:06:42 +00:00
Anthony Baxter e2648eeb14 doodedoodedoo on the way to 2.4 final 2004-11-30 01:28:55 +00:00
Raymond Hettinger e1defa4175 Fix argument order in pure python version of nsmallest() and nlargest(). 2004-11-29 05:54:48 +00:00
Barry Warsaw f4c7c402d4 RFC 2822 describes the characters allowed in a header field name. Conform to
this, and add test cases.
2004-11-29 03:46:54 +00:00
Anthony Baxter e48bad7a24 preparing for 2.4 final (wooooooo!) 2004-11-29 01:40:31 +00:00
Barry Warsaw 99b7d6445c There's likely nothing more to do to the email package before Python 2.4 is
final, so I'm marking email's version number as "3.0" (e.g. final).
2004-11-29 01:10:14 +00:00
Tim Peters 26be2067e8 Whitespace normalization. 2004-11-28 01:10:01 +00:00
Barry Warsaw 2e8c1f189a Fix for SF bug #1072623. When the last line of the input string does not end
in a newline, and it's an end boundary, the FeedParser wasn't recognizing it
as such.  Tweak the regexp to make the ending linesep optional.

For grins, clear self._partial when closing the BufferedSubFile.

Added a test case.
2004-11-28 00:21:42 +00:00
Walter Dörwald f7f9b6cb2d Fix typo in comment. 2004-11-25 12:23:23 +00:00
Fredrik Lundh cb328f393e SF patch #1071739 (by Christos Georgiou)
This patch offers a better explanation in case the MS VC++ (free)
toolkit is installed but the .NET Framework SDK is not.
2004-11-24 22:31:11 +00:00
Raymond Hettinger 605ed02483 SF bug #1071588 coercing decimal to int doesn't work between -1 and 1 2004-11-24 07:28:48 +00:00
Brett Cannon 3684c8771e Have testLoadTkFailure() skip on cygwin since Tcl/Tk on cygwin renders to the
Windows GDI directly and thus does not need a DISPLAY environment variable.

Thanks Jason Tishler.
2004-11-24 03:01:36 +00:00
Johannes Gijsbers 8e6f2ded30 Bug #1071513: don't test on Cygwin, as chmod doesn't work reliably there
(http://www.cygwin.com/faq/faq_3.html#SEC41).

Also check whether onerror has actually been called so this test will
fail on assertion instead of on trying to chmod a non-existent file.
2004-11-23 09:27:27 +00:00
Brett Cannon 08febebf96 Add 'linux2' as one of the platforms that does not use the echo service as one
of the test possiblities for testGetServBy().
2004-11-20 21:10:07 +00:00
Kurt B. Kaiser e953511858 On OpenBSD, terminating IDLE with ctrl-c from the command line caused a
stuck subprocess MainThread because only the SocketThread was exiting.

M NEWS.txt
M idlever.py
M run.py
2004-11-19 15:46:49 +00:00
Anthony Baxter 5cc727ad7b 2.4rc1 2004-11-18 12:32:27 +00:00
Peter Astrand 2224be64dc Remove tempfile after use in test_call_string.
In test_args_string, remove the tempfile before assertEqual.
2004-11-17 20:06:35 +00:00
Kurt B. Kaiser 03562a5e62 Saving a Keyset w/o making changes (by using the "Save as New Custom Key Set"
button) caused IDLE to fail on restart (no new keyset was created in
config-keys.cfg).  Also true for Theme/highlights.  Python Bug 1064535.
2004-11-16 21:31:08 +00:00
Kurt B. Kaiser 5acdf93081 Saving a Keyset w/o making changes (by using the "Save as New Custom Key Set"
button) caused IDLE to fail on restart (no new keyset was created in
config-keys.cfg).  Also true for Theme/highlights.  Python Bug 1064535.

M configDialog.py
2004-11-16 21:28:36 +00:00
Walter Dörwald 1b626cac73 Fix pprint to be able to handle objects that don't have a __repr__
attribute. Fixes SF bug #1065456.
2004-11-15 13:51:41 +00:00
Martin v. Löwis 6fe8f1928f Back out rev 1.96; see #1009389. 2004-11-14 10:21:04 +00:00
Kurt B. Kaiser f7a8899f33 The change in the linecache.checkcache() signature at rev 1.13 caused IDLE to exit
when an exception was raised while running w/o the subprocess.  Python Bug 1063840

M NEWS.txt
M PyShell.py
2004-11-13 21:05:58 +00:00
Tim Peters bbc0d4409c SF bug 1065388: calendar day/month name lookup too slow
__getitem__() methods:  compute only the new spellings needed to satisfy
the given indexing object.  This is purely an optimization (it should
have no effect on visible semantics).
2004-11-13 16:18:32 +00:00
Martin v. Löwis fba7369824 Patch #1050475: Fix various x86_64 build issues
regrtest.py: skip rgbimg and imageop as they are not built on 64-bit systems.
_tkinter.c: replace %.8x with %p for printing pointers.
setup.py: add lib64 into the library directories.
2004-11-13 11:13:35 +00:00
Walter Dörwald aee4da6b83 Add options to regrtest.py to make it possible to specify where to put
the coverage files when -T is used.
2004-11-12 18:51:27 +00:00
Tim Peters 0ca0c64409 SF bug 1054821: difflib HtmlDiff() extra space on inserted 1 character lines
Simple correction from the code's author (Dan Gass).
2004-11-12 16:12:15 +00:00
Peter Astrand 195404ff90 Use os.chdir/os.getcwd instead of os.path.realpath, to support Tru64
TEMP dirs with {memb} strings. Fixes #1063571.
2004-11-12 15:51:48 +00:00
Just van Rossum 2dae7646c3 On second thought: "Errors should never pass silently", so barf when a
string contains control chars that are illegal for XML
2004-11-12 09:36:12 +00:00
Just van Rossum 48ecaccf9e testing control chars and non-dict root objects 2004-11-12 08:34:32 +00:00
Just van Rossum b84330d368 - \f is not a valid XML character
- reformatted regex pattern, use r"" consistently
2004-11-12 08:14:49 +00:00
Just van Rossum 26e811abd5 reordered a couple of things 2004-11-12 08:02:35 +00:00
Martin v. Löwis 5a6601cfc6 Update compatibility comments to 2.1, corresponding to PEP 291 1.13. 2004-11-10 22:23:15 +00:00
Thomas Heller 41f7038a3e Avoid a linker warning: MSVC 7 doesn't support /pdb:None, the debug
info will always be in a .pdb file.
2004-11-10 09:01:41 +00:00
Raymond Hettinger 952f8808b2 SF patch #1062279: deque pickling problems
(Contributed by Dima Dorfman.)

* Support pickling of dictionaries in instances of deque subclasses.
* Support pickling of recursive deques.
2004-11-09 07:27:35 +00:00
Raymond Hettinger 15056a5202 SF 1062353: set pickling problems
Support automatic pickling of dictionaries in instance of set subclasses.
2004-11-09 07:25:31 +00:00
Tim Peters 7960bf9c00 And delete a useless comment. 2004-11-08 22:31:09 +00:00
Tim Peters d7bbbbc594 _OutputRedirectingPdb.trace_dispatch(): Return the base class's
trace_dispatch() result in a more obvious, and more robust way.
2004-11-08 22:30:28 +00:00
Tim Peters 50c6bdb1d6 test_doctest.py test_pdb_set_trace_nested(): A new test from Jim Fulton
showing that doctest's pdb.set_trace() support was dramatically broken.

doctest.py _OutputRedirectingPdb.trace_dispatch():  Return a local trace
function instead of (implicitly) None.  Else interaction with pdb was
bizarre, noticing only 'call' events.  Amazingly, the existing set_trace()
tests didn't care.
2004-11-08 22:07:37 +00:00
Michael W. Hudson e0b855fac9 test for fixedness of bug #1057835.
(thanks to Raymond for the prod).
2004-11-08 16:46:02 +00:00
Michael W. Hudson 05522ad795 Fix bug
[ 1057835 ] compiler.transformer, "from module import *"
2004-11-08 12:17:34 +00:00
Raymond Hettinger 481b09b352 SF #1062190. Removed an assertion that rendered trace.py unnecessarily
inflexibile.
2004-11-08 06:36:42 +00:00
Martin v. Löwis d6eb3523f6 Stop printing listdir bytestring output, as the precise list of strings
returned depends on the filesystem encoding.
2004-11-07 20:01:56 +00:00
Martin v. Löwis cd24699256 Try a different filename if the Latin-1 file name cannot
be represented in the file system. Fixes #989338.
2004-11-07 19:57:35 +00:00
Johannes Gijsbers 8de645a176 Patch #1061931 / bug #971872: factor out part of spillproperties, so
properties are also documented if help(Class.<property>) is called
instead of help(Class).
2004-11-07 19:16:05 +00:00
Jeremy Hylton def9d2a17c Fix for SF bug 988120 via patch 1061941.
If read() returned less than the number of bytes request, the full amount was subtracted from length instead of the actually read amount.
2004-11-07 16:13:49 +00:00
Johannes Gijsbers d7b6ad4b60 Patch #1061904 / bug #878275: give a nicer error message when someone
accidentally derives from TestSuite instead of TestCase.
2004-11-07 15:46:25 +00:00
Peter Astrand c1d6536d60 When using shell=True on Windows, don't display a shell window by default. Fixes #1057061. 2004-11-07 14:30:34 +00:00
Johannes Gijsbers 84a6c205e3 Bug #1055168: calling pdb.set_trace() calls Bdb.set_trace, which made
the debugger enter inside pdb.set_trace.

Patch #1061767: make pdb.set_trace enter enter at the stack frame
calling pdb.set_trace().
2004-11-07 11:35:30 +00:00
Tim Peters 00afb07490 Whitespace normalization. 2004-11-07 04:52:29 +00:00
Tim Peters 90cf212cef Essentially SF patch 1061679: add missing __all__ to pickletools.py.
Harmless.
2004-11-06 23:45:48 +00:00
Raymond Hettinger 8a92dd5866 Don't choke on modes like rb or wb. 2004-11-06 00:31:51 +00:00
Barry Warsaw 93d9d5fb37 get_boundary(): Fix for SF bug #1060941. RFC 2046 says boundaries may begin
-- but not end -- with whitespace.

I will backport to Python 2.3.
2004-11-06 00:04:52 +00:00
Barry Warsaw 932874df39 test_boundary_with_leading_space(): Test case for SF bug #1060941. RFC 2046
says boundaries may begin -- but not end -- with whitespace.

I will backport to Python 2.3.
2004-11-06 00:04:20 +00:00
Anthony Baxter b0c6630794 post-release 2004-11-04 05:23:17 +00:00
Skip Montanaro 599bd5e1e1 Fix bug 1052242. Also includes rewrite of test case using unittest and
avoiding use of popen.
2004-11-04 04:31:30 +00:00
Anthony Baxter 9f41f3a192 release shenanigans 2004-11-03 06:21:37 +00:00
Raymond Hettinger 5dec096e6a Maintain peepholer's cumlc invariant by updating the running total
everytime a LOAD_CONSTANT is encountered, created, or overwritten.

Added two tests to cover cases affected by the patch.
2004-11-02 04:20:10 +00:00
Raymond Hettinger f7010bed89 * Bumped up the sleep() delay to four seconds so this test will run
reliably on WinME with FAT32.
* Native speaker rewrite of the comment block.
* Removed unnecessary backslashes from the multi-line function defintions.
2004-11-01 22:27:14 +00:00
Walter Dörwald bb9c739806 Add error checks for the bz2, cStringIO and operator modules.
Add function names to various PyArg_ParseTuple calls in bz2module.c.
2004-11-01 17:10:19 +00:00
Hye-Shik Chang 4a8d851910 Bug #1057993: Use sleep() always instead of os.utime() possibly broken
in some platforms.
2004-11-01 08:26:09 +00:00
Barry Warsaw 8c72eae237 SF patch #1056967, changes the semantics of Template.safe_substitute() to not
raise a ValueError for dangling delimiters (the delimiter itself is returned).
2004-11-01 03:52:43 +00:00
Tim Peters 4590c00e89 test_on_error(): Rewrite so it works on WinXP too. Unsure about 95/98/ME. 2004-11-01 02:40:52 +00:00
Johannes Gijsbers ef5ffc4765 Bug #1048941: shutil.rmtree error handling was always broken
Rewrite rmtree again, this time without os.walk(). Error handling had been
broken since Python 2.3, and the os.walk() version inherited this.
2004-10-31 12:05:31 +00:00
Tim Peters ead8b7ab30 SF 1055820: weakref callback vs gc vs threads
In cyclic gc, clear weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.

This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced.  I'll backport to 2.3.
2004-10-30 23:09:22 +00:00
Armin Rigo 89a39461bf Wrote down the invariants of some common objects whose structure is
exposed in header files.  Fixed a few comments in these headers.

As we might have expected, writing down invariants systematically exposed a
(minor) bug.  In this case, function objects have a writeable func_code
attribute, which could be set to code objects with the wrong number of
free variables.  Calling the resulting function segfaulted the interpreter.
Added a corresponding test.
2004-10-28 16:32:00 +00:00
Walter Dörwald 063e1e846d Trigger a few error cases in Modules/_codecsmodule.c. 2004-10-28 13:04:26 +00:00
Brett Cannon 14adbe77b5 Fix bug of implementation of algorithm for calculating the date from year, week
of the year, and day of the week.  Was not taking into consideration properly
the issue of when %U is used for the week of the year but the year starts on
Monday.

Closes bug #1045381 again.
2004-10-28 04:49:21 +00:00
Mark Hammond 79d9bfa28f Fix [1055540 ] bdist_wininst broken for pure Python distributions 2004-10-27 21:54:33 +00:00
Raymond Hettinger 17931de110 SF patch #1053375.
(Contributed by Facundo Batista.)

Code simplification by eliminating the unnecessary and error-prone
convolutions for the previously weird sign convention in _WorkRep().
Makes the code more understandable, more reliable, and a bit faster.
2004-10-27 06:21:46 +00:00
Hye-Shik Chang 7afa64e260 Add a comment explains why we should modify mtime here. 2004-10-27 03:12:05 +00:00
Tim Peters 1816d79bac Removed newly redundant embedded import. 2004-10-27 02:44:10 +00:00
Tim Peters 10d59f3fa1 Whitespace normalization. 2004-10-27 02:43:25 +00:00
Tim Peters f1af9c0896 Paper over bug 1054615 by passing sane values to os.utime().
The underlying bug still exists, but also existed in 2.3.4:
import.c's load_source_module() returns NULL if
PyOS_GetLastModificationTime() returns -1, but
PyOS_GetLastModificationTime() doesn't set any exception when it returns
-1, and neither does load_source_module() when it gets back -1.  This
leads to "SystemError: NULL result without error in PyObject_Call"
on an import that fails in this way.
2004-10-27 02:33:15 +00:00
Greg Ward 48aa84b24d Update optparse module and test suite to Optik 1.5a2. 2004-10-27 02:20:04 +00:00
Facundo Batista 99b5548298 Very few little improvements. 2004-10-26 23:38:46 +00:00
Just van Rossum fc93e17598 - Added tests for the string load/dump function.
- Added a chunk of plist data as generated by Cocoa's NSDictionary and
  verify we output the same (including formatting)
- Changed the "literal" plist code to match the raw test data
2004-10-26 11:02:08 +00:00
Just van Rossum 1f74ef0fa3 Made <data> output match Apple's exactly. To do that I had to add a custom
version of base64.encodestring() so I could control the line length of the
base64 output.
2004-10-26 10:30:55 +00:00
Just van Rossum 8b8decea21 also escape '>', to closer match Apple's plist output 2004-10-26 10:11:00 +00:00
Hye-Shik Chang 182ac85147 SF #737473: Show up-to-date source code in tracebacks always.
And add an optional argument 'filename' to linecache.checkcache()
to enable checking caches per-file.
2004-10-26 09:16:42 +00:00
Raymond Hettinger 23109ef11e SF bug #1053819: Segfault in tuple_of_constants
Peepholer could be fooled into misidentifying a tuple_of_constants.
Added code to count consecutive occurrences of LOAD_CONST.
Use the count to weed out the misidentified cases.
Added a unittest.
2004-10-26 08:59:14 +00:00
Just van Rossum 368c0b22f8 Deprecating Dict class; going through a few hoops to get the warnings right. 2004-10-26 07:38:16 +00:00
Just van Rossum 7c9448755b - Removed Date class. We don't really need it for b/w compatibility since
a) the functionality depended on PyXML before and b) hardly worked to
  begin with.
- Instead, output and require upon input datetime.datetime objects.
2004-10-26 07:20:26 +00:00
Just van Rossum c6fdd1b398 - added two more convenience functions: readPlistFromString() and
writePlistToString()
- use these two in the resource functions.
- Tweaked module doc string.
2004-10-26 06:50:50 +00:00
Raymond Hettinger 561fbf138d SF bug #1054139: serious string hashing error in 2.4b1
_PyString_Resize() readied strings for mutation but did not invalidate
the cached hash value.
2004-10-26 01:52:37 +00:00
Just van Rossum 15cf4f0100 Updated doc strings. 2004-10-25 16:10:53 +00:00
Just van Rossum 86ca902eed Deprecate Plist class 2004-10-25 16:09:10 +00:00
Just van Rossum 10e52dbe28 Removed superfluous **kwargs constructor cruft: this class predates
the dict(**kwargs) feature.
2004-10-25 16:04:20 +00:00
Just van Rossum 95387a1895 Patch from Bob Ippolito, slighly edited:
[ 1052399 ] plistlib: add plst resource functionality, fix bugs
2004-10-25 15:10:42 +00:00
Tim Peters 8ceefc5a56 Whitespace normalization. 2004-10-25 03:19:41 +00:00
Tim Peters 16e3cf535b format_paragraph_event(): Patch 961387 introduced a bug here, causing
the indentation of a comment block to be ignored when reformatting the
block, leading to overly long reformatted lines (too wide by an amount
equal to the indentation width).  Looks like a typo in the original
patch, a 1-character repair.
2004-10-24 23:45:42 +00:00
Raymond Hettinger 2ef7e6c8f2 SF bug #1052503: pdb runcall should accept keyword arguments 2004-10-24 00:32:24 +00:00
Raymond Hettinger 9047c8f73d SF bug #1048870: call arg of lambda not updating 2004-10-24 00:10:06 +00:00
Vinay Sajip dccd4321a7 Fixed bug in handling of args in LogRecord.__init__. 2004-10-21 21:24:27 +00:00
Peter Astrand c19ccc9f11 Removed test_close_fds, because it's too unreliable. We simply cannot
know that the newly-started Python process only has 3 filedescriptors
open. Fixes bug 1048808.
2004-10-21 19:28:34 +00:00
Andrew M. Kuchling 8bc462fcaf [Patch #1043972, for bug #1017553] filemode() returns an incorrect value for the mode 07111 2004-10-20 11:48:42 +00:00
Andrew M. Kuchling d4f2552ef8 Add test case for bug #1017553 2004-10-20 11:47:01 +00:00
Fred Drake 910b282fbb when only using half of the return value of os.path.split(), use
os.path.dirname() or os.path.basename() instead
2004-10-20 11:08:35 +00:00
Vinay Sajip 4ed315ae66 Changed handling of args in LogRecord.__init__. 2004-10-20 08:39:40 +00:00
Raymond Hettinger 06d9b1f30b SF bug #902037: relative on-disk SYSTEM id handling is incorrect
(Contributed by Bob Ippolito.)

backport candidate.
2004-10-20 08:21:19 +00:00
Raymond Hettinger e54e726f0b SF patch #1038388: __main__ for whichdb.py
(Contributed by Oleg Broytmann.)
2004-10-20 07:17:16 +00:00
Raymond Hettinger 76e60d687d SF bug #1048728: Bug fixes and cleanup for decimal.py
(Contributed by Neal Norwitz.  Reviewed by Facundo Bastista.)
2004-10-20 06:58:28 +00:00
Andrew M. Kuchling 8520b94750 Display helpful message; print repr() of return value so the whitespace is clearer 2004-10-19 19:36:09 +00:00
Andrew M. Kuchling ccab001c3d [Bug #1048816] Fix bug when you do Ctrl-K at the start of a line; fix from Stefan Heimann 2004-10-19 19:29:40 +00:00
Andrew M. Kuchling a13ea5572a Make magic coordinates more readable 2004-10-19 19:21:20 +00:00
Brett Cannon 8dc25ad6f2 Fix comments. 2004-10-18 01:47:46 +00:00
Brett Cannon 8abcc5d533 Add support for %U and %W to contribute to calculating the date when the year
and day of the week are specified.

Closes bug #1045381.
2004-10-18 01:37:57 +00:00
Hye-Shik Chang af5c7cff56 SF #1048865: Fix a trivial typo that breaks StreamReader.readlines() 2004-10-17 23:51:21 +00:00
Raymond Hettinger a9f6092904 Fix and test weak referencing of itertools.tee objects. 2004-10-17 16:40:14 +00:00
Raymond Hettinger 837dd93e3b Fix docstring formatting of escape sequences. 2004-10-17 16:36:53 +00:00
Neal Norwitz 6627a96705 Invalid patterns to substitute and safe_substitute would crash since pattern
is not a local variable.  Add a test case.
2004-10-17 16:27:18 +00:00
Neal Norwitz 1338946c7b Use proper value for False 2004-10-17 16:24:25 +00:00
Neal Norwitz 2fa0b9d0bd Remove unnecessary imports 2004-10-17 16:23:52 +00:00
Fredrik Lundh 15aaacc93e return codes are available on all platforms, not just on Unix 2004-10-17 14:47:05 +00:00
Anthony Baxter 6a587c160b release shenanigans 2004-10-15 08:07:21 +00:00
Fredrik Lundh 5e7d51b62c make sure to check for this limit even if we're running with -O 2004-10-15 06:15:08 +00:00
Raymond Hettinger 4d03791632 SF bug #1046855: httplib index out of range 2004-10-14 15:23:38 +00:00
Anthony Baxter a024034b94 Patch 1046644 - improved distutils support for SWIG. 2004-10-14 10:02:08 +00:00
Tim Peters 1dbf2434d5 remove_stderr_debug_decorations(): Always try the substitution. Else
this test failed under the combination of passing -O to a debug-build
Python.  Now all 4 of those pass ({debug, release} x {-O, no -O}).
2004-10-14 04:16:54 +00:00
Neal Norwitz 64fa74df21 Get test to pass on amd64 (opteron). This is pretty hacky, but
rangeobject.c has an #ifdef that is reached only when LONG_MAX != INT_MAX
2004-10-14 03:46:18 +00:00
Martin v. Löwis 4b9059b437 Require minimally PyXML 0.8.4. 2004-10-13 19:57:14 +00:00
Fredrik Lundh 3e73a011d9 Replace dynamic try/except with "if 0", to keep py2exe happy. If you
want to use pywin32 instead of _subprocess, you have to edit the file.
2004-10-13 18:19:18 +00:00
Anthony Baxter 22dcf66f84 Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)
2004-10-13 15:54:17 +00:00
Jim Fulton 7d428788e1 Fixed a small bug. doctest didn't handle unicode docstrings containing
non-ascii characters.
2004-10-13 14:15:32 +00:00
Anthony Baxter 73cc8479f0 oops. how did _that_ happen? 2004-10-13 13:22:34 +00:00
Anthony Baxter f2113f0c6e Backing out the basic dependency checking (from pycon sprint).
This support was only a first cut, and doesn't deserve to be in
a released version (where we have to support it in an ongoing
manner)
2004-10-13 12:35:28 +00:00
Fredrik Lundh 9e29fc584c Don't spend quite as much time looking for leaks on Windows, where
it's rather expensive to create new processes.
2004-10-13 07:54:54 +00:00
Fredrik Lundh 59c0559554 normalize case when comparing directory names (problem reported by
"Khalid A. B." on python-dev)
2004-10-13 06:55:40 +00:00
Fredrik Lundh 7069c31bbb removed info@pythonware.com reference
(should probably remove all traces of _xmlrpclib, but I'll leave that
for another day.)
2004-10-13 06:48:37 +00:00
Martin v. Löwis f7e74b789d Add a comment explaining -kb. 2004-10-13 05:29:39 +00:00
Tim Peters 3761e8dd66 New helper remove_stderr_debug_decorations(). This test passes in a
debug build on Windows now.  More applications of the helper may be needed
on non-Windows platforms.
2004-10-13 04:07:12 +00:00
Tim Peters 29b6b4f7c7 Kill several problems at once: test_poll() failed sometimes for me.
Turns out the mysterious "expected output" file contained exactly N dots,
because test_poll() has a loop that *usually* went around N times,
printing one dot on each loop trip.  But there's no guarantee of that,
because the exact value of N depended on the vagaries of scheduling
time.sleep()s across two different processes.  So stopped printing dots,
and got rid of the expected output file.  Add a loop counter instead,
and verify that the loop goes around at least a couple of times.  Also
cut the minimum time needed for this test from 4 seconds to 1.
2004-10-13 03:43:40 +00:00
Tim Peters 4052fe5a9b test_stdout_none(): Don't print "banana" to the screen in the middle
of the test.  It's testing stdout in a different process, so it has to
print something, but I didn't find "banana" to be self-explanatory.
2004-10-13 03:29:54 +00:00
Tim Peters 876c43245e Windows test_creationflags() test: print msg to stderr informing the
tester that a DOS box is expected to flash.  Slash the sleep from 2
seconds to a quarter second (why would we want to wait 2 seconds just
to stare at a DOS box?).
2004-10-13 03:21:35 +00:00
Tim Peters e8374a55c4 Folded long lines. 2004-10-13 03:15:00 +00:00
Tim Peters f73cc9714f XXX about extreme expense of test_no_leaking() on Windows. I'm not sure
what this is trying to do.  If it's necessary for it to create > 1000
processes, it should be controlled by a new resource and not run by
default on Windows.
2004-10-13 03:14:40 +00:00
Tim Peters 7b759da1b8 Experience with Zope2's tests showed it's a Bad Idea to make unittest
display a test's docstring as "the name" of the test.  So changed most
test docstrings to comments, and removed the clearly useless ones.  Now
unittest reports the actual names of the test methods.
2004-10-12 22:29:54 +00:00
Tim Peters 3b01a70f76 Wrap long lines. 2004-10-12 22:19:32 +00:00
Tim Peters e718f615b8 Whitespace normalization. 2004-10-12 21:51:32 +00:00
Johannes Gijsbers 25b38c8969 Improvements when running pdb as a script.
Bug fixes:

* Use fresh copy of globals/locals so the script being debugged can't access
  the pdb namespace (e.g.: p line_prefix will no longer work).

* Remove pdb.py's path from sys.path. Having it in there is normally not a
  problem, but it could prove irritating when messing with PYTHONPATH or
  invoking pdb via /usr/bin/pdf.

* You can now set a breakpoint on the script being debugged, even if the script
  doesn't end with a '.py' extension. Also, setting breakpoints with absolute
  paths now works reliably.

Enhancements:

* Go directly to the first line of the script.

* Enter post-mortem debugging if the script being debugged doesn't catch an
  exception.

* Restart the script being debugged and preserve debugger state when the script
  being debugged exits.

Cleanup:

* Moved the __main__ method into a main() function.

* Kill the (undocumented, not in __all__) mainmodule/mainpyfile globals, add a
  mainpyfile attribute to pdb.

Thanks Ilya Sandler for the patch!
2004-10-12 18:12:09 +00:00
Andrew M. Kuchling 51ee66e611 Typo fix 2004-10-12 16:38:42 +00:00
Fredrik Lundh 5b3687df2e Added Peter Astrand's subprocess module. 2004-10-12 15:26:28 +00:00
Raymond Hettinger abf8a56e68 Don't use mutable values for method defaults. 2004-10-12 09:12:16 +00:00
Johannes Gijsbers 9fc9789a0d Document that on Unix, the 'cmd' argument to the os.popen2/3/4 and
popen2.popen2/3/4 functions can be a sequence. All texts are a variation on the
following:

On \UNIX, \var{cmd} may be a sequence, in which case arguments will be passed
directly to the program without shell intervention (as with
\function{os.spawnv()}). If \var{cmd} is a string it will be passed to the shell
(as with \function{os.system()}).
2004-10-11 18:12:20 +00:00
Michael W. Hudson c054a8b1a9 This is jiwon's patch to fix:
[ 1042238 ] Lib/compiler chokes on certain genexps
2004-10-11 15:35:53 +00:00
Michael W. Hudson 29589a06f6 Open source files in universal newlines mode. 2004-10-11 15:34:31 +00:00
Anthony Baxter 3dd9e46161 Added a usegmt flag to email.Utils.formatdate - this allows it to be
used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must
be the timezone string).
2004-10-11 13:53:08 +00:00
Barry Warsaw 2294bfc19d All known bugs are closed, and Python 2.4b1 is coming out soon, so bump
email's version number to 3.0b1.
2004-10-09 23:01:11 +00:00
Barry Warsaw dee0cf12e3 Fix SF bug # 1030941. In _parsegen(), in the clause where we're
capturing_preamble but we found a StartBoundaryNotFoundDefect, we need to
consume all lines from the current position to the EOF, which we'll set as the
epilogue of the current message.  If we're not at EOF when we return from
here, the outer message's capturing_preamble assertion will fail.
2004-10-09 23:00:11 +00:00
Barry Warsaw 6bd55ee1ef An example message for SF bug # 1030941. 2004-10-09 22:57:57 +00:00
Barry Warsaw 83f1a1b1f7 test_missing_start_boundary(): A test for SF bug # 1030941. 2004-10-09 22:57:33 +00:00
Barry Warsaw f267b623f3 Fix for SF bug # 1010102. The default is PureProxy not SMTPProxy. 2004-10-09 21:44:13 +00:00
Barry Warsaw ea7c7af10b __init__(): Coerce the input_charset to unicode (with ascii encoding) before
calling .lower() on it.  This fixes the problem described in SF patch # 866982
where in the tr_TR.ISO-8859-9 locale, 'I'.lower() isn't 'i'.  unicodes are
locale insensitive.
2004-10-09 21:08:30 +00:00
Raymond Hettinger dab988dd23 SF patch #1043218
Simplify internal calls and logic for _fix() and _fixexponents().
(Contributed by Facundo Batista.)
2004-10-09 07:10:44 +00:00
Piers Lauder c09acfda77 Fix bug in _checkquote that raised an exception on empty "arg". 2004-10-08 04:05:39 +00:00
Johannes Gijsbers 7db385eef5 Rewrite rmtree using os.walk to fix bug #1025127:
The shutils.rmtree() implementation uses an excessive amount of memory when
deleting large directory hierarchies. Before actually deleting any files, it
builds up a list of (function, filename) tuples for all the files that it is
going to remove.
2004-10-07 21:10:08 +00:00
Brett Cannon ffa5cf9eae Fix bug introduced by the previous patch by changing TimeRE.__seqToRe() to
accept any iterable instead of only a sliceable object.
2004-10-06 22:48:58 +00:00
Brett Cannon f7948c25a2 Convert a listcomp to a gencomp (was already editing code). 2004-10-06 02:23:14 +00:00
Brett Cannon 4f35c71543 Locale data that contains regex metacharacters are now properly escaped.
Closes bug #1039270.
2004-10-06 02:11:37 +00:00
Brett Cannon b9b5f160ab Fix a small typo in the docstring for system_methodSignature .
Closes bug #1038935.  Thanks Malte Helmert for spotting it.
2004-10-03 23:21:44 +00:00
Vinay Sajip e7d4066cdf Changes made to maintain 1.5.2 compatibility. 2004-10-03 19:12:07 +00:00
Vinay Sajip 2d5fee06e0 Version number updated to 0.4.9.5 2004-10-03 19:10:53 +00:00
Tim Peters ab9b32c077 Whitespace normalization. 2004-10-03 18:35:19 +00:00
David Goodger 1cbf206d32 SF bug #997050: Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work. 2004-10-03 15:55:09 +00:00
David Goodger 68a1abdade SF bug #1017864: ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options. 2004-10-03 15:40:25 +00:00
Barry Warsaw 1b643596a8 Fix test for FeedParser results. 2004-10-03 04:02:43 +00:00
Barry Warsaw 05bef930fa as_string(): Indicate that this mangles From_ lines. 2004-10-03 03:38:07 +00:00
Barry Warsaw bb11386730 Big email 3.0 API changes, with updated unit tests and documentation.
Briefly (from the NEWS file):

- Updates for the email package:
  + All deprecated APIs that in email 2.x issued warnings have been removed:
    _encoder argument to the MIMEText constructor, Message.add_payload(),
    Utils.dump_address_pair(), Utils.decode(), Utils.encode()
  + New deprecations: Generator.__call__(), Message.get_type(),
    Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
    the Parser constructor.  These will be removed in email 3.1.
  + Support for Python earlier than 2.3 has been removed (see PEP 291).
  + All defect classes have been renamed to end in 'Defect'.
  + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
    added to messages that claim to be multipart but really aren't.
  + Updates to documentation.
2004-10-03 03:16:19 +00:00
Just van Rossum 2cdd608601 removed 2.2 support 2004-10-02 14:06:56 +00:00
Just van Rossum 16c3e08931 use new readPlist() and writePlist() functions 2004-10-02 14:06:18 +00:00
Armin Rigo 974d757af1 Upon insertion, if memory runs out, the deque was left in a corrupted state.
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".

deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.

deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before).  Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...

deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed.  Added a test.

I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c.  On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble.  (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
2004-10-02 13:59:34 +00:00
Just van Rossum 4c3d054d3d Which reminds me, I've had a much improved plistlib.py lying around for
ages. The main improvements are:
- a much more convenient API: readPlist() and writePlist()
- support non-dict top-level objects
2004-10-02 08:40:47 +00:00
Tim Peters 10c7e86454 deque_traverse(): If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build.  Reported on c.l.py by Stefan Behnel.
2004-10-01 02:01:04 +00:00
Raymond Hettinger 7b46f6b2a5 Add tests for syntax errors. 2004-09-30 22:29:03 +00:00
Raymond Hettinger 49c522be80 Expand scope to include general mapping protocol tests.
Many of these tests are redundant, but this will ensure
that the mapping protocols all stay in sync.
Also, added a test for dictionary subclasses.
2004-09-30 15:07:29 +00:00
Walter Dörwald 59b23e8b80 Add missing test_dict.py from patch #736962. 2004-09-30 13:46:00 +00:00
Raymond Hettinger 5ea7e31076 Improve test coverage. 2004-09-30 07:47:20 +00:00
Raymond Hettinger ff5dc0ee77 Improve test coverage. 2004-09-29 11:40:50 +00:00
Raymond Hettinger bcab2b25f9 Improve test coverage. 2004-09-29 08:03:17 +00:00
Edward Loper 7d88a58e85 Reverted the addition of a NORMALIZE_NUMBERS option, per Tim Peter's
request.  Tim says that "correct 'fuzzy' comparison of floats cannot
be automated."  (The motivation behind adding the new option
was verifying interactive examples in Python's latex documentation;
several such examples use numbers that don't print consistently on
different platforms.)
2004-09-28 05:50:57 +00:00
Raymond Hettinger 4cda01e260 * Increase test coverage.
* Have groupby() be careful about decreffing structure members.
2004-09-28 04:45:28 +00:00
Edward Loper aec3c9b54f Added a new NORMALIZE_NUMBERS option, which causes number literals in
the expected output to match corresponding number literals in the
actual output if their values are equal (to ten digits of precision).
2004-09-28 04:29:57 +00:00
Raymond Hettinger 6429a4727e Use Py_CLEAR(). Add unrelated test. 2004-09-28 01:51:35 +00:00
Raymond Hettinger 855d9a985b Plug a leak and beef-up test coverage. 2004-09-28 00:03:54 +00:00
Raymond Hettinger 630e5355b5 Rename test for comparision errors. 2004-09-27 23:11:35 +00:00
Raymond Hettinger 63251781d1 Beef-up tests for greater coverage and refcount checking. 2004-09-27 22:48:40 +00:00
Armin Rigo 9f90439817 Patch #1011240: SystemError generated by struct.pack('P', 'foo'). 2004-09-27 19:27:51 +00:00
Armin Rigo b562bc672b Trivial bug fix: deque == [] is not a good way to check if a deque is empty. 2004-09-27 17:49:00 +00:00
Raymond Hettinger ffdb8bb99c Use floor division operator. 2004-09-27 15:29:05 +00:00
Raymond Hettinger 4837a223ee Use floor division operator. 2004-09-27 14:23:40 +00:00
Edward Loper 498a1868e7 - Added a "parser" option to testfile() and DocFileTest(). 2004-09-27 03:42:58 +00:00
Raymond Hettinger aa241e0149 Checkin Tim's fix to an error discussed on python-dev.
Also, add a testcase.

Formerly, the list_extend() code used several local variables to remember
its state across iterations.  Since an iteration could call arbitrary
Python code, it was possible for the list state to be changed.  The new
code uses dynamic structure references instead of C locals.  So, they
are always up-to-date.

After list_resize() is called, its size has been updated but the new
cells are filled with NULLs.  These needed to be filled before arbitrary
iteration code was called; otherwise, that code could attempt to modify
a list that was in a semi-invalid state.  The solution was to change
the ob->size field back to a value reflecting the actual number of valid
cells.
2004-09-26 19:24:20 +00:00
Raymond Hettinger 55593c3ef5 Make the regex pattern easier to read, understand, and modify
by factoring out the common prefix (the delimiter).
2004-09-26 18:56:44 +00:00
Tim Peters 3afaaf2487 Removed debug_script from the public API: no docs, not public. I'm in
the process of writing docs for the other "missing" debug support
functions.
2004-09-26 03:50:06 +00:00
Tim Peters 9d02a7cfa0 Add set_unittest_reportflags() to the public API. Docs will follow
"soon", after I repair the LaTeX I somehow damaged.
2004-09-26 01:50:24 +00:00
Tim Peters 261b28aac6 Removed two undocumented unittest support classes, and one undocumented
unittest support function, from the public interface.  If they're not
documented, they shouldn't be public.
2004-09-26 01:24:23 +00:00
Tim Peters 48983fc484 Removed most of the module docstring. There's too much to explain now,
and the LaTeX docs are in increasingly good shape.
2004-09-25 02:41:28 +00:00
Tim Peters 5a59d88e89 Whitespace normalization. 2004-09-24 23:16:41 +00:00
Johannes Gijsbers 3981511070 Port test_unpack to doctest (patch #736962). 2004-09-24 21:36:52 +00:00
Neil Schemenauer 6bc937cfd2 Add yet more tests for buffer(). 2004-09-24 19:18:42 +00:00
Neil Schemenauer 29302a7867 Add a few more tests for the buffer() object. 2004-09-24 15:35:15 +00:00
Vinay Sajip b2635b2f71 Added log() function 2004-09-24 11:45:52 +00:00
Vinay Sajip 02dd994adf Added exception handling during handler initialization in fileConfig() 2004-09-24 11:45:13 +00:00
Tim Peters 1cc37380b2 Whitespace normalization. 2004-09-24 04:36:47 +00:00
Raymond Hettinger 596ba4d89e Granted Noam Raphael's request for minor improvements to the re module and
its documentation.

* Documented that the compiled re methods are supposed to be more full
  featured than their simpilified function counterparts.

* Documented the existing start and stop position arguments for the
  findall() and finditer() methods of compiled regular expression objects.

* Added an optional flags argument to the re.findall() and re.finditer()
  functions.  This aligns their API with that for re.search() and
  re.match().
2004-09-24 03:41:05 +00:00
Tim Peters 307fa78107 SF bug #513866: Float/long comparison anomaly.
When an integer is compared to a float now, the int isn't coerced to float.
This avoids spurious overflow exceptions and insane results.  This should
compute correct results, without raising spurious exceptions, in all cases
now -- although I expect that what happens when an int/long is compared to
a NaN is still a platform accident.

Note that we had potential problems here even with "short" ints, on boxes
where sizeof(long)==8.  There's #ifdef'ed code here to handle that, but
I can't test it as intended.  I tested it by changing the #ifdef to
trigger on my 32-bit box instead.

I suppose this is a bugfix candidate, but I won't backport it.  It's
long-winded (for speed) and messy (because the problem is messy).  Note
that this also depends on a previous 2.4 patch that introduced
_Py_SwappedOp[] as an extern.
2004-09-23 08:06:40 +00:00
Raymond Hettinger 4533f1fb7f Improve three recipes in the itertools docs. 2004-09-23 07:27:39 +00:00
Raymond Hettinger 513c8bd6f2 Arghh, checked in wrong draft. Replacing with correct one. 2004-09-23 07:00:47 +00:00
Raymond Hettinger 0336e1fe8c Use local variables in StringIO.write().
Makes it easier on the eyes and a bit more snappy.
2004-09-23 06:43:25 +00:00
Phillip J. Eby 7ec642a4d2 Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders. 2004-09-23 04:37:36 +00:00
Raymond Hettinger 2c31a058eb SF patch #1031667: Fold tuples of constants into a single constant
Example:
>>> import dis
>>> dis.dis(compile('1,2,3', '', 'eval'))
  0           0 LOAD_CONST               3 ((1, 2, 3))
              3 RETURN_VALUE
2004-09-22 18:44:21 +00:00
Raymond Hettinger ce96d8b684 Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
2004-09-22 17:17:32 +00:00
Vinay Sajip b9591174df Added getLoggerClass() 2004-09-22 12:39:26 +00:00
Edward Loper a2fc7ec80a - Minor docstring fixes.
- Simplified code to find names for file-based tests.
2004-09-21 03:24:24 +00:00
Edward Loper 4ae900f43b - Changed SampleClass docstrings to test docstring parsing a little
more thouroughly.
2004-09-21 03:20:34 +00:00
Tim Peters bab3e99689 Whitespace normalization. 2004-09-20 19:52:34 +00:00
Raymond Hettinger 61656203cd Import no longer needed. 2004-09-20 18:08:31 +00:00
Skip Montanaro 13dea5a42b Raymond reminded me to use DSU key 2004-09-20 16:43:30 +00:00
Skip Montanaro 41f89a4f3d Sort classes by fully qualified name. In the common case where you are
displaying a set of classes from one module it doesn't matter, but if you
are displaying a large class tree from multiple modules it improves the
display to sort by module.name.
2004-09-20 15:40:38 +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 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 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 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 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
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
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
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 cae14d2714 missed the obvious test case and corresponding fix 2004-09-14 17:55:21 +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
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
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
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
Edward Loper 32ddbf7fab Added new parameter exclude_empty to DocTestFinder.__init__, which
controls whether tests are included for objects with empty docstrings.
Defaults to True, to match the behavior of Python 2.3.
2004-09-13 05:47:24 +00:00
Tim Peters c56847878e DocTestFinder._find(): for tests derived from a module __test__ global,
doctest always promised to stick "__test__" in the name.  That got
broken.  Now it's fixed again.
2004-09-13 01:07:12 +00:00
Tim Peters 82076ef194 Reluctantly, rehabilitate doctest.master. 2004-09-13 00:52:51 +00:00
Tim Peters 9661f9ab4f Tester.run___test__(): This couldn't possibly work at all. I'm afraid
the "backward compatibility" here was a joke.
2004-09-12 22:45:17 +00:00
Tim Peters 4be7a92f7f Tester.__init__(): this couldn't possibly work when a module argument
was passed.
2004-09-12 22:39:46 +00:00
Tim Peters 0e9980f75a Whitespace normalization. 2004-09-12 03:49:31 +00:00
Johannes Gijsbers d60e92a48d Document not-completely-obvious behavior in a test. 2004-09-11 21:26:21 +00:00
Tim Peters 17b56379e1 Recover from inspect.getmodule() changes. It returns a module for
functions and methods now, including functions defined inside doctests
in test_doctest.py's recursive doctest'ing.
2004-09-11 17:33:27 +00:00
Johannes Gijsbers 9324526a76 Use __module__ attribute when available instead of using isclass() predicate
(functions and methods have grown the __module__ attribute too). See bug #570300.
2004-09-11 15:53:22 +00:00
Barry Warsaw f43e8bd7b4 Template: remove __slots__ since that interferes with the ability to mix in
Template and unicode classes.
2004-09-10 18:30:42 +00:00
Andrew M. Kuchling 55be9eab38 Typo fix: 'comparisions' is not a word 2004-09-10 12:59:54 +00:00
Martin v. Löwis 23c48a12d9 Patch #808120: Add --force-arch=ARCH to bdist_rpm.py. 2004-09-10 06:32:54 +00:00
Martin v. Löwis 641d64812c Patch #808115: Add script support to bdist_rpm.py. 2004-09-10 06:25:01 +00:00
Raymond Hettinger 1f7d6a633f __slots__ went missing from Template. 2004-09-10 06:21:22 +00:00
Barry Warsaw 12827c1fa9 Many updates to PEP 292 templates. Summary:
- Template no longer inherits from unicode.

- SafeTemplate is removed.  Now Templates have both a substitute() and a
  safe_substitute() method, so we don't need separate classes.  No more
  __mod__() operator.

- Adopt Tim Peter's idea for giving Template a metaclass, which makes the
  delimiter, the identifier pattern, or the entire pattern easy to override
  and document, while retaining efficiency of class-time compilation of the
  regexp.

- More informative ValueError messages which will help a user narrow down the
  bogus delimiter to the line and column in the original string (helpful for
  long triple quoted strings).
2004-09-10 03:08:08 +00:00
Fred Drake 583359ed2e clean up the API a little; exceptions are defined by this module
(needs documentation)
2004-09-09 02:24:13 +00:00
Fred Drake 58ae830fd0 add name that should be considered public to __all__ 2004-09-09 01:49:58 +00:00
Fred Drake 49b4d19172 remove unnecessary override of base class method 2004-09-08 22:58:36 +00:00
Fred Drake 75d9a62fe0 add tests that make sure buffer boundaries are handled properly for SGML comments
(see SF patch #901369)
2004-09-08 22:57:01 +00:00
Brett Cannon 85ae1a69b6 Remove usage of locale.getlocale in favor or setlocale(LC_NUMERIC, None) .
Also added a comment about why the code is bother to see what setlocale thinks
the set locale is.

Closes bug #1023798.
2004-09-08 02:02:41 +00:00
Walter Dörwald 69652035bc SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
decoding incomplete input (when the input stream is temporarily exhausted).
codecs.StreamReader now implements buffering, which enables proper
readline support for the UTF-16 decoders. codecs.StreamReader.read()
has a new argument chars which specifies the number of characters to
return. codecs.StreamReader.readline() and codecs.StreamReader.readlines()
have a new argument keepends. Trailing "\n"s will be stripped from the lines
if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and
PyUnicode_DecodeUTF16Stateful.
2004-09-07 20:24:22 +00:00
Jeremy Hylton 8f00a24229 Remove debugging print (not triggered by test suite) and add XXX comment about how the code should raise a SyntaxError. 2004-09-07 15:36:48 +00:00
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.
2004-09-07 15:28:01 +00:00
Brett Cannon 2ad68e69b9 Ported test__locale to unittest. 2004-09-06 23:30:27 +00:00