Guido van Rossum [Sat, 13 Jan 2001 22:06:05 +0000 (22:06 +0000)]
Neil discovered a bad DECREF on warnoptions, that caused repeated
re-initializing Python (Py_Finalize() followed by Py_Initialize()) to
blow up quickly. With the DECREF removed I can't get it to fail any
more. (Except it still leaks, but that's probably a separate issue.)
Guido van Rossum [Sat, 13 Jan 2001 16:55:33 +0000 (16:55 +0000)]
SF Patch #103225 by Ping: httplib: smallest Python patch ever
The ASCII-art diagram at the top of httplib contains a backslash at
the end of a line, which causes Python to remove the newline. This
one-character patch adds a space after the backslash so it will
appear at the end of the line in the docstring as intended.
Tim Peters [Sat, 13 Jan 2001 03:04:02 +0000 (03:04 +0000)]
Guido found a brand new race in tempfile on Linux, due to Linux changing
pid across threads (but in that case, it's still the same process, and so
still sharing the "template" cache in tempfile.py). Repaired that, and
added a new std test.
On Linux, someone please run that standalone with more files and/or more
threads; e.g.,
Jack Jansen [Fri, 12 Jan 2001 23:39:00 +0000 (23:39 +0000)]
SetpopupData and GetPopupData are gone under Carbon, use {Get,Set}PopupMenu{Handle,ID} in stead.
The UserPane routines appear to be fixed in the current Universal Headers, so they're re-enabled.
Guido van Rossum [Fri, 12 Jan 2001 16:24:03 +0000 (16:24 +0000)]
Two changes to from...import:
1) "from M import X" now works even if M is not a real module; it's
basically a getattr() operation with AttributeError exceptions
changed into ImportError.
2) "from M import *" now looks for M.__all__ to decide which names to
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
filters out names starting with '_' as before. Whether or not
__all__ exists, there's no restriction on the type of M.
Tim Peters [Fri, 12 Jan 2001 10:02:46 +0000 (10:02 +0000)]
A variant of SF patch 103028 (Make tempfile.mktemp threadsafe).
Tested on Windows. Should be tested on Linux. Should also be
tested on some platform without threads (I simulated that by
making the "import thread" fail, but that's not the same as
actually doing it!).
Thomas Wouters [Thu, 11 Jan 2001 14:46:40 +0000 (14:46 +0000)]
Move the _socket module closer to the SSL-_socket line (mmap and
xreadlines inserted themselves inbetween the two) and clarify that the
normal socket module should be commented out. (Someone also suggested the
latter on c.l.py some time ago, I forget who, sorry.)
Guido van Rossum [Wed, 10 Jan 2001 21:17:27 +0000 (21:17 +0000)]
Oops, one more part of the cygwin patch (SF patch #102409 by jlt63:
Cygwin Python DLL and Shared Extension Patch). Add module.dll as a
valid extension.
jlt63 writes: Note that his change essentially backs out the fix for
bug #115973. Should ".pyd" be retained instead for posterity?
Guido van Rossum [Wed, 10 Jan 2001 19:14:28 +0000 (19:14 +0000)]
Adapted version of SF Patch #103173 by pyretic: make uu.decode work
with spaces in filename.
I changed the module to use string methods instead of the string
module. Also, instead of stripping the last character of the filename
(assuming this is the linefeed), I strip trailing whitespace (assuming
creating files with trailing whitespace in their name cannot possibly
be a wise idea).
(Note that I believe that /F's "workaround for broken uuencoders" is
no longer needed since the recent fix to binascii.c, but I'll leave it
in since it appears pretty harmless.)
Tim Peters [Wed, 10 Jan 2001 05:42:18 +0000 (05:42 +0000)]
Windows mmap should (as the docs probably <wink> say) create a mapping
without a name when the optional tagname arg isn't specified. Was
actually creating a mapping with an empty string as the name.
Tim Peters [Tue, 9 Jan 2001 23:26:39 +0000 (23:26 +0000)]
Assorted xreadlines problems:
Wasn't built on Windows; not in config.c either.
Module init function missing DL_EXPORT magic.
test_xreadline output file obviously wrong (started w/ "test_xrl").
test program very unclear about what was expected.
Jack Jansen [Tue, 9 Jan 2001 22:22:58 +0000 (22:22 +0000)]
Carbon defines {Get,Set}ControlDataHandle, so unfortunately our variants on {Get,Set}ControlData have gotten an underscore: GetControlData_Handle, etc.
Jack Jansen [Tue, 9 Jan 2001 22:10:16 +0000 (22:10 +0000)]
Carbon defines {Get,Set}ControlDataHandle, so unfortunately our variants on {Get,Set}ControlData have gotten an underscore: GetControlData_Handle, etc. This is an incompatible change:-(
Fred Drake [Tue, 9 Jan 2001 22:02:10 +0000 (22:02 +0000)]
Added a --global-module-index option to specify a (possibly relative) URL
to the Global Module Index for a set of documents. This is used to include
a reference to the global index from the per-document module indexes, so
that it is just a little easier to find.
(Someone suggested this, but I do not remember who. Please let me know if
it was you -- thanks!)
Patch #102953: Fix bug #125452, where shlex.shlex hangs when it
encounters a string with an unmatched quote, by adding a check for
EOF in the 'quotes' state.
Anonymous SF bug report #128053 point out that the #ifdef for
including "tmpfile" in the posix_methods[] array is wrong -- should be
HAVE_TMPFILE, not HAVE_TMPNAM.
Tim discovered another "bug" in my get_line() code: while the comments
said that n<0 was invalid, it was in fact still called with n<0 (when
PyFile_GetLine() was called with n<0). In that case fortunately
executed the same code as for n==0.
Changed the comment to admit this fact, and changed Tim's MS speed
hack code to use 'n <= 0' as the criteria for the speed hack.
Tim Peters [Mon, 8 Jan 2001 00:53:12 +0000 (00:53 +0000)]
Fiddled ms_getline_hack after talking w/ Guido: made clearer that the
code duplication is to let us get away without a realloc whenever possible;
boosted the init buf size (the cutoff at which we *can* get away without
a realloc) from 100 to 200 so that more files can enjoy this boost; and
allowed other threads to run in all cases. The last two cost something,
but not significantly: in my fat test case, less than a 1% slowdown total.
Since my test case has a great many short lines, that's probably the worst
slowdown, too. While the logic barely changed, there were lots of edits.
This also gets rid of the reference to fp->_cnt, so the last platform
assumption being made here is that fgets doesn't overwrite bytes
capriciously (== beyond the terminating null byte it must write).
Tim Peters [Sun, 7 Jan 2001 21:19:34 +0000 (21:19 +0000)]
MS Win32 .readline() speedup, as discussed on Python-Dev. This is a tricky
variant that never needs to "search from the right".
Also fixed unlikely memory leak in get_line, if string size overflows INTMAX.
Also new std test test_bufio to make sure .readline() works.
Tim noticed that I had botched get_line_raw(). Looking again, I
realized that this behavior is already present in PyFile_GetLine(),
which is the only place that needs it. A little refactoring of that
function made get_line_raw() redundant.
Fred Drake [Sun, 7 Jan 2001 06:02:19 +0000 (06:02 +0000)]
Add more regression tests, including for the import statement variations.
These will detect regression on SF bug #127271 and other import statement
bugs.
This patch adds a new feature to the builtin charmap codec:
the mapping dictionaries can now contain 1-n mappings, meaning
that character ordinals may be mapped to strings or Unicode object,
e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by
the complete string or Unicode object instead of just one character.
Another feature introduced by the patch is that of mapping oridnals to
the emtpy string. This allows removing characters.
The patch is different from patch #103100 in that it does not cause a
performance hit for the normal use case of 1-1 mappings.
Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.
This patch adds a new feature to the builtin charmap codec:
The mapping dictionaries can now contain 1-n mappings, meaning
that character ordinals may be mapped to strings or Unicode object,
e.g. 0x0078 ('x') -> u"abc", causing the ordinal to be replaced by
the complete string or Unicode object instead of just one character.
Another feature introduced by the patch is that of mapping oridnals to
the emtpy string. This allows removing characters.
The patch is different from patch #103100 in that it does not cause a
performance hit for the normal use case of 1-1 mappings.
Written by Marc-Andre Lemburg, copyright assigned to Guido van Rossum.