Commit Graph

7838 Commits

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