Guido van Rossum [Mon, 10 Nov 2003 02:16:36 +0000 (02:16 +0000)]
mktemp() shouldn't rely on os.path.exists(), which can return False if
the file is a symlink. Instead, use os.lstat directly, if it exists;
fall back on os.stat or the built-in open. Thanks to Iustin Pop.
Alex Martelli [Sun, 9 Nov 2003 16:33:56 +0000 (16:33 +0000)]
clarified (in the 5.14 summary) that tests and comparisons all chain,
added a specific \ref to 5.9 in lieu of previous vague "see above".
(same as commit of Sun Nov 2 to the release23-maint branch)
* Use weakref's of DBCursor objects for the iterator cursors to avoid a
memory leak that would've occurred for all iterators that were
destroyed before having iterated until they raised StopIteration.
* Simplify some code.
* Add new test cases to check for the memleak and ensure that mixing
iteration with modification of the values for existing keys works.
* Fix the singlethreaded deadlocks occurring in the simple bsddb interface.
* Add support for multiple iterator/generator objects at once on the simple
bsddb _DBWithCursor interface.
Fix a tuple memory leak when raising DB, DBEnv and DBCursor "object
has been closed" exceptions.
Adds a DBCursorClosedError exception in the closed cursor case for
future use in fixing the legacy bsddb interface deadlock problems
due to its use of cursors with DB_INIT_LOCK | DB_THREAD support
enabled.
* tee object is no longer subclassable
* independent iterators renamed to "itertools.tee_iterator"
* fixed doc string typo and added entry in the module doc string
Steve Purcell [Sun, 26 Oct 2003 10:41:03 +0000 (10:41 +0000)]
Incorporated patch 819077, from George Yoshida:
* Fixed typo in docstring for 'failUnlessAlmostEqual()'
* Removed unnecessary use of 'float()' for time values.
* Removed apparently unnecessary import of unittest. At some point in
the distant past I believe it was necessary otherwise the 'TestCase'
that a module saw was not the same as the 'TestCase' seen within
'unittest', and the user's TestCase subclasses were not recognised as
subclasses of the TestCase seen within unittest. Seems not to be
necessary now.
* Add error checking code to PyList_Append() call.
* Replace PyObject_CallMethod(to->outbasket, "pop", NULL) with equivalent
in-line code. Inlining is important here because the search for the
pop method will occur for every element returned by the iterator.
* Make tee's dealloc() a little smarter. If the trailing iterator is
being deallocated, then the queue data is no longer needed and can
be freed.
[Bug #822668] tarfile raises an exception if the tarfile is gzipped and is too large; the gzip filesize should be written out mod 2**32. (Reported by Johan Fredrik Ohman)
Walter Dörwald [Fri, 24 Oct 2003 14:25:28 +0000 (14:25 +0000)]
Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap().
charmaptranslate_makespace() allocated more memory than required for the
next replacement but didn't remember that fact, so memory size was growing
exponentially every time a replacement string is longer that one character.
This fixes SF bug #828737.
It works like the pure python verion except:
* it stops storing data after of the iterators gets deallocated
* the data queue is implemented with two stacks instead of one dictionary.
Guido van Rossum [Thu, 23 Oct 2003 23:54:57 +0000 (23:54 +0000)]
- The pwd module incorrectly advertised its struct type as
struct_pwent; this has been renamed to struct_passwd. (The old name
is still supported for backwards compatibility.)
Fred Drake [Thu, 23 Oct 2003 14:33:46 +0000 (14:33 +0000)]
- add "Why is Python installed on my computer?" as a documentation FAQ
since this gets asked at the docs at python.org address a lot
- fix some minor style violations and inconsistencies
[Bug #758241] When you use asyncore with a non-default map, methods
of the dispatcher object break. e.g. if you close() the object, it
tries to remove itself from the default map, not from the map the
dispatcher was created with.
The patch, from Stephane Ninin, records the map as an attribute of
the dispatcher instance.