Commit Graph

9683 Commits

Author SHA1 Message Date
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