]> granicus.if.org Git - python/log
python
22 years agoNew entries to track the DOM API growth. These match names exposed in
Fred Drake [Fri, 9 Aug 2002 14:57:55 +0000 (14:57 +0000)]
New entries to track the DOM API growth.  These match names exposed in
PyXML 0.8.

22 years agoWhen installing the "python" link in bindir also test for a pre-existing
Jack Jansen [Fri, 9 Aug 2002 14:42:57 +0000 (14:42 +0000)]
When installing the "python" link in bindir also test for a pre-existing
symlink and remove it.

22 years ago- Precompile py files in Mac subtree after installing
Jack Jansen [Fri, 9 Aug 2002 14:15:46 +0000 (14:15 +0000)]
- Precompile py files in Mac subtree after installing
- Pre-cache .rsrc files in Mac subtree after installing
- Fixed nameclash in Make variables

22 years ago- Check not only that cache file exists, but also that it is newer than
Jack Jansen [Fri, 9 Aug 2002 13:44:03 +0000 (13:44 +0000)]
- Check not only that cache file exists, but also that it is newer than
  the applesingle file.
- Added optional verbose option for cachersrc tool.

22 years agoTool to pre-created cached .rsrc.df.rsrc files in the Lib directories,
Jack Jansen [Fri, 9 Aug 2002 13:42:55 +0000 (13:42 +0000)]
Tool to pre-created cached .rsrc.df.rsrc files in the Lib directories,
similar to compileall.py.

22 years agoDocument that -u puts stdin, stdout, and stderr in binary mode.
Sjoerd Mullender [Fri, 9 Aug 2002 13:37:31 +0000 (13:37 +0000)]
Document that -u puts stdin, stdout, and stderr in binary mode.

22 years agoOn Cygwin, put stdin, stderr, and stdout in binary mode when the -u
Sjoerd Mullender [Fri, 9 Aug 2002 13:35:18 +0000 (13:35 +0000)]
On Cygwin, put stdin, stderr, and stdout in binary mode when the -u
flag is given (to mimic native Windows).

22 years agoObsolete now that there's a python implementation of strptime in the
Jack Jansen [Fri, 9 Aug 2002 10:22:11 +0000 (10:22 +0000)]
Obsolete now that there's a python implementation of strptime in the
standard lib.

22 years agoPatch by Russel Owen: if we have command line arguments zap pyc files
Jack Jansen [Fri, 9 Aug 2002 10:17:28 +0000 (10:17 +0000)]
Patch by Russel Owen: if we have command line arguments zap pyc files
in the directories given.

22 years agoFix to ensure consistent 'repr' and 'str' results between Python
Steve Purcell [Fri, 9 Aug 2002 09:46:23 +0000 (09:46 +0000)]
Fix to ensure consistent 'repr' and 'str' results between Python
versions, since 'repr(new_style_class) != repr(classic_class)'.
Suggested by Jeremy Hylton.

22 years agoDepracated some non-carbon modules.
Jack Jansen [Fri, 9 Aug 2002 09:03:31 +0000 (09:03 +0000)]
Depracated some non-carbon modules.

22 years agoThis file should have gone long ago.
Jack Jansen [Fri, 9 Aug 2002 09:02:01 +0000 (09:02 +0000)]
This file should have gone long ago.

22 years agoRepaired a braino in the description of bad minrun values.
Tim Peters [Fri, 9 Aug 2002 05:06:44 +0000 (05:06 +0000)]
Repaired a braino in the description of bad minrun values.

22 years agoSF bug #592645 fix memory leak in socket.getaddrinfo
Neal Norwitz [Fri, 9 Aug 2002 03:37:42 +0000 (03:37 +0000)]
SF bug #592645 fix memory leak in socket.getaddrinfo

22 years agoUpdate the text on the Expat module and library.
Fred Drake [Fri, 9 Aug 2002 02:39:13 +0000 (02:39 +0000)]
Update the text on the Expat module and library.

22 years agoMajor speedup for new-style class creation. Turns out there was some
Guido van Rossum [Fri, 9 Aug 2002 02:14:34 +0000 (02:14 +0000)]
Major speedup for new-style class creation.  Turns out there was some
trampolining going on with the tp_new descriptor, where the inherited
PyType_GenericNew was overwritten with the much slower slot_tp_new
which would end up calling tp_new_wrapper which would eventually call
PyType_GenericNew.  Add a special case for this to update_one_slot().

XXX Hope there isn't a loophole in this.  I'll buy the first person to
point out a bug in the reasoning a beer.

Backport candidate (but I won't do it).

22 years agoMoved inplace add and multiply methods from UserString to MutableString.
Raymond Hettinger [Fri, 9 Aug 2002 01:37:06 +0000 (01:37 +0000)]
Moved inplace add and multiply methods from UserString to MutableString.
Closes SF Bug #592573 where inplace add mutated a UserString.
Added unittests to verify the bug is cleared.

22 years agoMoved special case for tuples from iterobject.c to
Raymond Hettinger [Fri, 9 Aug 2002 01:30:17 +0000 (01:30 +0000)]
Moved special case for tuples from iterobject.c to
tupleobject.c. Makes the code in iterobject.c cleaner
and speeds-up the general case by not checking for
tuples everytime.   SF Patch #592065.

22 years agoRevised the test suite for 'contains' to use the test() function argument
Raymond Hettinger [Fri, 9 Aug 2002 00:43:38 +0000 (00:43 +0000)]
Revised the test suite for 'contains' to use the test() function argument
rather than vereq().  While it was effectively testing regular strings, it
ignored the test() function argument when called by test_userstring.py.

22 years agoBy popular demand the frameworkinstall target now installs everything:
Jack Jansen [Fri, 9 Aug 2002 00:18:21 +0000 (00:18 +0000)]
By popular demand the frameworkinstall target now installs everything:
the framework, the MacOSX apps and the unix tools.
Most of the hard work is done by Mac/OSX/Makefile.

Also, it should now be possible to install in a different directory,
such as /tmp/dist/Library/Frameworks, for building binary installers.
The fink crowd wanted this.

22 years agoSignificant speedup in new-style object creation: in slot_tp_new(),
Guido van Rossum [Thu, 8 Aug 2002 21:57:53 +0000 (21:57 +0000)]
Significant speedup in new-style object creation: in slot_tp_new(),
intern the string "__new__" so we can call PyObject_GetAttr() rather
than PyObject_GetAttrString().  (Though it's a mystery why slot_tp_new
is being called when a class doesn't define __new__.  I'll look into
that tomorrow.)

2.2 backport candidate (but I won't do it).

22 years agoUse hex escape for non-ascii chars, now that the parser wants that.
Jack Jansen [Thu, 8 Aug 2002 21:16:56 +0000 (21:16 +0000)]
Use hex escape for non-ascii chars, now that the parser wants that.
Good thing, too: some of the characters had been mangled by OS9->CVS->OSX
roundtrips.

22 years agoA modest speedup of object deallocation. call_finalizer() did rather
Guido van Rossum [Thu, 8 Aug 2002 20:55:20 +0000 (20:55 +0000)]
A modest speedup of object deallocation.  call_finalizer() did rather
a lot of work: it had to save and restore the current exception around
a call to lookup_maybe(), because that could fail in rare cases, and
most objects don't have a __del__ method, so the whole exercise was
usually a waste of time.  Changed this to cache the __del__ method in
the type object just like all other special methods, in a new slot
tp_del.  So now subtype_dealloc() can test whether tp_del is NULL and
skip the whole exercise if it is.  The new slot doesn't need a new
flag bit: subtype_dealloc() is only called if the type was dynamically
allocated by type_new(), so it's guaranteed to have all current slots.
Types defined in C cannot fill in tp_del with a function of their own,
so there's no corresponding "wrapper".  (That functionality is already
available through tp_dealloc.)

22 years agoThe other half of the patches added to SF patch 555085 by A I
Guido van Rossum [Thu, 8 Aug 2002 20:39:30 +0000 (20:39 +0000)]
The other half of the patches added to SF patch 555085 by A I
MacIntyre.  At least on OS/2, a subsequent connect() on a nonblocking
socket returns errno==EISCONN to indicate success.  This seems
harmless on Unix.

22 years agoClean up some docstrings. Some docstrings didn't show their return
Guido van Rossum [Thu, 8 Aug 2002 20:37:08 +0000 (20:37 +0000)]
Clean up some docstrings.  Some docstrings didn't show their return
value; others were inconsistent in what to name the argument or return
value; a few module-global functions had "socket." in front of their
name, against convention.

22 years agotestSendAll(): loop until all data is read; this was necessary at
Guido van Rossum [Thu, 8 Aug 2002 20:28:34 +0000 (20:28 +0000)]
testSendAll(): loop until all data is read; this was necessary at
least on OS/2 (see note on SF patch 555085 by A I MacIntyre) but
looks like the test *could* fail on any other platform too -- there's
no guarantee that recv() reads all data.

22 years agoWhitespace normalization.
Tim Peters [Thu, 8 Aug 2002 20:19:19 +0000 (20:19 +0000)]
Whitespace normalization.

22 years agoDelete junk attributes left behind by _socketobject class construction.
Tim Peters [Thu, 8 Aug 2002 20:07:03 +0000 (20:07 +0000)]
Delete junk attributes left behind by _socketobject class construction.

22 years agoPatch #588561: Cygwin _hotshot patch
Jason Tishler [Thu, 8 Aug 2002 19:46:15 +0000 (19:46 +0000)]
Patch #588561: Cygwin _hotshot patch

YA Cygwin module patch very similar to other patches
that I have submitted.  I tested under Cygwin and Red
Hat Linux 7.1.

22 years agoThe _socketobject class has no need for a __del__ method: all it did was
Guido van Rossum [Thu, 8 Aug 2002 18:11:36 +0000 (18:11 +0000)]
The _socketobject class has no need for a __del__ method: all it did was
to delete the reference to self._sock, and the regular destructor will
do that just fine.  This made some hacks in close() unnecessary.

The _fileobject class still has a __del__ method, because it must flush.

22 years agoOK, one more hack: speed up the case of readline() in unbuffered mode.
Guido van Rossum [Thu, 8 Aug 2002 17:34:19 +0000 (17:34 +0000)]
OK, one more hack: speed up the case of readline() in unbuffered mode.
This is important IMO because httplib reads the headers this way.

22 years agoAnother refactoring of read() and readline(), this time based on the
Guido van Rossum [Thu, 8 Aug 2002 17:16:09 +0000 (17:16 +0000)]
Another refactoring of read() and readline(), this time based on the
observation that _rbuf could never have more than one string in it.
So make _rbuf a string.  The code branches for size<0 and size>=0
are completely separate now, both in read() and in readline().

I checked for tabs this time. :-)

22 years agoExtend __all__ with the exports list of the _ssl module.
Guido van Rossum [Thu, 8 Aug 2002 15:25:28 +0000 (15:25 +0000)]
Extend __all__ with the exports list of the _ssl module.

22 years agoOops, stupid tabs. Sorry again.
Guido van Rossum [Thu, 8 Aug 2002 15:22:12 +0000 (15:22 +0000)]
Oops, stupid tabs.  Sorry again.

22 years agoAnother refactoring. Changed 'socket' from being a factory function
Guido van Rossum [Thu, 8 Aug 2002 15:16:20 +0000 (15:16 +0000)]
Another refactoring.  Changed 'socket' from being a factory function
to being a new-style class, to be more similar to the socket class
in the _socket module; it is now the same as the _socketobject class.
Added __slots__.  Added docstrings, copied from the real socket class
where possible.

The _fileobject class is now also a new-style class with __slots__
(though without docstrings).  The mode, name, softspace, bufsize and
closed attributes are properly supported (closed as a property; name
as a class attributes; the softspace, mode and bufsize as slots).

22 years agoAdd module-wide "__metaclass__ = type", as requested by Jim Fulton.
Steve Purcell [Thu, 8 Aug 2002 13:38:02 +0000 (13:38 +0000)]
Add module-wide "__metaclass__ = type", as requested by Jim Fulton.
(Synched from pyunit CVS)

22 years agoAdded info about highwater heap-memory use for the sortperf.py tests; + a
Tim Peters [Thu, 8 Aug 2002 01:55:16 +0000 (01:55 +0000)]
Added info about highwater heap-memory use for the sortperf.py tests; + a
couple of minor edits elsewhere.

22 years agoPyList_Reverse(): This was leaking a reference to Py_None on every call.
Tim Peters [Thu, 8 Aug 2002 01:06:39 +0000 (01:06 +0000)]
PyList_Reverse():  This was leaking a reference to Py_None on every call.
I believe I introduced this bug when I refactored the reversal code so
that the mergesort could use it too.  It's not a problem on the 2.2 branch.

22 years agoMajor restructuring of _fileobject. Hopefully several things now work
Guido van Rossum [Thu, 8 Aug 2002 01:02:16 +0000 (01:02 +0000)]
Major restructuring of _fileobject.  Hopefully several things now work
correctly (the test at least succeed, but they don't test everything yet).

Also fix a performance problem in read(-1): in unbuffered mode, this would
read 1 byte at a time.  Since we're reading until EOF, that doesn't make
sense.  Use the default buffer size if _rbufsize is <= 1.

22 years agoReplace docstrings on test functions witrh comments -- then unittest
Guido van Rossum [Thu, 8 Aug 2002 01:00:28 +0000 (01:00 +0000)]
Replace docstrings on test functions witrh comments -- then unittest
prints function and module names, which is more informative now that
we repeat some tests in slightly modified subclasses.

Add a test for read() until EOF.

Add test suites for line-buffered (bufsize==1) and a small custom
buffer size (bufsize==2).

Restructure testUnbufferedRead() somewhat to avoid a potentially
infinite loop.

22 years agoAdded info about the right way to leave the body of a trashcan-protected
Tim Peters [Wed, 7 Aug 2002 20:53:05 +0000 (20:53 +0000)]
Added info about the right way to leave the body of a trashcan-protected
destructor early.

22 years agoFix a subtle bug in the trashcan code I added yesterday to
Guido van Rossum [Wed, 7 Aug 2002 20:42:09 +0000 (20:42 +0000)]
Fix a subtle bug in the trashcan code I added yesterday to
subtype_dealloc().

When call_finalizer() failed, it would return without going through
the trashcan end macro, thereby unbalancing the trashcan nesting level
counter, and thereby defeating the test case (slottrash() in
test_descr.py).  This in turn meant that the assert in the GC_UNTRACK
macro wasn't triggered by the slottrash() test despite a bug in the
code: _PyTrash_destroy_chain() calls the dealloc routine with an
object that's untracked, and the assert in the GC_UNTRACK macro would
fail on this; but because of an earlier test that resurrects an
object, causing call_finalizer() to fail and the trashcan nesting
level to be unbalanced, so _PyTrash_destroy_chain() was never called.
Calling the slottrash() test in isolation *did* trigger the assert,
however.

So the fix is twofold: (1) call the GC_UnTrack() function instead of
the GC_UNTRACK macro, because the function is safe when the object is
already untracked; (2) when call_finalizer() fails, jump to a label
that exits through the trashcan end macro, keeping the trashcan
nesting balanced.

22 years agoGvR pointed out that only enclosing function bodies are part of nested scopes.
Raymond Hettinger [Wed, 7 Aug 2002 20:20:52 +0000 (20:20 +0000)]
GvR pointed out that only enclosing function bodies are part of nested scopes.

22 years agoAdd -E and -tt options to the python invocations, as for the Unix tests.
Guido van Rossum [Wed, 7 Aug 2002 19:06:27 +0000 (19:06 +0000)]
Add -E and -tt options to the python invocations, as for the Unix tests.
The -tt means modules that mix tabs and spaces will be rejected.
The -E refuses to believe Python options in the environment.

22 years agoReplace tabs with spaces. (Sorry!)
Guido van Rossum [Wed, 7 Aug 2002 19:03:35 +0000 (19:03 +0000)]
Replace tabs with spaces.  (Sorry!)

22 years agoTighten the unbuffered readline test to distinguish between the two lines.
Guido van Rossum [Wed, 7 Aug 2002 19:02:49 +0000 (19:02 +0000)]
Tighten the unbuffered readline test to distinguish between the two lines.

22 years agoSimplify heapreplace() -- there's no need for an explicit test for
Guido van Rossum [Wed, 7 Aug 2002 18:58:11 +0000 (18:58 +0000)]
Simplify heapreplace() -- there's no need for an explicit test for
empty heap, since heap[0] raises the appropriate IndexError already.

22 years agoDocument that heappop() and heapreplace() raise IndexError if the heap
Guido van Rossum [Wed, 7 Aug 2002 18:56:08 +0000 (18:56 +0000)]
Document that heappop() and heapreplace() raise IndexError if the heap
is empty.

22 years agoApply character{} markup.
Raymond Hettinger [Wed, 7 Aug 2002 16:53:17 +0000 (16:53 +0000)]
Apply character{} markup.

22 years agoReplace abort with Py_FatalError.
Martin v. Löwis [Wed, 7 Aug 2002 16:21:51 +0000 (16:21 +0000)]
Replace abort with Py_FatalError.

22 years agoDescribed responsibilty of weakly referenced extension types to initialize
Raymond Hettinger [Wed, 7 Aug 2002 16:18:54 +0000 (16:18 +0000)]
Described responsibilty of weakly referenced extension types to initialize
the weakreflist to NULL in the constructor and to fill the tp_flags
slot with Py_TPFLAGS_HAVE_WEAKREFS.  Closes SF bug 586583.

22 years agoDescribe nested scopes in the tutorial. Closes SF bug 500704.
Raymond Hettinger [Wed, 7 Aug 2002 16:09:48 +0000 (16:09 +0000)]
Describe nested scopes in the tutorial.  Closes SF bug 500704.

22 years agoOops. I accidentally commented out some tests.
Guido van Rossum [Wed, 7 Aug 2002 16:03:06 +0000 (16:03 +0000)]
Oops.  I accidentally commented out some tests.

22 years agoRegenerated with OSA class inheritance and fix for non-ascii chars.
Jack Jansen [Wed, 7 Aug 2002 15:53:42 +0000 (15:53 +0000)]
Regenerated with OSA class inheritance and fix for non-ascii chars.

22 years agoFixed incorrect logic in determining whether we should initialize
Jack Jansen [Wed, 7 Aug 2002 15:52:44 +0000 (15:52 +0000)]
Fixed incorrect  logic in determining whether we should initialize
the classes' attribute list.

22 years agoDocumented os.fsync and os.fdatasync. Closes SF bug 584695.
Raymond Hettinger [Wed, 7 Aug 2002 15:48:17 +0000 (15:48 +0000)]
Documented os.fsync and os.fdatasync.  Closes SF bug 584695.

22 years ago"Unbuffered" mode of class _fileobject wasn't actually unbuffered,
Guido van Rossum [Wed, 7 Aug 2002 15:46:19 +0000 (15:46 +0000)]
"Unbuffered" mode of class _fileobject wasn't actually unbuffered,
and this broke a Zope "pipelining" test which read multiple responses
from the same connection (this attaches a new file object to the
socket for each response).  Added a test for this too.

(I want to do some code cleanup too, but I thought I'd first fix
the problem with as little code as possible, and add a unit test
for this case.  So that's what this checkin is about.)

22 years ago- If an OSA identifier is a Python reserved word we now append an _
Jack Jansen [Wed, 7 Aug 2002 15:44:53 +0000 (15:44 +0000)]
- If an OSA identifier is a Python reserved word we now append an _
  in stead of prepending it, which messes up "import * from".
- A few ascii()s added again.
- Changed the getbaseclasses a little, but it still isn't perfect.

22 years agoClarify that the bool instances are acceptable return values from
Fred Drake [Wed, 7 Aug 2002 15:40:15 +0000 (15:40 +0000)]
Clarify that the bool instances are acceptable return values from
__nonzero__(), in response to SF bug #579991.

22 years agoUse Py_FatalError instead of abort.
Martin v. Löwis [Wed, 7 Aug 2002 15:18:57 +0000 (15:18 +0000)]
Use Py_FatalError instead of abort.

22 years agoDon't be over-enthusiastic with the ascii() calls: we don't need it if
Jack Jansen [Wed, 7 Aug 2002 15:05:42 +0000 (15:05 +0000)]
Don't be over-enthusiastic with the ascii() calls: we don't need it if
the result passes through backticks.

22 years agoDonovan Preston's patch #538395, with some mods by me.
Jack Jansen [Wed, 7 Aug 2002 14:49:00 +0000 (14:49 +0000)]
Donovan Preston's patch #538395, with some mods by me.

This patch makes inheritance for OSA classes work. The implementation is a
bit convoluted, but I don't immedeately see a simpler way of doing it.

I added calls to ascii() everywhere we output strings that may contain
non-ascii characters (Python has gotten very picky since the encoding
patch:-).

I also removed Donovan's different way of opening resource files: I don't
seem to need it.

22 years agoQuote the arguments, they may contain strings.
Jack Jansen [Wed, 7 Aug 2002 14:05:58 +0000 (14:05 +0000)]
Quote the arguments, they may contain strings.

22 years agoFix up some more markup problems.
Fred Drake [Wed, 7 Aug 2002 13:24:09 +0000 (13:24 +0000)]
Fix up some more markup problems.

22 years agoChange the markup a bit more; the parameter was not marked as \var in the
Fred Drake [Wed, 7 Aug 2002 12:39:33 +0000 (12:39 +0000)]
Change the markup a bit more; the parameter was not marked as \var in the
sample code, and the note was marked as a logical thing.

22 years agoFix PEP 263 code --without-unicode. Fixes #591943.
Martin v. Löwis [Wed, 7 Aug 2002 12:33:18 +0000 (12:33 +0000)]
Fix PEP 263 code --without-unicode. Fixes #591943.

22 years agoFix markup errors.
Steve Holden [Wed, 7 Aug 2002 12:01:41 +0000 (12:01 +0000)]
Fix markup errors.

22 years agoExpanded the unittests for the new width sensitive PyUnicode_Contains().
Raymond Hettinger [Tue, 6 Aug 2002 23:08:51 +0000 (23:08 +0000)]
Expanded the unittests for the new width sensitive PyUnicode_Contains().

22 years agoDocument handling of raw-unicode-escapes. Closes SF bug 587087.
Raymond Hettinger [Tue, 6 Aug 2002 22:36:26 +0000 (22:36 +0000)]
Document handling of raw-unicode-escapes.  Closes SF bug 587087.

22 years agointernal_connect(): Windows. When sock_timeout > 0 and connect() yields
Tim Peters [Tue, 6 Aug 2002 22:25:02 +0000 (22:25 +0000)]
internal_connect():  Windows.  When sock_timeout > 0 and connect() yields
WSAEWOULDBLOCK, the second connect() attempt appears to yield WSAEISCONN
on Win98 but WSAEINVAL on Win2K.  So accept either as meaning "yawn,
fine".  This allows test_socket to succeed on my Win2K box (which it
already did on my Win98SE box).

22 years agoAdded a note about the inability to specify a pathname to a non-existing
Jack Jansen [Tue, 6 Aug 2002 22:15:23 +0000 (22:15 +0000)]
Added a note about the inability to specify a pathname to a non-existing
file in unix-Python.

22 years agoChanged a sentence that confused some people.
Jack Jansen [Tue, 6 Aug 2002 22:14:23 +0000 (22:14 +0000)]
Changed a sentence that confused some people.

22 years agoMake more functions static
Neal Norwitz [Tue, 6 Aug 2002 22:12:52 +0000 (22:12 +0000)]
Make more functions static

22 years agoMake readahead functions static
Neal Norwitz [Tue, 6 Aug 2002 21:50:54 +0000 (21:50 +0000)]
Make readahead functions static

22 years agoFix SF bug 574207 (chained __slots__ dealloc segfault).
Guido van Rossum [Tue, 6 Aug 2002 21:41:44 +0000 (21:41 +0000)]
Fix SF bug 574207 (chained __slots__ dealloc segfault).

This is inspired by SF patch 581742 (by Jonathan Hogg, who also
submitted the bug report, and two other suggested patches), but
separates the non-GC case from the GC case to avoid testing for GC
several times.

Had to fix an assert() from call_finalizer() that asserted that the
object wasn't untracked, because it's possible that the object isn't
GC'ed!

22 years agoFix the markup so it doesn't break formatting.
Fred Drake [Tue, 6 Aug 2002 21:36:06 +0000 (21:36 +0000)]
Fix the markup so it doesn't break formatting.

22 years agoAdd testcase for SF bug 574207 (chained __slots__ dealloc segfault).
Guido van Rossum [Tue, 6 Aug 2002 21:28:28 +0000 (21:28 +0000)]
Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).
Fix forthcoming.

22 years agoAdded references to the email package.
Fred Drake [Tue, 6 Aug 2002 21:26:01 +0000 (21:26 +0000)]
Added references to the email package.
Closes SF bug #586937.

22 years agoAdded a test for PyUnicode_Contains() taking into account the width of
Barry Warsaw [Tue, 6 Aug 2002 19:03:56 +0000 (19:03 +0000)]
Added a test for PyUnicode_Contains() taking into account the width of
Py_UNICODE.

22 years agoPyUnicode_Contains(): The memcmp() call didn't take into account the
Barry Warsaw [Tue, 6 Aug 2002 19:03:17 +0000 (19:03 +0000)]
PyUnicode_Contains(): The memcmp() call didn't take into account the
width of Py_UNICODE.  Good catch, MAL.

22 years agoget rid of GETNAMEV macro - use GETITEM directly
Skip Montanaro [Tue, 6 Aug 2002 17:47:40 +0000 (17:47 +0000)]
get rid of GETNAMEV macro - use GETITEM directly
same idea as getting rid of GETCONST & GETNAME (see patch #506436)

22 years agoAdd a coding cookie, because of the møøse quote.
Guido van Rossum [Tue, 6 Aug 2002 17:29:38 +0000 (17:29 +0000)]
Add a coding cookie, because of the møøse quote.

22 years agoUpdate the URL for getting zlib, and update the minimal required
Guido van Rossum [Tue, 6 Aug 2002 17:28:30 +0000 (17:28 +0000)]
Update the URL for getting zlib, and update the minimal required
version to 1.1.4 (because of the 1.1.3 security problem).  Also
replace a funny use of line.find() with line.startswith().

22 years agoBump the LOOPS count. 50,000 iterations takes about 5 seconds on my
Guido van Rossum [Tue, 6 Aug 2002 17:21:20 +0000 (17:21 +0000)]
Bump the LOOPS count.  50,000 iterations takes about 5 seconds on my
machine -- that feels just right.

22 years agoAdd some fine points: METH_KEYWORDS implies METH_VARARGS, and ob_size
Guido van Rossum [Tue, 6 Aug 2002 17:18:56 +0000 (17:18 +0000)]
Add some fine points: METH_KEYWORDS implies METH_VARARGS, and ob_size
is no longer unused in type objects.

22 years agoMark xreadlines deprecated. Don't use f.xreadlines() in test_iter.py.
Guido van Rossum [Tue, 6 Aug 2002 17:14:04 +0000 (17:14 +0000)]
Mark xreadlines deprecated.  Don't use f.xreadlines() in test_iter.py.

22 years agoRemove mention of deprecated xreadlines method.
Guido van Rossum [Tue, 6 Aug 2002 17:03:25 +0000 (17:03 +0000)]
Remove mention of deprecated xreadlines method.

22 years agoDescribe new "str1 in str2" behavior.
Barry Warsaw [Tue, 6 Aug 2002 17:01:51 +0000 (17:01 +0000)]
Describe new "str1 in str2" behavior.

22 years agoDocument file.next(). Mark xreadlines obsolete (both method and
Guido van Rossum [Tue, 6 Aug 2002 17:01:28 +0000 (17:01 +0000)]
Document file.next().  Mark xreadlines obsolete (both method and
module).  (One thing remains to be done: the gzip class has an
xreadline method; this ought to be replaced by an iterator as well.)

22 years agoCommitting patch #591250 which provides "str1 in str2" when str1 is a
Barry Warsaw [Tue, 6 Aug 2002 16:58:21 +0000 (16:58 +0000)]
Committing patch #591250 which provides "str1 in str2" when str1 is a
string of longer than 1 character.

22 years agoFiles are now their own iterator. The xreadlines method and module
Guido van Rossum [Tue, 6 Aug 2002 16:20:26 +0000 (16:20 +0000)]
Files are now their own iterator.  The xreadlines method and module
are obsolete.

22 years agoAdd comment about os.path.walk()'s behavior with symbolic links.
Steve Holden [Tue, 6 Aug 2002 16:07:07 +0000 (16:07 +0000)]
Add comment about os.path.walk()'s behavior with symbolic links.

22 years agoAdd next and __iter__ to the list of file methods that should raise
Guido van Rossum [Tue, 6 Aug 2002 15:58:24 +0000 (15:58 +0000)]
Add next and __iter__ to the list of file methods that should raise
ValueError when called for a closed file.

22 years agoSF patch 580331 by Oren Tirosh: make file objects their own iterator.
Guido van Rossum [Tue, 6 Aug 2002 15:55:28 +0000 (15:55 +0000)]
SF patch 580331 by Oren Tirosh: make file objects their own iterator.

For a file f, iter(f) now returns f (unless f is closed), and f.next()
is similar to f.readline() when EOF is not reached; however, f.next()
uses a readahead buffer that messes up the file position, so mixing
f.next() and f.readline() (or other methods) doesn't work right.
Calling f.seek() drops the readahead buffer, but other operations
don't.

The real purpose of this change is to reduce the confusion between
objects and their iterators.  By making a file its own iterator, it's
made clearer that using the iterator modifies the file object's state
(in particular the current position).

A nice side effect is that this speeds up "for line in f:" by not
having to use the xreadlines module.  The f.xreadlines() method is
still supported for backwards compatibility, though it is the same as
iter(f) now.

(I made some cosmetic changes to Oren's code, and added a test for
"file closed" to file_iternext() and file_iter().)

22 years agoIn the altbininstall target, which is the first subtarget for "make install",
Jack Jansen [Tue, 6 Aug 2002 13:40:31 +0000 (13:40 +0000)]
In the altbininstall target, which is the first subtarget for "make install",
if we are running in an OSX framework enabled build directory, test that
the framework infrastructure exists. This catches the very common
error of doing "make install" in stead of "make frameworkinstall".

22 years agoPatch #567296 by Pim Buurman, slightly modified by me so it can be disabled
Jack Jansen [Tue, 6 Aug 2002 12:59:44 +0000 (12:59 +0000)]
Patch #567296 by Pim Buurman, slightly modified by me so it can be disabled
at compile time: use PBGetCatInfoSync() to get FInfo data in stead of
GetFInfo. The latter doesn't work for folders. The former does, at
least on OSX, and insofar the info makes sense for a folder.

22 years agoWrapper around _IBCarbon.
Jack Jansen [Tue, 6 Aug 2002 09:32:57 +0000 (09:32 +0000)]
Wrapper around _IBCarbon.

22 years agoMention list.sort()
Andrew M. Kuchling [Tue, 6 Aug 2002 01:40:48 +0000 (01:40 +0000)]
Mention list.sort()
Document heapq module
Add PEP263 section (not sure I really understand the PEP's effect on 8-bit
   strings, though -- will have to experiment with it)

22 years agoSF patch #591305 Documentation err in bytecode defs
Neal Norwitz [Mon, 5 Aug 2002 23:33:54 +0000 (23:33 +0000)]
SF patch #591305 Documentation err in bytecode defs

22 years agoWe only need to check for StopIteration here.
Fred Drake [Mon, 5 Aug 2002 22:16:40 +0000 (22:16 +0000)]
We only need to check for StopIteration here.