Commit Graph

7925 Commits

Author SHA1 Message Date
Barry Warsaw ea8f6fa094 test_whitespace_eater_unicode(): Make this test Python 2.1 compatible. 2003-03-12 03:14:11 +00:00
Barry Warsaw ca53c12c8b Python 2.1 doesn't have True and False 2003-03-12 02:54:17 +00:00
Kurt B. Kaiser 7c22132069 M rpc.py
M run.py
1. Clarify that rpc.SocketIO._getresponse() currently blocks on socket.
2. Improve exception handling in subprocess when GUI terminates abruptly.
2003-03-11 22:55:56 +00:00
Jack Jansen dded84802a Allow unicode pathnames where FSRefs are expected. Fixes 696253. 2003-03-11 21:48:57 +00:00
Guido van Rossum 315aa361fc Add 'audio' resource.
ALERT! A month ago or so I made test_ossaudiodev.py require the
'audio' resource, but I didn't make the necessary changes to
regrtest.py.  This means that *nobody* has been testing the oss module
all that time!
2003-03-11 14:46:48 +00:00
Jack Jansen 47e5987256 Patch by Andrew Straw: use urllib2 so proxie access works. 2003-03-11 14:37:19 +00:00
Barry Warsaw f9e0bd8df8 Adjust tests for no newline appending to MIMEText.__init__()'s _text
argument.
2003-03-11 05:10:46 +00:00
Barry Warsaw df6c70b454 beta 1 2003-03-11 05:05:21 +00:00
Barry Warsaw bd757ba1ed Adjust tests for no newline appending to MIMEText.__init__()'s _text
argument.
2003-03-11 05:04:54 +00:00
Barry Warsaw cbec700b49 __init__(): Don't add a newline to _text if it doesn't already end in
one.  Possibly controversial.
2003-03-11 05:04:09 +00:00
Barry Warsaw 12dc230c00 body_line_iterator(): Accept optional decode argument, pass through to
Message.get_payload().
2003-03-11 04:41:35 +00:00
Barry Warsaw 08898499b2 get_payload(): Teach this about various uunencoded
Content-Transfer-Encodings
2003-03-11 04:33:30 +00:00
Barry Warsaw 3840b49d9c test_get_decoded_uu_payload(): A new test for
Content-Transfer-Encoding: x-uuencode
2003-03-11 04:31:37 +00:00
Kurt B. Kaiser 9ac783d723 M PyShell.py
M rpc.py
Improve exception handing if peer process has terminated.
2003-03-10 20:42:24 +00:00
Kurt B. Kaiser 98b15ab980 A interruptmodule.c
M setup.py
Implements an interrupt extension module which allows a subthread
to raise an interrupt in the main thread.
2003-03-10 20:41:07 +00:00
Barry Warsaw a2369928b5 specialsre, escapesre: In SF bug #663369, Matthew Woodcraft points out
that backslashes must be escaped in character sets.
2003-03-10 19:20:18 +00:00
Barry Warsaw a2e64702ca test_escape_backslashes(): A test for SF bug #663369 by Matthew Woodcraft. 2003-03-10 19:18:34 +00:00
Barry Warsaw 59e98ae1c5 _bdecode(): Remove redundant check. 2003-03-10 17:36:04 +00:00
Barry Warsaw 513af770d7 Fix base class 2003-03-10 17:00:43 +00:00
Barry Warsaw e1ff4bbce6 Use ndiffAssertEqual in a couple of places for better error reporting. 2003-03-10 16:59:34 +00:00
Barry Warsaw 21191d3e31 get_payload(): If we get a low-level binascii.Error when base64
decoding the payload, just return it as-is.
2003-03-10 16:13:14 +00:00
Barry Warsaw 3efb651ea3 test_broken_base64_payload(): Test for crash in low-level binascii
module when decoding a message with broken base64.
2003-03-10 16:09:51 +00:00
Martin v. Löwis a57dccdcd4 Patch #700839: Fix bugs in the plural handling. 2003-03-10 16:01:43 +00:00
Andrew M. Kuchling a416341b30 [Patch #649762] Fix for asynchat endless loop
When the null string is used as the terminator, it used to be the same
as None, meaning "collect all the data".  In the current code, however, it
falls into an endless loop; this change reverts to the old behavior.
2003-03-10 15:16:54 +00:00
Barry Warsaw 5b8c69f11e _split_ascii() [method and function]: Don't join the lines just to
split them again.  Simply return them as chunk lists.

_encode_chunks(): Don't add more folding whitespace than necessary.
2003-03-10 15:14:08 +00:00
Andrew M. Kuchling faef74a2b0 Use isinstance() instead of type comparison 2003-03-10 15:12:00 +00:00
Barry Warsaw 796376338f test_another_long_multiline_header(): Yet another formatting test. 2003-03-10 15:11:29 +00:00
Raymond Hettinger 1fdb633530 SF patch #691928: Use datetime in _strptime
Contributed by Brett Cannon.

To prevent code duplication, I patched _strptime to use datetime's date
object to do Julian day, Gregorian, and day of the week calculations.

Patch also includes new regression tests to test results and the
calculation gets triggered.

Very minor comment changes and the contact email are also changed.
2003-03-09 07:44:42 +00:00
Raymond Hettinger 2c2d322884 SF patch #667730: More DictMixin
* Adds missing pop() methods to weakref.py
* Expands test suite to broaden coverage of objects with
  a mapping interface.

Contributed by Sebastien Keim.
2003-03-09 07:05:43 +00:00
Raymond Hettinger 42182ebaf6 SF 698520: Iterator for urllib.URLOpener
Contributed by Brett Cannon.
2003-03-09 05:33:33 +00:00
Martin v. Löwis c49435c991 Skip the test if TESTFN_ENCODING is None. Fixes #699386. 2003-03-08 10:25:31 +00:00
Barry Warsaw 33975eac3d _split_ascii(): lstrip the individual lines in the ascii split lines,
since we'll be adding our own continuation whitespace later.
2003-03-07 23:24:34 +00:00
Barry Warsaw 28ffcef4e6 test_long_unbreakable_lines_with_continuation(): Another funky example
from Jason Mastaler :)
2003-03-07 23:23:04 +00:00
Barry Warsaw 8e1e7f5468 decode_rfc2231(): RFC 2231 allows leaving out both the charset and
language without including any single quotes.
2003-03-07 22:46:41 +00:00
Barry Warsaw 21fcc4e287 test_rfc2231_no_language_or_charset(): RFC 2231 allows leaving out
both the charset and language without including any single quotes.
2003-03-07 22:45:55 +00:00
Tim Peters 61cd0db3d2 Don't quote the path to Python unless the path contains an embedded space.
Quoting the path doesn't work on Win2K (cmd.exe) regardless, this is just
a hack to let the test pass again on Win2K (so long as Python isn't
installed in a path that does contain an embedded space).  On Win2K it
looks like we'd also have to add a second pair of double quotes, around
the entire command line.
2003-03-07 21:10:21 +00:00
Tim Peters 669454e9dc Whitespace normalization. 2003-03-07 17:30:48 +00:00
Barry Warsaw bf7e241397 whitespace normalization 2003-03-07 15:58:51 +00:00
Tim Peters eabafebfbc This test relied on significant trailing whitespace in a string literal.
Evil.
2003-03-07 15:55:36 +00:00
Barry Warsaw ce6bf59b2d _write_headers(), _split_header(): All of the smarts for splitting
long header lines is now (properly) in the Header class.  So we no
longer need _split_header() and we'll just defer to Header.encode()
when we have a plain string.
2003-03-07 15:43:17 +00:00
Barry Warsaw 9f3fcd9c23 More internal refinements of the ascii splitting algorithm.
_encode_chunks(): Pass maxlinelen in instead of always using
self._maxlinelen, so we can adjust for shorter initial lines.
Pass this value through to _max_append().

encode(): Weave maxlinelen through to the _encode_chunks() call.

_split_ascii(): When recursively splitting a line on spaces
(i.e. lower level syntactic split), don't append the whole returned
string.  Instead, split it on linejoiners and extend the lines up to
the last line (for proper packing).  Calculate the linelen based on
the last element in the this list.
2003-03-07 15:39:37 +00:00
Jack Jansen c4d6bdd58a Test_ioctl and test_tarfile are skipped on MacOS9. 2003-03-07 15:38:11 +00:00
Jack Jansen 1c8501e5b4 Filter out macfs warning. 2003-03-07 15:36:49 +00:00
Tim Peters f9347782e0 Somebody must not have run the test before checking this in -- it had
a fatal tab/space inconsistency under -tt.
2003-03-07 15:36:41 +00:00
Barry Warsaw 82783e6f33 test_string_headerinst_eq(): Another Jason test :) 2003-03-07 15:35:47 +00:00
Jack Jansen cfc4902b2a Make tarfile raise ImportError on MacOS9. The pathname handling needs work, and I don't have time to fix it. I'll file a bug report. 2003-03-07 13:37:32 +00:00
Jack Jansen 149a8993b0 The filename fix of the previous checkin was complete bogus, the problem is elsewhere. Retracting. 2003-03-07 13:27:53 +00:00
Jack Jansen c7fcc2d772 Two fixes to make this test pass on MacOS9:
- the test was sloppy about filenames: "0-REGTYPE-TEXT" was used where
  the archive held "/0-REGTYPE-TEXT".
- tarfile extracts all files in binary mode, but the test expected to be able to
  read and compare text files in text mode. Use universal text mode.
2003-03-07 12:50:45 +00:00
Jack Jansen 834eff6a4c Test that os.utime and os.chmod actually exist before using them. 2003-03-07 12:47:06 +00:00
Guido van Rossum 6e31aad983 Broke down and made it work for Python 2.0 and up. (Older versions
would have required refraining from using string methods -- too
painful.)

Changed the -s option so that multiple -s options are cumulative.
2003-03-07 01:33:18 +00:00
Raymond Hettinger a3e1e4cd79 SF patch #693753: fix for bug 639806: default for dict.pop
(contributed by Michael Stone.)
2003-03-06 23:54:28 +00:00
Tim Peters 2b4821347f Repaired a misleading comment Barry inherited from me. 2003-03-06 23:41:58 +00:00
Barry Warsaw bd836dfba3 _split_ascii(): In the clause where curlen + partlen > maxlen, if the
part itself is longer than maxlen, and we aren't already splitting on
whitespace, then we recursively split the part on whitespace and
append that to the this list.
2003-03-06 20:33:04 +00:00
Barry Warsaw f0d3585669 test_long_received_header(): Another test case for folding long
Received headers (first on semis then on whitespace), given by Jason
Mastaler.
2003-03-06 20:31:02 +00:00
Raymond Hettinger 4922768d02 Reverted the previous change to read() and readline().
Kevin Jacobs found that the code simplification did not
exactly match the semantics of the original.  Regression
test cases were requested.
2003-03-06 16:31:48 +00:00
Guido van Rossum 5573541b6f Add a note explaining why you shouldn't try to compute mean and
standard deviation.  Also add an XXX comment wondering if we should
refrain from using itertools.repeat().
2003-03-06 16:11:17 +00:00
Barry Warsaw c79ffb022f test_whitespace_eater_unicode(): Test of the last outstanding bug in
SF # 640110.
2003-03-06 16:11:14 +00:00
Barry Warsaw 4848805341 __unicode__(): When converting to a unicode string, we need to
preserve spaces in the encoded/unencoded word boundaries.  RFC 2047 is
ambiguous here, but most people expect the space to be preserved.
Really closes SF bug # 640110.
2003-03-06 16:10:30 +00:00
Guido van Rossum e05dcce686 Simpler way to write reindent(), suggested by Raymond H. 2003-03-06 13:09:09 +00:00
Barry Warsaw 28ffcb6f84 test_rfc2047_multiline(): Test case for SF bug #640110. 2003-03-06 06:38:29 +00:00
Barry Warsaw 671c3e6373 decode_header(): Typo when appending an unencoded chunk to the
previous unencoded chunk (e.g. when they appear on separate lines).
Closes the 2nd bug in SF #640110 (the first one's already been
fixed).
2003-03-06 06:37:42 +00:00
Barry Warsaw 10627ba9b8 Merge of the folding-reimpl-branch. Specific changes,
Update tests for email 2.5.
2003-03-06 05:41:07 +00:00
Barry Warsaw e899e51c06 Merge of the folding-reimpl-branch. Specific changes,
_split(): New implementation of ASCII line splitting which should do a
better job and not be subject to the various weird artifacts (bugs)
reported.  This should also do a better job of higher-level syntactic
splits by trying first to split on semis, then commas, then
whitespace.

Use a Timbot-ly binary search for optimal non-ASCII split points for
better packing of header lines.  This also lets us remove one
recursion call.  Don't pass in firstline, but instead pass in the
actual line length we're shooting for.  Also pass in the list of split
characters.

encode(): Pass in the list of split characters so applications can
have some control over what "higher level syntactic breaks" are.

Also,

decode_header(): Transform binascii.Errors which can occur when
decoding a base64 RFC 2047 header with bogus data, into an
email.Errors.HeaderParseError.  Closes SF bug #696712.
2003-03-06 05:39:46 +00:00
Barry Warsaw 0e4570bcb0 Merge of the folding-reimpl-branch. Specific changes,
Rename a constant.
2003-03-06 05:25:35 +00:00
Barry Warsaw 5c2f1536d0 Merge of the folding-reimpl-branch. Specific changes,
Remove a senseless comment.
2003-03-06 05:25:00 +00:00
Barry Warsaw 5d384ef069 Merge of the folding-reimpl-branch. Specific changes,
_handle_multipart(): Ensure that if the preamble exists but does not
end in a newline, a newline is still added.  Without this, the
boundary separator will end up on the preamble line, breaking the MIME
structure.

_make_boundary(): Handle differences in the decimal point character
based on the locale.
2003-03-06 05:22:02 +00:00
Barry Warsaw 784cf6ae88 Merge of the folding-reimpl-branch. Specific changes,
Charset: Alias __repr__ to __str__ for debugging.

header_encode(): When calling quopriMIME.header_encode(), set
maxlinelen=None so that the lower level function doesn't (also) try to
wrap/fold the line.
2003-03-06 05:16:29 +00:00
Barry Warsaw 0ed81c35a7 Merge of the folding-reimpl-branch. Specific changes,
_max_append(): Change the comparison so that the new string is
concatenated if it's less than or equal to the max length.

header_encode(): Allow for maxlinelen == None to mean, don't do any
line splitting.  This is because this module is mostly used by higher
level abstractions (Header.py) which already ensures line lengths.  We
do this in a cheapo way by setting the max_encoding to some insanely
<100k wink> large number.
2003-03-06 05:14:20 +00:00
Guido van Rossum e8577b7298 Add notes about baseline overhead, and about different Python
versions.  Add -h/--help option to print doc string.
2003-03-06 03:02:10 +00:00
Guido van Rossum b7ab6004b1 Added more documentation. 2003-03-06 02:32:19 +00:00
Guido van Rossum b3f09d4331 A flexible utility to time the execution speed of a code snippet.
Usable from the command line or from a program.
2003-03-05 23:31:58 +00:00
Jack Jansen 5b73385195 Two ancient and obscure bugs found and fixed by Donovan Preston (these
could be responsible for various unexplained problems with Python/OSA
interaction over the years):
- Enum values were passed as their string counterparts. Most applications
  don't seem to mind this, but some do (InDesign).
- Attributes have never worked (!), as they were incorrectly passed
  as parameters. Apparently nobody uses them much:-)
2003-03-05 21:16:06 +00:00
Just van Rossum f0dfbaf4ef Patch #698082 from Thomas Heller: Modulefinder didn't exclude modules
in packages correctly.
2003-03-05 17:23:48 +00:00
Martin v. Löwis 73d538b9c6 Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,
and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding.
Adjust test case.
2003-03-05 15:13:47 +00:00
Jack Jansen 620c0837bd Actually *do* override the type in AppBuilder. 2003-03-05 14:44:54 +00:00
Jack Jansen cc81b80710 Moved some application-bundle specific code from the BundleBuilder class to
AppBuilder, and set the default type to BNDL (overridden in AppBuilder).

This surfaced when trying to build help bundles.
2003-03-05 14:42:18 +00:00
Kurt B. Kaiser ddeaf11d7e Attempting to save the shell raised an error related to saving
breakpoints, which are not implemented in the shell
2003-03-04 04:42:04 +00:00
Kurt B. Kaiser b2487335bf SF 693333
Modify subprocess to print a reasonable message upon receiving
a 'quit' or 'exit'
2003-03-04 04:03:45 +00:00
Tim Peters fd8e6e5990 test_ioctl is an expected skip on Windows. 2003-03-04 00:26:38 +00:00
Andrew M. Kuchling a52b85262a [Bug #693470] 'licence' as an alias for 'license' doesn't work.
This patch makes it work again.
2003-03-03 20:07:27 +00:00
Kurt B. Kaiser b6aff15183 SF 695861
Eliminate extra blank line in shell output.  Caused by stdout not being
flushed
upon completion of subprocess' Executive.runcode() when user code ends by
outputting an unterminated line, e.g. print "test",
2003-03-03 20:06:48 +00:00
Andrew M. Kuchling a2eaf31727 [Bug #69389] List register command in __all__, so setup.py --help-commands will now list it 2003-03-03 18:37:16 +00:00
Andrew M. Kuchling a9ccce3fee Improve description 2003-03-03 18:26:01 +00:00
Michael W. Hudson f008998668 Fix bug
[ 555817 ] Flawed fcntl.ioctl implementation.

with my patch that allows for an array to be mutated when passed
as the buffer argument to ioctl() (details complicated by
backwards compatibility considerations -- read the docs!).
2003-03-03 12:29:42 +00:00
Jack Jansen 7451e3b4d5 Call AEInteractWithUser() before bringing up any of the dialogs (with the
exception of the ProgressBar, which I think is okay to show in the background).

This is a prerequisitite for the fix of #684975.
2003-03-03 12:25:02 +00:00
Martin v. Löwis 4eab486476 Patch #671666: Alias ANSI code page to "mbcs". 2003-03-03 09:34:01 +00:00
Guido van Rossum 0df6442ae5 Undo the apply() removals; this code needs to run under Python 1.5.2. 2003-03-02 20:47:29 +00:00
Guido van Rossum 206b9a779a MyComplex now works. 2003-03-02 13:53:18 +00:00
Tim Peters fc27375d5a test_load_from_canned_string(): Created a DATA2 string to test a canned
proto 2 pickle too.
2003-03-02 04:54:24 +00:00
Tim Peters 6cca754c20 TestOnlySetsInBinaryOps: Simplified the non-inplace tests by using
assertRaises.  Fixed a repeated subtle bug in the inplace tests by
removing the possibilty that a self.fail() call could raise a
TypeError that the test catches by mistake.
2003-03-02 00:36:10 +00:00
Tim Peters b7bfe4bea4 Typo repairs in new code. 2003-03-02 00:31:23 +00:00
Tim Peters 44f14b0399 SF bug 693121: Set == non-Set is a TypeError.
Allow mixed-type __eq__ and __ne__ for Set objects.  This is messier than
I'd like because Set *also* implements __cmp__.  I know of one glitch now:
cmp(s, t) returns 0 now when s and t are both Sets and s == t, despite
that Set.__cmp__ unconditionally raises TypeError (and by intent).  The
rub is that __eq__ gets tried first, and the x.__eq__(y) True result
convinces Python that cmp(x, y) is 0 without even calling Set.__cmp__.
2003-03-02 00:19:49 +00:00
Tim Peters 3ba491e6b1 The doctest was printing Sets, but that's unreliable because set
elements get displayed in undefined dict order.  Use a Set subclass
instead (which arranges to sort the elements for display).
2003-03-01 23:33:34 +00:00
Neal Norwitz f421e81e41 Fix comment, mode really is used 2003-03-01 22:58:00 +00:00
Neal Norwitz 4f959d2c73 Fix SF patch #695581, "returnself" -> "return self" 2003-03-01 15:22:41 +00:00
Guido van Rossum d6473d1ac5 Reindent the new code properly. 2003-03-01 03:25:41 +00:00
Guido van Rossum 46d3dc37e4 - New function sys.exc_clear() clears the current exception. This is
rarely needed, but can sometimes be useful to release objects
  referenced by the traceback held in sys.exc_info()[2].  (SF patch
  #693195.)  Thanks to Kevin Jacobs!
2003-03-01 03:20:41 +00:00
Andrew M. Kuchling e557f3556f [Patch #695090 from Bernhard Herzog] Allow specifying both py_modules and packages 2003-02-28 22:03:04 +00:00
Neal Norwitz 6156a2d07c Handle iconv initialization erorrs 2003-02-28 20:00:42 +00:00
Neal Norwitz 55b61d21d8 Fix SF bugs #692951 and 692988, test_timeout.py needs 'network' resource
require -u network to run test_timeout since
it fails when not connected to a network.
2003-02-28 19:57:03 +00:00