Commit Graph

22589 Commits

Author SHA1 Message Date
Barry Warsaw 2f514a806d These two classes provide bases for more specific content type
subclasses.

MIMENonMultipart: Base class for non-multipart/* content type subclass
specializations, e.g. image/gif.  This class overrides attach() which
raises an exception, since it makes no sense to attach a subpart to
e.g. an image/gif message.

MIMEMultipart: Base class for multipart/* content type subclass
specializations, e.g. multipart/mixed.  Does little more than provide
a useful constructor.
2002-06-01 05:59:12 +00:00
Barry Warsaw 1c30aa2292 The _compat modules now export _floordiv() instead of _intdiv2() for
better code reuse.

_split() Use _floordiv().
2002-06-01 05:49:17 +00:00
Barry Warsaw c5d1c045ab Slightly better docstring 2002-06-01 05:45:37 +00:00
Tim Peters 93b2cc4e97 A bogus assert in the new listiter code prevented starting Python in a
debug build.  Repaired that, and rewrote other parts to reduce
long-winded casting.
2002-06-01 05:22:55 +00:00
Barry Warsaw bb98c8cff0 _is_unicode(): Use UnicodeType instead of the unicode builtin for
Python 2.1 compatibility.
2002-06-01 03:56:07 +00:00
Raymond Hettinger 936654bce0 Replaced boolean test with is None 2002-06-01 03:06:31 +00:00
Raymond Hettinger 094662a165 Replace boolean test with is None 2002-06-01 01:29:16 +00:00
Raymond Hettinger 0f4940c0a8 Replaced boolean test with 'is None' 2002-06-01 00:57:55 +00:00
Raymond Hettinger 8989ea6ce1 Use is None rather than general boolean 2002-06-01 00:06:20 +00:00
Raymond Hettinger a144900b86 Use is None rather than general boolean 2002-05-31 23:54:44 +00:00
Raymond Hettinger c0418609eb Use is None rather than general boolean 2002-05-31 23:03:33 +00:00
Neal Norwitz 3e12905e03 Remove unused static function 2002-05-31 21:47:02 +00:00
Raymond Hettinger 14bd6de0ec SF 560736. Optimize list iteration by filling the tp_iter slot. 2002-05-31 21:40:38 +00:00
Guido van Rossum 59b2a74c75 SF bug 533625 (Armin Rigo). rexec: potential security hole
If a rexec instance allows writing in the current directory (a common
thing to do), there's a way to execute bogus bytecode.  Fix this by
not allowing imports from .pyc files (in a way that allows a site to
configure things so that .pyc files *are* allowed, if writing is not
allowed).

I'll apply this to 2.2 and 2.1 too.
2002-05-31 21:12:53 +00:00
Guido van Rossum 9788384d02 Explain that tp_basicsize must provide alignment for the items. 2002-05-31 21:00:18 +00:00
Neal Norwitz ebb4190709 Use string methods, remove import string 2002-05-31 20:51:31 +00:00
Neal Norwitz ab19962290 Use more string methods, remove import string 2002-05-31 20:46:39 +00:00
Neal Norwitz 3f8dae73c7 Fix typo 2002-05-31 20:23:33 +00:00
Guido van Rossum a407300cd7 Implement the intention of SF patch 472523 (but coded differently).
In the past, an object's tp_compare could return any value.  In 2.2
the docs were tightened to require it to return -1, 0 or 1; and -1 for
an error.

We now issue a warning if the value is not in this range.  When an
exception is raised, we allow -1 or -2 as return value, since -2 will
the recommended return value for errors in the future.  (Eventually
tp_compare will also be allowed to return +2, to indicate
NotImplemented; but that can only be implemented once we know all
extensions return a value in [-2...1].  Or perhaps it will require the
type to set a flag bit.)

I haven't decided yet whether to backport this to 2.2.x.  The patch
applies fine.  But is it fair to start warning in 2.2.2 about code
that worked flawlessly in 2.2.1?
2002-05-31 20:03:54 +00:00
Neal Norwitz 32a7e7f6b6 Change name from string to basestring 2002-05-31 19:58:02 +00:00
Fred Drake 9b414ac93e Update links and information on PyQt/PyKDE. 2002-05-31 18:21:56 +00:00
Raymond Hettinger 7fdfc2d231 Replace '== None' with 'is None' 2002-05-31 17:49:10 +00:00
Guido van Rossum 79e39bd4d0 Add definition of Py_IgnoreEnvironmentFlag (needed at least in debug
mode).
2002-05-31 14:32:07 +00:00
Neal Norwitz 7616504dcf Fix printing plural (s or ""). 2002-05-31 14:15:11 +00:00
Neal Norwitz 5aee504ccb Remove import of re, it is not used 2002-05-31 14:14:06 +00:00
Neal Norwitz 7ce734cd72 Use string methods where possible, and remove import string 2002-05-31 14:13:04 +00:00
Jeremy Hylton 05ab2e693c Fix SF bug [ 561825 ] Confusing error for "del f()"
In the error message, say del for del and assign for everything else.
2002-05-31 14:08:29 +00:00
Neal Norwitz 5352d8c0c6 Py_IgnoreEnvironmentFlag should be extern, since it is declared in pythonrun.c 2002-05-31 13:11:40 +00:00
Andrew M. Kuchling 8c20916de2 Remove unneeded import 2002-05-30 19:15:16 +00:00
Guido van Rossum 5e2c5fa1bd imp_load_module(): correct and comment the sense of the test for '+'
in the mode (it's forbidden).
2002-05-30 17:33:07 +00:00
Jeremy Hylton 4ae6faed9f Cover a few corners in the 'U' mode integration to make imp work.
get_file() must convert 'U' to "r" PY_STDIOTEXTMODE before calling
fopen().

imp_load_module() must accept 'r' or 'U' or something with '+'.

Also reflow some long lines.
2002-05-30 17:15:25 +00:00
Jeremy Hylton 40b7703f1c Verify that the imp can find and load .py files. 2002-05-30 17:10:20 +00:00
Fred Drake 1e9abf0efd Typo fixes. 2002-05-30 16:41:14 +00:00
Michael W. Hudson e4df27f084 Add the pymemcompat.h header as discussed on python-dev.
Now we just need to make sure people know about it...
2002-05-30 16:22:29 +00:00
Guido van Rossum 5c16468ada Holger Krekel. 2002-05-30 15:42:58 +00:00
Guido van Rossum 84271bb34f SF #558432: Prevent Annoying ' ' from readline (Holker Krekel).
readline in all python versions is configured
    to append a 'space' character for a successful
    completion. But for almost all python expressions
    'space' is not wanted (see coding conventions PEP 8).
    For example if you have a function 'longfunction'
    and you type 'longf<TAB>' you get 'longfunction '
    as a completion. note the unwanted space at the
    end.

    The patch fixes this behaviour by setting readline's
    append_character to '\0' which means don't append
    anything. This doesn't work with readline < 2.1
    (AFAIK nowadays readline2.2 is in good use).

    An alternative approach would be to make the
    append_character
    accessable from python so that modules like
    the rlcompleter.py can set it to '\0'.

[Ed.: I think expecting readline >= 2.2 is fine.  If a completer wants
another character they can append that to the keyword in the list.]
2002-05-30 15:41:56 +00:00
Neal Norwitz efbb67b1a7 Remove comment about inheritance, look one line up 2002-05-30 12:12:04 +00:00
Raymond Hettinger 1dbe6c0728 Move statement out of comment block 2002-05-30 00:06:01 +00:00
Guido van Rossum ca948b40b4 Use floor division where appropriate. 2002-05-29 20:38:21 +00:00
Fred Drake 127ee1607f Minor cleanup:
- Add comment explaining the structure of the stack.
- Minor optimization: make stack tuple directly usable as part of return
  value for enter/exit events.
2002-05-29 19:40:36 +00:00
Andrew M. Kuchling 187b1d8260 Add OS/2 text 2002-05-29 19:20:57 +00:00
Neil Schemenauer 8b6b491ed7 The logreader object did not always refill the input buffer correctly
and got confused by certain log files.  Remove logreader_refill and the
associated logic and replace with fgetc.
2002-05-29 18:19:14 +00:00
Andrew M. Kuchling d7abe2a0fb Various minor rewrites 2002-05-29 17:33:48 +00:00
Andrew M. Kuchling 72b58e0c5f More additions 2002-05-29 17:30:34 +00:00
Raymond Hettinger aef22fb9cd Patch 560023 adding docstrings. 2.2 Candidate (after verifying modules were not updated after 2.2). 2002-05-29 16:18:42 +00:00
Neal Norwitz d68f5171eb As discussed on python-dev, add a mechanism to indicate features
that are in the process of deprecation (PendingDeprecationWarning).
Docs could be improved.
2002-05-29 15:54:55 +00:00
Guido van Rossum e85ee8d815 Issue an explicit error when we can't find an appropriate type for
UINT4.
2002-05-29 14:00:22 +00:00
Marc-André Lemburg 4164439240 Fix a possible segfault. Found be Neal Norvitz. 2002-05-29 13:46:29 +00:00
Marc-André Lemburg 4da6fd63bc Fix for bug [ 561796 ] string.find causes lazy error 2002-05-29 11:33:13 +00:00
Michael W. Hudson 1e1542fcff This is patch
[ 558914 ] Build md5.c fails on Cray T3E

I've also deleted a comment that I didn't understand.  Feel free to
put it back if it makes/made sense to you.
2002-05-29 10:32:24 +00:00