I grabbed the latest Python2.5 code via subversion and ran my typo script on it.
Weeding out the obvious false positives and Neal's comments leaves about 129 typos.
See http://www.geocities.com/typopl/typoscan.htm
Should I enter the typos as bugs in the Python bug db?
J
> Date: Fri, 22 Sep 2006 21:51:38 -0700> From: nnorwitz(a)gmail.com> To: typo_pl(a)hotmail.com> Subject: Re: [Python-Dev] Typo.pl scan of Python 2.5 source code> CC: python-dev(a)python.org> > On 9/22/06, Johnny Lee <typo_pl(a)hotmail.com> wrote:> >> > Hello,> > My name is Johnny Lee. I have developed a *ahem* perl script which scans> > C/C++ source files for typos.> > Hi Johnny.> > Thanks for running your script, even if it is written in Perl and ran> on Windows. :-)> > > The Python 2.5 typos can be classified into 7 types.> >> > 2) realloc overwrite src if NULL, i.e. p = realloc(p, new_size);> > If realloc() fails, it will return NULL. If you assign the return value to> > the same variable you passed into realloc,> > then you've overwritten the variable and possibly leaked the memory that the> > variable pointed to.> > A bunch of these warnings were accurate and a bunch were not. There> were 2 reasons for the false positives. 1) The pointer was aliased,> thus not lost, 2) On failure, we exited (Parser/*.c)> > > 4) if ((X!=0) || (X!=1))> > These 2 cases occurred in binascii. I have no idea if the warning is> wright or the code is.> > > 6) XX;;> > Just being anal here. Two semicolons in a row. Second one is extraneous.> > I already checked in a fix for these on HEAD. Hard for even me to> screw up those fixes. :-)> > > 7) extraneous test for non-NULL ptr> > Several memory calls that free memory accept NULL ptrs.> > So testing for NULL before calling them is redundant and wastes code space.> > Now some codepaths may be time-critical, but probably not all, and smaller> > code usually helps.> > I ignored these as I'm not certain all the platforms we run on accept> free(NULL).> > Below is my categorization of the warnings except #7. Hopefully> someone will fix all the real problems in the first batch.> > Thanks again!> > n> --> > # Problems> Objects\fileobject.c (338): realloc overwrite src if NULL; 17:> file->f_setbuf=(char*)PyMem_Realloc(file->f_setbuf,bufsize)> Objects\fileobject.c (342): using PyMem_Realloc result w/no check> 30: setvbuf(file->f_fp, file->f_setbuf, type, bufsize);> [file->f_setbuf]> Objects\listobject.c (2619): using PyMem_MALLOC result w/no check> 30: garbage[i] = selfitems[cur]; [garbage]> Parser\myreadline.c (144): realloc overwrite src if NULL; 17:> p=(char*)PyMem_REALLOC(p,n+incr)> Modules\_csv.c (564): realloc overwrite src if NULL; 17:> self->field=PyMem_Realloc(self->field,self->field_size)> Modules\_localemodule.c (366): realloc overwrite src if NULL; 17:> buf=PyMem_Realloc(buf,n2)> Modules\_randommodule.c (290): realloc overwrite src if NULL; 17:> key=(unsigned#long*)PyMem_Realloc(key,bigger*sizeof(*key))> Modules\arraymodule.c (1675): realloc overwrite src if NULL; 17:> self->ob_item=(char*)PyMem_REALLOC(self->ob_item,itemsize*self->ob_size)> Modules\cPickle.c (536): realloc overwrite src if NULL; 17:> self->buf=(char*)realloc(self->buf,n)> Modules\cPickle.c (592): realloc overwrite src if NULL; 17:> self->buf=(char*)realloc(self->buf,bigger)> Modules\cPickle.c (4369): realloc overwrite src if NULL; 17:> self->marks=(int*)realloc(self->marks,s*sizeof(int))> Modules\cStringIO.c (344): realloc overwrite src if NULL; 17:> self->buf=(char*)realloc(self->buf,self->buf_size)> Modules\cStringIO.c (380): realloc overwrite src if NULL; 17:> oself->buf=(char*)realloc(oself->buf,oself->buf_size)> Modules\_ctypes\_ctypes.c (2209): using PyMem_Malloc result w/no> check 30: memset(obj->b_ptr, 0, dict->size); [obj->b_ptr]> Modules\_ctypes\callproc.c (1472): using PyMem_Malloc result w/no> check 30: strcpy(conversion_mode_encoding, coding);> [conversion_mode_encoding]> Modules\_ctypes\callproc.c (1478): using PyMem_Malloc result w/no> check 30: strcpy(conversion_mode_errors, mode);> [conversion_mode_errors]> Modules\_ctypes\stgdict.c (362): using PyMem_Malloc result w/no> check 30: memset(stgdict->ffi_type_pointer.elements, 0,> [stgdict->ffi_type_pointer.elements]> Modules\_ctypes\stgdict.c (376): using PyMem_Malloc result w/no> check 30: memset(stgdict->ffi_type_pointer.elements, 0,> [stgdict->ffi_type_pointer.elements]> > # No idea if the code or tool is right.> Modules\binascii.c (1161)> Modules\binascii.c (1231)> > # Platform specific files. I didn't review and won't fix without testing.> Python\thread_lwp.h (107): using malloc result w/no check 30:> lock->lock_locked = 0; [lock]> Python\thread_os2.h (141): using malloc result w/no check 30:> (long)sem)); [sem]> Python\thread_os2.h (155): using malloc result w/no check 30:> lock->is_set = 0; [lock]> Python\thread_pth.h (133): using malloc result w/no check 30:> memset((void *)lock, '\0', sizeof(pth_lock)); [lock]> Python\thread_solaris.h (48): using malloc result w/no check 30:> funcarg->func = func; [funcarg]> Python\thread_solaris.h (133): using malloc result w/no check 30:> if(mutex_init(lock,USYNC_THREAD,0)) [lock]> > # Who cares about these modules.> Modules\almodule.c:182> Modules\svmodule.c:547> > # Not a problem.> Parser\firstsets.c (76)> Parser\grammar.c (40)> Parser\grammar.c (59)> Parser\grammar.c (83)> Parser\grammar.c (102)> Parser\node.c (95)> Parser\pgen.c (52)> Parser\pgen.c (69)> Parser\pgen.c (126)> Parser\pgen.c (438)> Parser\pgen.c (462)> Parser\tokenizer.c (797)> Parser\tokenizer.c (869)> Modules\_bsddb.c (2633)> Modules\_csv.c (1069)> Modules\arraymodule.c (1871)> Modules\gcmodule.c (1363)> Modules\zlib\trees.c (375)
_________________________________________________________________
Get the new Windows Live Messenger!
http://get.live.com/messenger/overview
On Saturday 28 October 2006 03:13, andrew.kuchling wrote:
> 2.4 backport candidate, probably.
FWIW, I'm not planning on doing any more "collect all the bugfixes" releases
of 2.4. It's now in the same category as 2.3 - that is, only really serious
bugs (in particular, security related bugs) will get a new release, and then
only with the serious bugfixes applied.
One active maintenance branch is quite enough to deal with, IMHO.
--
Anthony Baxter <anthony(a)interlink.com.au>
It's never too late to have a happy childhood.
I have patched Lib/modulefinder.py to work with absolute and relative imports.
It also is faster now, and has basic unittests in Lib/test/test_modulefinder.py.
The work was done in a theller_modulefinder SVN branch.
If nobody objects, I will merge this into trunk, and possibly also into release25-maint, when I have time.
Thanks,
Thomas
Here's the summary for the first half of September. As always,
comments and corrections are greatly appreciated!
=============
Announcements
=============
----------------------------
QOTF: Quote of the Fortnight
----------------------------
Through a cross-posting slip-up, Jean-Paul Calderone managed to
provide us with some inspiring thoughts on mailing-list archives:
One could just as easily ask why no one bothers to read mailing list
archives to see if their question has been answered before.
No one will ever know, it is just one of the mysteries of the universe.
Contributing thread:
- `[Twisted-Python] Newbie question
<http://mail.python.org/pipermail/python-dev/2006-September/068682.html>`__
-------------------------
Monthly Arlington sprints
-------------------------
Jeffrey Elkner has arranged for monthly Arlington Python sprints. See
the `Arlington sprint wiki`_ for more details.
.. _Arlington sprint wiki: http://wiki.python.org/moin/ArlingtonSprint
Contributing thread:
- `Arlington sprints to occur monthly
<http://mail.python.org/pipermail/python-dev/2006-September/068688.html>`__
=========
Summaries
=========
-----------------------------------------
Signals, threads and blocking C functions
-----------------------------------------
Gustavo Carneiro explained a problem that pygtk was running into.
Their main loop function, ``gtk_main()``, blocks forever. If there are
threads in the program, they cannot receive signals because Python
catches the signal and calls ``Py_AddPendingCall()``, relying on the
main thread to call ``Py_MakePendingCalls()``. Since with pygtk, the
main thread is blocked calling a C function, it has no way other than
polling to decide when ``Py_MakePendingCalls()`` needs to be called.
Gustavo was hoping for some sort of API so that his blocking thread
could get notified when ``Py_AddPendingCall()`` had been called.
There was a long discussion about the feasibility of this and other
solutions to his problem. One of the main problems is that almost
nothing can safely be done from a signal handler context, so some
people felt like having Python invoke arbitrary third-party code was a
bad idea. Gustavo was reasonably confident that he could write to a
pipe within that context, which was all he needed to do to solve his
problem, but Nick Maclaren explained in detail some of the problems,
e.g. writing proper synchronization primitives that are signal-handler
safe.
Jan Kanis suggested that threads in a pygtk program should
occasionally check the signal handler flags and calls PyGTK's callback
to wake up the main thread. But Gustavo explained that things like the
GnomeVFS library have their own thread pools and know nothing about
Python so can't make such a callback.
Adam Olsen that Python could create a single non-blocking pipe for all
signals. When a signal was handled, the signal number would be written
to that pipe as a single byte. Third-party libraries, like pygtk,
could poll the appropriate file descriptor, waking up and handing
control back to Python when a signal was received. There were some
disadvantages to this approach, e.g. if there is a large burst of
signals, some of them would be lost, but folks seemed to think that
these kinds of things would not cause many real-world problems.
Gustavo and Adam then worked out the code in a little more detail.
The `Py_signal_pipe patch`_ was posted to SourceForge.
.. _Py_signal_pipe patch: http://bugs.python.org/1564547
Contributing thread:
- `Signals, threads, blocking C functions
<http://mail.python.org/pipermail/python-dev/2006-September/068569.html>`__
------------------------
API for str.rpartition()
------------------------
Raymond Hettinger pointed out that in cases where the separator was
not found, ``str.rpartition()`` was putting the remainder of the
string in the wrong spot, e.g. ``str.rpartition()`` worked like::
'axbxc'.rpartition('x') == ('axb', 'x', 'c')
'axb'.rpartition('x') == ('a', 'x', 'b')
'a'.rpartition('x') == ('a', '', '') # should be ('', '', 'a')
Thus code that used ``str.rpartition()`` in a loop or recursively
would likely never terminate. Raymond checked in a fix for this,
spawning an enormous discussion about how the three bits
``str.rpartition()`` returns should be named. There was widespread
disagreement on which side was the "head" and which side was the
"tail", and the only unambiguous one seemed to be "left, sep, right".
Raymond and others were not as happy with this version because it was
no longer suggestive of the use cases, but it looked like this might
be the best compromise.
Contributing threads:
- `Problem withthe API for str.rpartition()
<http://mail.python.org/pipermail/python-dev/2006-September/068565.html>`__
- `Fwd: Problem withthe API for str.rpartition()
<http://mail.python.org/pipermail/python-dev/2006-September/068615.html>`__
---------------
Unicode Imports
---------------
Kristján V. Jónsson submitted a `unicode import patch`_ that would
allow unicode paths in sys.path and use the unicode file API on
Windows. It got a definite "no" from the Python 2.5 release managers
since it was already too late in the release process. Nonetheless
there was a long discussion about whether or not it should be
considered a bug or a feature. Martin v. Löwis explained that it was
definitely a feature because it would break existing introspection
tools expecting things like __file__ to be 8-bit strings (not unicode
strings as they would be with the patch).
.. _unicode import patch: http://bugs.python.org/1552880
Contributing thread:
- `Unicode Imports
<http://mail.python.org/pipermail/python-dev/2006-September/068686.html>`__
-------------------------
Exception and __unicode__
-------------------------
Marcin 'Qrczak' Kowalczyk reported a `TypeError from unicode()`_ when
applied to an Exception class. Brett Cannon explained the source of
this: BaseException defined a ``__unicode__`` descriptor which was
complaining when it was handed a class, not an instance. The easiest
solution seemed to be the best for Python 2.5: simply rip out the
``__unicode__`` method entirely. M.-A. Lemburg suggested that for
Python 2.6 this should be fixed by introducing a tp_unicode slot.
.. _TypeError from unicode(): http://bugs.python.org/1551432
Contributing thread:
- `2.5 status <http://mail.python.org/pipermail/python-dev/2006-September/068607.html>`__
--------------------------
Slowdown in inspect module
--------------------------
Fernando Perez reported an enormous slowdown in Python 2.5's inspect
module. Nick Coghlan figured out that this was a result of
``inspect.findsource()`` calling ``os.path.abspath()`` and
``os.path.normpath()`` repeatedly on the module's file name. Nick
provided a `patch to speed things up`_ by caching the absolute,
normalized file names.
.. _patch to speed things up: http://bugs.python.org/1553314
Contributing thread:
- `inspect.py very slow under 2.5
<http://mail.python.org/pipermail/python-dev/2006-September/068656.html>`__
--------------------------------
Cross-platform float consistency
--------------------------------
Andreas Raab asked about trying to minimize some of the cross-platform
differences in floating-point calcuations, by using something like
fdlibm_. Tim Peters pointed him to a `previous thread on this issue`_
and suggested that best route was probably to package a Python wrapper
for fdlibm_ and see how much interest there was.
.. _fdlibm: http://www.netlib.org/fdlibm/
.. _previous thread on this issue:
http://mail.python.org/pipermail/python-list/2005-July/290164.html
Contributing thread:
- `Cross-platform math functions?
<http://mail.python.org/pipermail/python-dev/2006-September/068599.html>`__
-----------------------------------
Refcounting and errors in functions
-----------------------------------
Mihai Ibanescu pointed out that refcount status for functions that can
fail is generally poorly documented. Greg Ewing explained that
refcounting behavior should be independent of whether the call
succeeds or fails, but it was clear that this was not always the case.
Mihai promised to file a low-severity bug so that this problem
wouldn't be lost.
Contributing thread:
- `Py_BuildValue and decref
<http://mail.python.org/pipermail/python-dev/2006-September/068708.html>`__
------------
Python 2.3.6
------------
Barry Warsaw offered to push out a Python 2.3.6 if folks were
interested in getting some bugfixes out to the platforms which were
still running Python 2.3. After an underwhelming response, he
retracted the offer.
Contributing threads:
- `Interest in a Python 2.3.6?
<http://mail.python.org/pipermail/python-dev/2006-August/068520.html>`__
- `Interest in a Python 2.3.6?
<http://mail.python.org/pipermail/python-dev/2006-September/068731.html>`__
- `Python 2.4.4 was: Interest in a Python 2.3.6?
<http://mail.python.org/pipermail/python-dev/2006-September/068737.html>`__
-----------------------------------
Effbot Python library documentation
-----------------------------------
Johann C. Rocholl asked about the status of http://effbot.org/lib/,
Fredrik Lundh's alternative format and rendering for the Python
library documentation. Fredrik indicated that due to the pushback from
some folks on python-dev, they've been working mainly "under the
radar" on this. (At least until some inconsiderate soul put them in
the summary...) ;-)
Contributing threads:
- `That library reference, yet again
<http://mail.python.org/pipermail/python-dev/2006-August/068556.html>`__
- `That library reference, yet again
<http://mail.python.org/pipermail/python-dev/2006-September/068561.html>`__
================
Deferred Threads
================
- `IronPython and AST branch
<http://mail.python.org/pipermail/python-dev/2006-September/068778.html>`__
==================
Previous Summaries
==================
- `Py2.5 issue: decimal context manager misimplemented, misdesigned,
and misdocumented
<http://mail.python.org/pipermail/python-dev/2006-September/068564.html>`__
- `Error while building 2.5rc1 pythoncore_pgo on VC8
<http://mail.python.org/pipermail/python-dev/2006-September/068582.html>`__
- `gcc 4.2 exposes signed integer overflows
<http://mail.python.org/pipermail/python-dev/2006-September/068602.html>`__
- `no remaining issues blocking 2.5 release
<http://mail.python.org/pipermail/python-dev/2006-September/068606.html>`__
- `new security doc using object-capabilities
<http://mail.python.org/pipermail/python-dev/2006-September/068673.html>`__
===============
Skipped Threads
===============
- `A test suite for unittest
<http://mail.python.org/pipermail/python-dev/2006-September/068558.html>`__
- `Fwd: [Python-checkins] r51674 - python/trunk/Misc/Vim/vimrc
<http://mail.python.org/pipermail/python-dev/2006-September/068562.html>`__
- `Weekly Python Patch/Bug Summary
<http://mail.python.org/pipermail/python-dev/2006-September/068567.html>`__
- `Windows build slave down until Tuesday-ish
<http://mail.python.org/pipermail/python-dev/2006-September/068573.html>`__
- `[Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you
are so inclined
<http://mail.python.org/pipermail/python-dev/2006-September/068605.html>`__
- `Exception message for invalid with statement usage
<http://mail.python.org/pipermail/python-dev/2006-September/068665.html>`__
- `buildbot breakage
<http://mail.python.org/pipermail/python-dev/2006-September/068671.html>`__
- `Change in file() behavior in 2.5
<http://mail.python.org/pipermail/python-dev/2006-September/068678.html>`__
- `'with' bites Twisted
<http://mail.python.org/pipermail/python-dev/2006-September/068681.html>`__
- `What windows tool chain do I need for python 2.5 extensions?
<http://mail.python.org/pipermail/python-dev/2006-September/068709.html>`__
- `2.5c2 <http://mail.python.org/pipermail/python-dev/2006-September/068742.html>`__
- `_PyGILState_NoteThreadState should be static or not?
<http://mail.python.org/pipermail/python-dev/2006-September/068743.html>`__
- `BRANCH FREEZE: release25-maint, 00:00UTC 12 September 2006
<http://mail.python.org/pipermail/python-dev/2006-September/068745.html>`__
- `datetime's strftime implementation: by design or bug
<http://mail.python.org/pipermail/python-dev/2006-September/068747.html>`__
- `Subversion 1.4
<http://mail.python.org/pipermail/python-dev/2006-September/068761.html>`__
- `RELEASED Python 2.5 (release candidate 2)
<http://mail.python.org/pipermail/python-dev/2006-September/068766.html>`__
- `Maybe we should have a C++ extension for testing...
<http://mail.python.org/pipermail/python-dev/2006-September/068768.html>`__
- `.pyc file has different result for value "1.79769313486232e+308"
than .py file <http://mail.python.org/pipermail/python-dev/2006-September/068769.html>`__
- `release is done, but release25-maint branch remains near-frozen
<http://mail.python.org/pipermail/python-dev/2006-September/068773.html>`__
- `fun threading problem
<http://mail.python.org/pipermail/python-dev/2006-September/068774.html>`__
- `Thank you all
<http://mail.python.org/pipermail/python-dev/2006-September/068779.html>`__
Patch / Bug Summary
___________________
Patches : 434 open ( +3) / 3430 closed ( +5) / 3864 total ( +8)
Bugs : 929 open (+13) / 6285 closed (+12) / 7214 total (+25)
RFE : 245 open ( +1) / 240 closed ( +0) / 485 total ( +1)
New / Reopened Patches
______________________
various datetime methods fail in restricted mode (2006-10-17)
http://python.org/sf/1578643 opened by lplatypus
PyErr_Format corrections (2006-10-17)
http://python.org/sf/1578999 opened by Martin v. Löwis
posix.readlink doesn't use filesystemencoding (2006-10-19)
http://python.org/sf/1580674 opened by Ronald Oussoren
Duplicated declaration of PyCallable_Check (2006-10-20)
CLOSED http://python.org/sf/1580872 opened by Matthias Klose
Allow textwrap to preserve leading and trailing whitespace (2006-10-20)
http://python.org/sf/1581073 opened by Dwayne Bailey
tarfile.py: 100-char filenames are truncated (2006-10-24)
CLOSED http://python.org/sf/1583506 opened by Lars Gustäbel
tarfile.py: better use of TarInfo objects with longnames (2006-10-24)
http://python.org/sf/1583880 opened by Lars Gustäbel
Tix: subwidget names (bug #1472877) (2006-10-25)
http://python.org/sf/1584712 opened by Matthias Kievernagel
Patches Closed
______________
patch for building trunk with VC6 (2006-03-24)
http://python.org/sf/1457736 closed by loewis
a faster Modulefinder (2005-11-11)
http://python.org/sf/1353872 closed by theller
Duplicated declaration of PyCallable_Check (2006-10-20)
http://python.org/sf/1580872 closed by loewis
Exec stacks in python 2.5 (2006-09-18)
http://python.org/sf/1560695 closed by loewis
tarfile.py: 100-char filenames are truncated (2006-10-24)
http://python.org/sf/1583506 closed by gbrandl
New / Reopened Bugs
___________________
2.4.4c1 will not build when cross compiling (2006-10-16)
CLOSED http://python.org/sf/1578513 opened by smithj
--disable-sunaudiodev --disable-tk does not work (2006-10-17)
http://python.org/sf/1579029 opened by ThurnerRupert
Segfault provoked by generators and exceptions (2006-10-17)
http://python.org/sf/1579370 opened by Mike Klaas
Use flush() before os.exevp() (2006-10-18)
http://python.org/sf/1579477 opened by Thomas Guettler
Wrong syntax for PyDateTime_IMPORT in documentation (2006-10-18)
CLOSED http://python.org/sf/1579796 opened by David Faure
not configured for tk (2006-10-18)
http://python.org/sf/1579931 opened by Carl Wenrich
glob.glob("c:\\[ ]\*) doesn't work (2006-10-19)
http://python.org/sf/1580472 opened by Koblaid
"make install" for Python 2.4.4 not working properly (2006-10-19)
http://python.org/sf/1580563 opened by Andreas Jung
Configure script does not work for RHEL 4 x86_64 (2006-10-19)
http://python.org/sf/1580726 reopened by gbrandl
Configure script does not work for RHEL 4 x86_64 (2006-10-19)
http://python.org/sf/1580726 reopened by spotvt01
Configure script does not work for RHEL 4 x86_64 (2006-10-19)
http://python.org/sf/1580726 opened by Chris
httplib hangs reading too much data (2006-10-19)
http://python.org/sf/1580738 opened by Dustin J. Mitchell
Definition of a "character" is wrong (2006-10-20)
http://python.org/sf/1581182 opened by Adam Olsen
pickle protocol 2 failure on int subclass (2006-10-20)
http://python.org/sf/1581183 opened by Anders J. Munch
missing __enter__ + __getattr__ forwarding (2006-10-21)
http://python.org/sf/1581357 opened by Hirokazu Yamamoto
Text search gives bad count if called from variable trace (2006-10-20)
http://python.org/sf/1581476 opened by Russell Owen
test_sqlite fails on OSX G5 arch if test_ctypes is run (2006-10-21)
http://python.org/sf/1581906 opened by Skip Montanaro
email.header decode within word (2006-10-22)
http://python.org/sf/1582282 opened by Tokio Kikuchi
Python is dumping core after the test test_ctypes (2006-10-23)
http://python.org/sf/1582742 opened by shashi
Bulding source with VC6 fails due to missing files (2006-10-23)
CLOSED http://python.org/sf/1582856 opened by Ulrich Hockenbrink
class member inconsistancies (2006-10-23)
CLOSED http://python.org/sf/1583060 opened by EricDaigno
Different behavior when stepping through code w/ pdb (2006-10-24)
http://python.org/sf/1583276 opened by John Ehresman
tarfile incorrectly handles long filenames (2006-10-24)
CLOSED http://python.org/sf/1583537 opened by Mike Looijmans
yield+break stops tracing (2006-10-24)
http://python.org/sf/1583862 opened by Lukas Lalinsky
__str__ cannot be overridden on unicode-derived classes (2006-10-24)
http://python.org/sf/1583863 opened by Mike K
SSL "issuer" and "server" functions problems - security (2006-10-24)
http://python.org/sf/1583946 opened by John Nagle
remove() during iteration causes items to be skipped (2006-10-24)
CLOSED http://python.org/sf/1584028 opened by Kevin Rabsatt
os.tempnam fails on SUSE Linux to accept directory argument (2006-10-25)
CLOSED http://python.org/sf/1584723 opened by Andreas
Events in list return None not True on wait() (2006-10-26)
CLOSED http://python.org/sf/1585135 opened by SpinMess
Bugs Closed
___________
from_param and _as_parameter_ truncating 64-bit value (2006-10-12)
http://python.org/sf/1575945 closed by theller
2.4.4c1 will not build when cross compiling (2006-10-16)
http://python.org/sf/1578513 closed by loewis
Error with callback function and as_parameter with NumPy ndp (2006-10-10)
http://python.org/sf/1574584 closed by theller
PyThreadState_Clear() docs incorrect (2003-04-17)
http://python.org/sf/723205 deleted by theller
Wrong syntax for PyDateTime_IMPORT in documentation (2006-10-18)
http://python.org/sf/1579796 closed by akuchling
Configure script does not work for RHEL 4 x86_64 (2006-10-19)
http://python.org/sf/1580726 closed by loewis
Example typo in section 4 of 'Installing Python Modules' (2006-10-12)
http://python.org/sf/1576348 closed by akuchling
Bulding source with VC6 fails due to missing files (2006-10-23)
http://python.org/sf/1582856 closed by loewis
class member inconsistancies (2006-10-23)
http://python.org/sf/1583060 closed by gbrandl
mac installer profile patch vs. .bash_login (2006-09-19)
http://python.org/sf/1561243 closed by sf-robot
idle in python 2.5c1 freezes on macos 10.3.9 (2006-08-18)
http://python.org/sf/1542949 closed by sf-robot
Launcher reset to factory button provides bad command-line (2006-10-03)
http://python.org/sf/1570284 closed by sf-robot
tarfile incorrectly handles long filenames (2006-10-24)
http://python.org/sf/1583537 deleted by cdwave
remove() during iteration causes items to be skipped (2006-10-24)
http://python.org/sf/1584028 closed by rhettinger
os.tempnam fails on SUSE Linux to accept directory argument (2006-10-25)
http://python.org/sf/1584723 closed by gbrandl
Events in list return None not True on wait() (2006-10-26)
http://python.org/sf/1585135 closed by gbrandl
New / Reopened RFE
__________________
Add os.link() and os.symlink() support for Windows (2006-10-16)
http://python.org/sf/1578269 opened by M.-A. Lemburg
Martin v. Löwis wrote:
> Georg Brandl schrieb:
>> Perhaps you can bring up a discussion on python-dev about your improvements
>> and how they could be integrated into the standard library...
>
> Let me second this. The compiler package is largely unmaintained and
> was known to be broken (and perhaps still is). A replacement
> implementation, especially if it comes with a new maintainer, would
> be welcome.
>
> Regards,
> Martin
Hello python-dev.
I use AST-based code inspection and manipulation, and I've been looking forward
to using v2.5 ASTs for their increased accuracy, consistency and speed. However,
there is as yet no Python-exposed mechanism for compiling v2.5 ASTs to bytecode.
So to meet my own need and interest I've been implementing 'compiler2', similar
in scope to the stblib compiler package, but generating code from Python 2.5
_ast.ASTs. The code has evolved considerably from the compiler package: in
aggregate the changes amount to a re-write. More about the package and its
status below.
I'm introducing this project here to discuss whether and how these changes
should be integrated with the stdlib.
I believe there is a prima facie need to have a builtin/stdlib capability for
compiling v2.5 ASTs from Python, and there is some advantage to having that be
implemented in Python. There is also a case for deprecating the v2.4 ASTs to
ease maintenance and reduce the confusion associated with two different AST formats.
If there is interest, I'm willing make compiler2 stdlib-ready. I'm also open to
alternative approaches, including doing nothing.
compiler2 Objectives and Status
===============================
My goal is to get compiler2 to produce identical output to __builtin__.compile
(at least optionally), while also providing an accessible framework for
AST-manipulation, experimental compiler optimizations and customization.
compiler2 is not finished - there are some unresolved bugs, and open questions
on interface design - but already it produces identical output to
__builtin__.compile for all of the stdlib modules and their tests (except for
the stackdepth attribute which is different in 12 cases). All but three stdlib
modules pass their tests after being compiled using compiler2. More on goals,
status, known issues etc... in the project readme.txt at:
http://svn.brownspencer.com/pycompiler/branches/new_ast/readme.txt
Code is available in Subversion at
http://svn.brownspencer.com/pycompiler/branches/new_ast/
The main test script is test/test_compiler.py which compiles all the modules in
/Lib and /Lib/test and compares the output with __builtin__.compile.
Best regards
Michael Spencer
Is this a bug? If not, how do I override __str__ on a unicode derived class?
class S(str):
def __str__(self): return '__str__ overridden'
class U(unicode):
def __str__(self): return '__str__ overridden'
def __unicode__(self): return u'__unicode__ overridden'
s = S()
u = U()
print 's:', s
print "str(s):", str(s)
print 's substitued is "%s"\n' % s
print 'u:', u
print "str(u):", str(u)
print 'u substitued is "%s"' % u
-----------------------------------------------------
s: __str__ overridden
str(s): __str__ overridden
s substitued is "__str__ overridden"
u:
str(u): __str__ overridden
u substitued is ""
Results are identical for 2.4.2 and 2.5c2 (running under windows).
Mike
Per my conversation with Martin v. Löwis on the python-list, I think I
have found a problem with the configure script and Makefile.in.
For Python 2.4.4 it seems that the arguement --libdir does not change
the Makefile. Specifically I need this to change the libdir to
/usr/lib64 for RH on a x86_64 machine.
I'd like to contribute a fix for this, but I'm relatively new so I
would appreciate some guidance.
In the Makefile, I tried setting LIBDIR to $(exec_prefix)/lib64 and
SCRIPTDIR to $(prefix)/lib64 manually. Unfortuantely that created an
error when I ran python2.4:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
so I edited my /etc/profile and included:
export PYTHONHOME = "/usr"
and reran python2.4 and now the only error is:
'import site' failed; use -v for traceback
I poked around in /Modules/getpath.c and I'm starting to understand
how things are comming together. My question is: how does $(prefix)
from the congifure script make it into PREFIX in the c code? I see on
line 106 of /Modules/getpath.c that it checks to see if PREFIX is
defined and if not set's it to "/usr/local". So I did a grep on
PREFIX from the Python2.4.4 dir level and it didn't return anything
that looks like PREFIX is being set based on the input to the
configure script. Where might this be happening? I'm assuming
there's also a similar disconnect for LIBDIR (even though it never
get's set properly in the Makefile, even when I edited it by hand,
those changes don't make it into the code .... but I don't know where
it should be changed in the code.)
Respectfully,
Christopher Taylor