Commit Graph

8914 Commits

Author SHA1 Message Date
Anthony Baxter 39a0f04421 New parser. Next up, making the current parser use this parser 2004-03-22 00:33:28 +00:00
Tim Peters 3f60629242 SF bug 847019 datetime.datetime initialization needs more strict checking
It's possible to create insane datetime objects by using the constructor
"backdoor" inserted for fast unpickling.  Doing extensive range checking
would eliminate the backdoor's purpose (speed), but at least a little
checking can stop honest mistakes.

Bugfix candidate.
2004-03-21 23:38:41 +00:00
Brett Cannon 8d9b60f102 Change parse_qsl() to accept control-name's with no equal sign (e.g., "name")
when keep_blank_values is true.
2004-03-21 22:16:15 +00:00
Nicholas Bastin 668034173b Normalized files in test_unicode_file to eliminate failure on OSX 2004-03-21 20:55:47 +00:00
Andrew M. Kuchling 67867eaf8c [Part of patch #909005] Added map parameter for file_dispatcher and dispatcher_with_send 2004-03-21 20:03:18 +00:00
Andrew M. Kuchling 174bdbc999 [Part of patch #909005] Repeating exception changed from 'raise socket.error, why' to just raise. Make use of connect_ex() raise socket.error with 2-tuple instead of just error code 2004-03-21 19:58:28 +00:00
Andrew M. Kuchling 419af88b34 [Part of patch #909005] Remove Mac code for writable 2004-03-21 19:52:01 +00:00
Andrew M. Kuchling 0ebbbe30f1 [Part of patch #909005] Set initial poll flags 2004-03-21 19:50:09 +00:00
Andrew M. Kuchling 68522b1895 [Part of patch #909005] Use True/False 2004-03-21 19:46:16 +00:00
Andrew M. Kuchling 56d7913bae [Patch #900071] Be case-insensitive when removing 'usage:' string 2004-03-21 19:28:48 +00:00
Andrew M. Kuchling 9303777f22 [Part of patch #909005] Handle POLLPRI flag, and various errors cases. Fixes bug #887279 2004-03-21 19:26:00 +00:00
Tim Peters 6602520473 SF bug 917108: warnings.py does not define _test().
Removed the entire __name__ == '__main__' block.
2004-03-21 17:06:20 +00:00
Martin v. Löwis 433fa69c40 Patch #853488: Add hlist entry_configure and entry_cget methods. 2004-03-21 15:26:44 +00:00
Neil Schemenauer 4848557924 Remove unused instance attributes. 2004-03-21 15:18:50 +00:00
Brett Cannon 46cf4fc249 Back out last patch that removed an entry from sys.path if it was not an
existent path.  Pointed out by jvr that entries could be non-file items for
custom importers.
2004-03-21 14:06:49 +00:00
Brett Cannon c82208eecb Deal with case of when locale time values has characters that can be mistaken
for regex syntax.
Fixes bug #883604 .
2004-03-20 23:09:40 +00:00
Brett Cannon 4f65331483 Limit the nesting depth of a tuple passed as the second argument to
isinstance() or issubclass() to the recursion limit of the interpreter.
2004-03-20 22:52:14 +00:00
Guido van Rossum 70ec0b42b5 Fix for SF 777848.
I've been bitten by this myself in the past half year.
I hope this fix is right.
I'll backport this to 2.3.
2004-03-20 22:18:03 +00:00
Tim Peters 27f49610af SF patch 508730 CGIHTTPServer execfile should save cwd
UNTESTED!!!

This simple two-line patch has been sitting on SF for more than 2 years.
I'm guessing it's because nobody knows how to test it -- I sure don't.
It doesn't look like you can get to this part of the code on Unixish
or Windows systems, so the "how to test it?" puzzle has more than one
part.  OTOH, if this is dead code, it doesn't matter either if I just
broke it <wink>.
2004-03-20 21:51:12 +00:00
Brett Cannon cc45466b8f Remove non-existent paths. 2004-03-20 21:31:33 +00:00
Brett Cannon 497331fa2b Fix how line endings were handled when iterating over a .pth file by stripping
all whitespace at the end of the path line.
2004-03-20 21:08:17 +00:00
Thomas Wouters 1e1305491b test_email: comment out two fail-test cases that no longer fail with the new
parser -- for now. Failure behaviour of the new parser(s) will change in any
case, so this will be revisited later anyway.
2004-03-20 20:29:50 +00:00
Tim Peters 934d31b1d3 Speed HMAC.copy() by installing a secret backdoor argument to
HMAC.__init__().  Adapted from SF patch 895445 "hmac.HMAC.copy() speedup"
by Trevor Perrin, who reported that this approach increased throughput
of his hmac-intensive app by 30%.
2004-03-20 20:11:29 +00:00
Thomas Wouters 0813d76cb0 Merge in Anthony's new parser code, from the anthony-parser-branch:
> ----------------------------
> revision 1.20.4.4
> date: 2003/06/12 09:14:17;  author: anthonybaxter;  state: Exp;  lines: +13 -6
> preamble is None when missing, not ''.
> Handle a couple of bogus formatted messages - now parses my main testsuite.
> Handle message/external-body.
> ----------------------------
> revision 1.20.4.3
> date: 2003/06/12 07:16:40;  author: anthonybaxter;  state: Exp;  lines: +6 -4
> epilogue-processing is now the same as the old parser - the newline at the
> end of the line with the --endboundary-- is included as part of the epilogue.
> Note that any whitespace after the boundary is _not_ part of the epilogue.
> ----------------------------
> revision 1.20.4.2
> date: 2003/06/12 06:39:09;  author: anthonybaxter;  state: Exp;  lines: +6 -4
> message/delivery-status fixed.
> HeaderParser fixed.
> ----------------------------
> revision 1.20.4.1
> date: 2003/06/12 06:08:56;  author: anthonybaxter;  state: Exp;  lines: +163 -129
> A work-in-progress snapshot of the new parser. A couple of known problems:
>
> - first (blank) line of MIME epilogues is being consumed
> - message/delivery-status isn't quite right
>
> It still needs a lot of cleanup, but right now it parses a whole lot of
> badness that the old parser failed on. I also need to think about adding
> back the old 'strict' flag in some way.
> =============================================================================
2004-03-20 17:31:29 +00:00
Fred Drake 6fd0b0d5ba commit the portion of PyXML patch #919008 that is relevant to the
standard library:
str() of xml.sax.SAXParseException should not fail if the line and/or
column number returned by the locator are None
(tests added)
2004-03-20 08:15:30 +00:00
Hye-Shik Chang 5c5316f111 Add a new unicode codec: ptcp154 (Kazakh) 2004-03-19 08:06:07 +00:00
Gregory P. Smith 1281f76606 * supply a more useful error message when append() is called on the
wrong type of database in dbshelve.
* fix a typo in the exception name when checking args
2004-03-16 18:50:26 +00:00
Gregory P. Smith bce64ec086 bugfix for people executing test_all to run the test suite. (call the
correct function)
2004-03-16 07:07:06 +00:00
Kurt B. Kaiser 6e4620bfb1 1. Make builtin foreground Royal Purple instead of Barney Purple.
2. Touch up help.txt

M config-highlight.def
M help.txt
2004-03-16 03:36:41 +00:00
Walter Dörwald cd1e8a9485 Port test_binascii.py to PyUnit and enhance tests.
Code coverage for binascii.c is at 92%.
From SF patch #736962.
2004-03-15 12:07:38 +00:00
Kurt B. Kaiser 0bc3d9857f 1. Bug in Patch 805830 fixed by Nigel Rowe
2. Convert 1/0 to True/False
3. Fix a couple of long lines

M ColorDelegator.py
M NEWS.txt
2004-03-15 04:26:37 +00:00
Raymond Hettinger deb4da500b Add missing docstrings. 2004-03-14 07:54:37 +00:00
Raymond Hettinger 49f9bd15ff SF feature request #686323: Minor array module enhancements
array.extend() now accepts iterable arguments implements as a series
of appends.  Besides being a user convenience and matching the behavior
for lists, this the saves memory and cycles that would be used to
create a temporary array object.
2004-03-14 05:43:59 +00:00
Jack Jansen 118e1277a6 Two issues spotted by Ronald OUssoren:
- there were no accessor functions for the global per-database fields
- packages and their dependencies were installed in order in stead
  of in reverse order.
2004-03-13 23:50:48 +00:00
Jack Jansen c32cec14b4 Don't use "dict" as a variable, it shadows the builtin. Spotted by
Bob Ippolito.
2004-03-13 23:32:47 +00:00
Jack Jansen 0576d0a48a Force option should be applied to a single package, not recursively
to its dependencies. Fixes #733819.
2004-03-13 23:03:38 +00:00
Raymond Hettinger 2d95f1ad57 SF patch #911431: robot.txt must be robots.txt
(Contributed by George Yoshida.)
2004-03-13 20:27:23 +00:00
Raymond Hettinger 3aa82c07f7 SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
2004-03-13 18:18:51 +00:00
Jack Jansen 989ddc0709 - Added a downloader using urllib2 in stead of curl, based on code
donated by Kevin Ollivier. This is now the default downloader.
- Added a watcher mechanism, whereby downloaders and unpackers (and,
later builders) can give status feedback to the user. When running
pimp as a command line tool in verbose mode print this output.
2004-03-11 23:03:59 +00:00
Neil Schemenauer 6cbba50a43 Make test_coercion.py less sensitive to platform fp quirks. Closes
SF bug #678265.
2004-03-10 17:30:03 +00:00
Raymond Hettinger ef9bf4031a Tidied up the implementations of reversed (including the custom ones
for xrange and list objects).

* list.__reversed__ now checks the length of the sequence object before
  calling PyList_GET_ITEM() because the mutable could have changed length.

* all three implementations are now tranparent with respect to length and
  maintain the invariant len(it) == len(list(it)) even when the underlying
  sequence mutates.

* __builtin__.reversed() now frees the underlying sequence as soon
  as the iterator is exhausted.

* the code paths were rearranged so that the most common paths
  do not require a jump.
2004-03-10 10:10:42 +00:00
Raymond Hettinger d2c36261a2 Eliminate the double reverse option. It's only use case
was academic and it was potentially confusing to use.
2004-03-10 08:32:47 +00:00
Brett Cannon 4b6b7f1515 Remove calls to currentThread() in _Condition methods that were side-effect.
Side-effects were deemed unnecessary and were causing problems at shutdown
time when threads were catching exceptions at start time and then triggering
exceptions trying to call currentThread() after gc'ed.  Masked the initial
exception which was deemed bad.

Fixes bug #754449 .
2004-03-08 22:18:57 +00:00
Raymond Hettinger 6ec099658a SF patch #907403: Improvements to cStringIO.writelines()
The writelines() method now accepts any iterable argument and writes
the lines one at a time rather than using ''.join(lines) followed by
a single write.  Results in considerable memory savings and makes
the method suitable for use with generator expressions.
2004-03-08 18:17:31 +00:00
Kurt B. Kaiser 73360a3e61 Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe
M ClassBrowser.py
M ColorDelegator.py
M EditorWindow.py
M NEWS.txt
M PyShell.py
M TreeWidget.py
M config-highlight.def
M configDialog.py
M configHandler.py
2004-03-08 18:15:31 +00:00
Vinay Sajip 4102478f46 Removed spurious import statement 2004-03-08 16:57:19 +00:00
Raymond Hettinger f0e3569a28 Refactor the copy dispatcher code in copy.py. Simplifies and shortens
the code by grouping common cases together.
2004-03-08 05:59:33 +00:00
Brett Cannon 8172ac3d15 Deal with possible case of having time.tzname[1] containing UTC or GMT.
Since it is known ahead of time that UTC and GMT always have no DST adjustment
then just set the isdst value to 0 even if tzname[0] == tzname[1] .
Fixes bug #897817 .
2004-03-07 23:16:27 +00:00
Raymond Hettinger dd80f76265 SF patch #910929: Optimize list comprehensions
Add a new opcode, LIST_APPEND, and apply it to the code generation for
list comprehensions.  Reduces the per-loop overhead by about a third.
2004-03-07 07:31:06 +00:00
Raymond Hettinger 31017aed36 SF #904720: dict.update should take a 2-tuple sequence like dict.__init_
(Championed by Bob Ippolito.)

The update() method for mappings now accepts all the same argument forms
as the dict() constructor.  This includes item lists and/or keyword
arguments.
2004-03-04 08:25:44 +00:00