Commit Graph

6027 Commits

Author SHA1 Message Date
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
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
Raymond Hettinger
7fdfc2d231 Replace '== None' with 'is None' 2002-05-31 17:49:10 +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
Andrew M. Kuchling
8c20916de2 Remove unneeded import 2002-05-30 19:15:16 +00:00
Jeremy Hylton
40b7703f1c Verify that the imp can find and load .py files. 2002-05-30 17:10:20 +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
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
Neal Norwitz
72a2b4d43f Whitespace normalization 2002-05-29 00:54:38 +00:00
Guido van Rossum
1a7ac359a0 Importing Charset should not fail when Unicode is disabled. (XXX
Using Unicode-aware methods may still die with a NameError on unicode.
Maybe there's a more elegant solution but I doubt anybody cares.)
2002-05-28 18:49:03 +00:00
Christian Tismer
313a7513b0 This is a Python 2.1 and 2.2 bugfix candidate:
(or how do I "mark" something to be a candidate?)

fixed an old buglet that caused bdb to be unable to
continue in the botframe, after a breakpoint was set.
the key idea is not to set botframe to the bottom level frame,
but its f_back, which actually might be None.
Additional changes: migrated old exception trick to use
sys._getframe(), which exists both in 2.1 and 2.2 .

Note: I believe Mark Hammond needs to look over his code now.
F5 correctly starts up in the debugger, but later on doesn't stop at a given
breakpoint any longer.

kind regards - chris
2002-05-28 08:04:00 +00:00
Steven M. Gava
72de9c7a9c Geiger Ho's patch for better subclassing 2002-05-27 21:58:05 +00:00
Michael W. Hudson
34f20eac98 This is patch
[ 559250 ] more POSIX signal stuff

Adds support (and docs and tests and autoconfery) for posix signal
mask handling -- sigpending, sigprocmask and sigsuspend.
2002-05-27 15:08:24 +00:00
Chui Tey
5d2af63cc3 GvR's rpc patch 2002-05-26 13:36:41 +00:00
Guido van Rossum
9fc8a29663 Fix for SF bug 551412. When _PyType_Lookup() is called on a type
whose tp_mro hasn't been initialized, it would dump core.  Fix this by
checking for NULL and calling PyType_Ready().  Will fix this in 2.2.1
too.
2002-05-24 21:40:08 +00:00
Guido van Rossum
4b46c0a15f Don't require Unicode support. 2002-05-24 17:58:05 +00:00
Raymond Hettinger
ef4d4bdc3c Whitespace normalized. 2002-05-23 23:58:17 +00:00
Raymond Hettinger
c32f0336e0 Deprecated Random.cunifvariate clearing bug 506647. Also, added docstrings. 2002-05-23 19:44:49 +00:00
Tim Peters
8ac1495a6a Whitespace normalization. 2002-05-23 15:15:30 +00:00
Barry Warsaw
f655328483 parseaddr(): Fixed in the same way that Message.getaddrlist() was
fixed (re: SF bug #555035).  Include a unittest.
2002-05-23 03:21:01 +00:00
Skip Montanaro
12424bc0ef force gzip module to open files using 'b'inary mode.
closes patch #536278.
2002-05-23 01:43:05 +00:00
Neal Norwitz
d4e5be5340 Closes: #556025 seg fault when doing list(xrange(1e9))
A MemoryError is now raised when the list cannot be created.
There is a test, but as the comment says, it really only
works for 32 bit systems.  I don't know how to improve
the test for other systems (ie, 64 bit or systems
where the data size != addressable size,
e.g. 64 bit data, but 48 bit addressable memory)
2002-05-22 23:19:17 +00:00
Barry Warsaw
43193150ee Bump to version 2.0.4 2002-05-22 01:52:33 +00:00
Barry Warsaw
4be9eccbc4 getaddresses(): Like the change in rfc822.py, this one needs to access
the AddressList.addresslist attribute directly.

Also, add a test case for the email.Utils.getaddresses() interface.
2002-05-22 01:52:10 +00:00
Skip Montanaro
012ed5da5e add BooleanType 2002-05-21 23:17:12 +00:00
Guido van Rossum
5e355b244f In both spilldata() functions, pretend that the docstring for
non-callable objects is always None.  This makes for less confusing
output and fixes the problem reported in SF patch #550290.
2002-05-21 20:56:15 +00:00
Barry Warsaw
0a8d4d5736 Message.getaddrlist(): Use the AddressList.addresslist attribute
instead of calling the getaddrlist() method, since the latter doesn't
work with multiple calls (it will return the empty list for the second
and subsequent calls).

Closes SF bug #555035.  Include a unittest.
2002-05-21 19:46:13 +00:00
Raymond Hettinger
97394bc795 Patch 533291. Deprecate None return form of __reduce__. 2002-05-21 17:22:02 +00:00
Fred Drake
2513357c4b Munge the RCS keywords to avoid updates, so the version number matches that
of the PyUNIT version of the same file.  This helps people understand that
this version is the same as the version from the independent PyUNIT
release (confusion was indicated on the PyUNIT mailing list).
2002-05-21 03:49:00 +00:00
Michael W. Hudson
755f75eef8 Use types.StringTypes instead of explicit (str, unicode) list 2002-05-20 17:29:46 +00:00
Michael W. Hudson
7b7ba54033 Guess what? --disable-unicode proofing.
This is a strange test.
2002-05-20 14:54:17 +00:00
Michael W. Hudson
f207277167 More --disable-unicode stuff.
I'm getting better at vi!
2002-05-20 14:48:16 +00:00
Michael W. Hudson
3704644acb Use types.StringTypes instead of (types.StringType, types.UnicodeType) --
works better (at all!) in --disable-unicode builds.

Bugfix candidate, probably.
2002-05-20 14:30:06 +00:00
Michael W. Hudson
9c373061ad tolerate --disable-unicode... 2002-05-20 14:24:53 +00:00
Michael W. Hudson
7c6a4ad78f More mindless --disable-unicode proofing. 2002-05-20 14:22:28 +00:00
Michael W. Hudson
286225b548 easy --disable-unicode proofing. 2002-05-20 14:15:42 +00:00
Barry Warsaw
6d86f8302f A test message w/ CRLF line endings 2002-05-19 23:53:38 +00:00
Barry Warsaw
e0d85c834a Add two new tests of recent email package fixes: CRLF line endings,
and explicit maxlinelen arguments to the Header constructor.
2002-05-19 23:52:54 +00:00
Barry Warsaw
7e21b6792b I've thought about it some more, and I believe it is proper for the
email package's Parser to handle the three common line endings.
Certain protocols such as IMAP define CRLF line endings and it doesn't
make sense for the client app to have to normalize the line endings
before handing it message off to the Parser.

_parsebody(): Be more flexible in the matching of line endings for
finding the MIME separators.  Accept any of \r, \n and \r\n.  Note
that we do /not/ change the line endings in the payloads, we just
accept any of those three around MIME boundaries.
2002-05-19 23:51:50 +00:00
Barry Warsaw
812031b955 Fixed a bug in the splitting of lines, and improved the splitting for
single byte character sets.  Also fixed a semantic problem with the
constructor's default arguments.  Specifically,

__init__(): Change the maxlinelen argument default to None instead of
MAXLINELEN.  The semantics should have been (and now are) that if
maxlinelen is given it is always honored.  If it isn't given, but
header_name is given, then the maximum line length is calculated.  If
neither are given then the default 76 characters is used.

_split(): If the character set is a single byte character set then we
can split the line at the maxlinelen because we know that encoding the
header won't increase its length.  If the charset isn't a single byte
charset then we use the quicker divide-and-conquer line splitting
algorithm as before.
2002-05-19 23:47:53 +00:00
Barry Warsaw
8c1aac2476 Complete a merge of the mimelib project and the Python cvs codebases
for the email package.  The former is now just a shell project that
has some extra files for packaging for independent use (e.g. setup.py
and README).

Added a compatibility layer so that the same API can be used in Python
2.1 and 2.2/2.3 with the major differences shuffled off into helper
modules (_compat21.py and _compat22.py).

Also bumped the package version number to 2.0.3 for some fixes to be
checked in momentarily.
2002-05-19 23:44:19 +00:00