Commit Graph

26585 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
Skip Montanaro 959c7727f4 Add a little more verbiage about the bsddb module/package change. It's
clear from recent discussions on c.l.py that people are a bit confused about
the differences between the old bsddb, the new bssdb, the bsddb3/PyBSDDB
package and changes to file formats.  Tried to clarify the issues.
2003-03-07 15:45:15 +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 45f5c4ab3e Removed unused variable 2003-03-07 15:37:31 +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
Jack Jansen 1d0c6cfd9f Got PythonStandalone to work again, mainly for debugging purposes (it's much easier to debug GUSI errors in a static build). 2003-03-07 15:36:13 +00:00
Barry Warsaw 82783e6f33 test_string_headerinst_eq(): Another Jason test :) 2003-03-07 15:35:47 +00:00
Guido van Rossum e5c691abe3 - The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
  exported from object.h as PyHeapTypeObject.  (SF patch #696193.)
2003-03-07 15:13:17 +00:00
Fred Drake 9e1595e6e4 Minor clarification about the ob_size field. 2003-03-07 15:02:03 +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
Skip Montanaro ea7598e6f4 fix name of db2pickle 2003-03-07 00:47:40 +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
Jack Jansen fa1bf1c518 First try to use the OSATerminology module to get the terminology
resources before reverting to manually reading the resources.

Unfortunately there is still a bug in here somewhere: it doesn't work
for all applications.
2003-03-06 23:04:38 +00:00
Jack Jansen 7a251db9e6 Build the OSATerminology module on MacOSX. 2003-03-06 23:03:43 +00:00
Jack Jansen ee1c85c8eb Various tweaks by Jack because of the different module name, adaptation
to the Python style, etc.
2003-03-06 23:02:59 +00:00
Jack Jansen 86f25fb1d2 Module to get OSA terminology description through the "official channels",
in stead of manually getting the AETE/AEUT resource. Donated by Donovan
Preston. This is his original code (but with the filename changed) checked
in for reference only.
2003-03-06 23:02:04 +00:00
Neal Norwitz 1930949a8a Fix SF bug #697256, PyMarshal_WriteShortToFile() documented, but not implemented
Remove prototype and doc.  Backport candidate.
2003-03-06 22:04:24 +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
Sjoerd Mullender 259d3d5784 Removed superfluous \r. 2003-03-06 12:53:07 +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 1a2c37316b Describe Charset.__repr__(). 2003-03-06 06:07:34 +00:00
Barry Warsaw f32e313914 Describe the new Header.encode() argument "splitchars". 2003-03-06 06:06:54 +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 9589a25220 Mention timeit.py. 2003-03-06 01:56:12 +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