Re: [Python-Dev] Please help complete the AST branch

2005-01-03 Thread Jeff Epler
On Mon, Jan 03, 2005 at 06:02:52PM -0800, Brett C. wrote:
> Although if someone can start sooner than by all means, go for it!
> And obviously help would be great since it isn't a puny codebase
> (4,000 lines so far for the CST->AST and AST->bytecode code).

And obviously knowing a little more about the AST branch would be
helpful for those considering helping.

Is there any relatively up-to-date document about ast-branch?  googling
about it turned up some pypy stuff from 2003, and I didn't look much
further.

I just built the ast-branch for fun, and "make test" mostly worked.
8 tests failed:
test_builtin test_dis test_generators test_inspect test_pep263
test_scope test_symtable test_trace
6 skips unexpected on linux2:
test_csv test_hotshot test_bsddb test_parser test_logging
test_email
I haven't looked at any of the failures in detail, but at least
test_bsddb is due to missing development libs on this system

One more thing:  The software I work on by day has python scripting.
One part of that functionality is a tree display of a script.  I'm not
actively involved with this part of the software (yet).  Any comments on
whether ast-branch could be construed as helping make this kind of
functionality work better, faster, or easier?  The code we use currently
is based on a modified version of the parser which includes comment
information, so we need to be aware of changes in this area anyhow.

(on the other hand, I won't hold my breath for permission to do this
on the clock, because of our own release scheduling I have other
projects on my plate now, and a version of our software that uses a
post-2.3 Python is years away)

Jeff


pgpP9DEEqf26m.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


python.org/sf URLs aren't working? Re: [Python-Dev] Weekly Python Patch/Bug Summary

2005-03-31 Thread Jeff Epler
I get 500 Internal Server Error messages when I try to access the URLs
in the recent patch summary.

Is this happening to anybody else?

Jeff


pgpOUL7H5Sr5t.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: python.org/sf URLs aren't working? Re: [Python-Dev] Weekly Python Patch/Bug Summary

2005-03-31 Thread Jeff Epler
It's working again for me now.  thanks!

Jeff


pgpVnAYyEVx3l.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Need to hook Py_FatalError

2005-05-03 Thread Jeff Epler
On Tue, May 03, 2005 at 09:15:42AM -0700, Guido van Rossum wrote:
> But tell me, what do you want the process to do instead of
> terminating? Py_FatalError is used in situations where raising an
> exception is impossible or would do more harm than good.

In an application which embeds Python, I want to show the application's
standard error dialog, which doesn't call any Python APIs (but does do
things like capture the call stack at the time of the error).  For this
use, it doesn't matter that no further calls to those APIs are possible.

Jeff


pgpSD1Dnj4d6g.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Need to hook Py_FatalError

2005-05-04 Thread Jeff Epler
On Wed, May 04, 2005 at 03:29:33PM +, M.Utku K. wrote:
> James William Pye <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]: 
> > Why should reinitialization be allowed at all? Seems to me that this
> > feature should be exclusively reserved for an embedding application to
> > handle the fatal in an application specific way; ie ereport(FATAL,()) in
> > PostgreSQL, which quickly exits after some cleanup. Why should an
> > extension module be allowed to set this, or reset it?
> 
> What if more than one extension needs it ?

I agree with James; As I imagine this feature, it is for programs that
embed Python, not for extensions.  Whether the hook would be written to
prevent this from being done, or whether it would just be documented as
"for embedders only", I don't care.

In my own application, I didn't use a setter function, I just created a
new global variable.  This works fine for me.  It doesn't prevent the
(abusive, in my view) hooking of the error handler by any old extension,
but since my application doesn't currently import shared modules it
doesn't matter.

--- /tmp/Python-2.3/Python/pythonrun.c  2003-07-15 20:54:38.0 -0500
+++ ./pythonrun.c   2005-04-11 13:32:39.0 -0500
@@ -1435,9 +1435,14 @@
 
 /* Print fatal error message and abort */
 
+void (*Py_FatalErrorHandler)(const char *msg) = NULL;
 void
 Py_FatalError(const char *msg)
 {
+if(Py_FatalErrorHandler != NULL) { 
+Py_FatalErrorHandler(msg);
+fprintf(stderr, "PyFatalErrorHandler returned\n");
+}
fprintf(stderr, "Fatal Python error: %s\n", msg);
 #ifdef MS_WINDOWS
OutputDebugString("Fatal Python error: ");


pgpmJ9g1tfE0g.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] b32encode and NUL bytes

2005-06-10 Thread Jeff Epler
On Tue, Jun 07, 2005 at 08:23:18PM -0700, Pavel Pergamenshchik wrote:
> Hi.
> Is this a feature? I do see b32encode padding the string with NULs first.
> 
> >>> b32decode(b32encode('\x00'))
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "/usr/lib/python2.4/base64.py", line 228, in b32decode
> last = binascii.unhexlify(hex(acc)[2:-1])
> TypeError: Odd-length string

This also seems suspect:
>>> base64.b32encode("\0a")
'ABQQ'
>>> base64.b32decode(_)
'a'

Jeff


pgpYoIR86pYL4.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-13 Thread Jeff Epler
On Mon, Mar 13, 2006 at 03:05:55PM +, fermigier wrote:
> Because according to
> http://www.washingtontechnology.com/news/1_1/daily_news/28134-1.html :
> 
> "The maintainers of the source codes can register with Coverity to see
> the full results. (End users cannot see the bug lists themselves; they
> will be able to see how buggy a particular program may be.)"

This distinction tweaks me a bit.  One strength of Open Source software
is that any "end user" may choose to be a developer.  But it sounds like
I have little chance of seeing Coverity's scan results on Open Source
software, because I'm not a "maintainer" of any project they've chosen
to scan.  This despite the fact that over the years I've made
(admittedly minor) contributions to a handful of the projects on their
list, and might choose to fix some of the scan-discovered defects if
only I could know what they were.

Jeff
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] checkin r43015

2006-03-13 Thread Jeff Epler
After the recent discussion about Coverity, I took a look at one of the
checkins made, apparently based on output from their tool.

http://svn.python.org/view/python/branches/release24-maint/Objects/object.c?&r1=43015&r2=43014&rev=43015&view=diff&diff_format=l

This change, a backport of a similar change made to HEAD, doesn't seem
to fix the flaw:  the PyUnicode_CheckExact() call is now guarded against
a NULL return, but the subsequent PyUnicode_Check() and PyString_Check()
calls don't seem to be.

I'm not 100% sure what's going on here, but it still looks a bit fishy.
The API reference says that PyObject_AsUnicode may return NULL, so why
doesn't the function just call PyErr_BadInternalCall() and return NULL?

Jeff
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 2.5a1 Performance

2006-04-05 Thread Jeff Epler
I compiled 2.4 and 2.5 from svn.  The machine is Fedora Core 4, AMD64.

I built both with
./configure && make
(which gives a "64-bit" binary) and then ran pystone with 20
iterations 10 times:
for i in `seq 1 10`; do ./python Lib/test/pystone.py 20 ; done

The machine was "near idle" at the time.

The best result for 2.4 (svn revision 43663) was 4.49 seconds (44343.4
pystones/second), which occurred on 4 of the runs.

The best result for 2.5 (svn revision 43675) was 4.27 seconds (46620
pystones/second), which occurred on only one run.  4.29 seconds, the
next best time, occurred on 3 runs.

I'm not trivially able to try a 32-bit build, but for my system it
appears that 2.5 is moderately faster than 2.4 when built with all the
defaults.

Jeff
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Tkinter lockups.

2006-04-23 Thread Jeff Epler
I just read the manpage for Tk_Init(3) (fc4 package tk-8.4.9-3) and it
does not say that Tk_Init() may only be called once.  While this doesn't
mean Python shouldn't work around it, I think the behavior should be
considered a bug in Tk, not _tkinter.

However, on this system, I couldn't recreate the problem you reported
with either the "using _tkinter directly" instructions, or using this
"C" test program:

#include 
#include 

int main(void) {
Tcl_Interp *trp;
unsetenv("DISPLAY");
trp = Tcl_CreateInterp();
printf("%d\n", Tk_Init(trp));
printf("%d\n", Tk_Init(trp));
return 0;
}

Jeff
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Tkinter lockups.

2006-05-01 Thread Jeff Epler
Thanks Martin!

Jeff
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] getch() in msvcrt does not accept extended characters.

2005-07-05 Thread Jeff Epler
Whatever it is that you need 'getch' to do, can't you incorporate it
first in an extension module you bundle with your application or
library, rather than using the (broken?) wrapper in the msvcrt module?

Jeff


pgpArc0XfxgA7.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Linux Python linking with G++?

2005-07-07 Thread Jeff Epler
If we change the linker back to gcc, not g++, will it work if extension
module 1 gets linked with libstdc++ A and ABI Q, and extension module 2
gets linked with libstdc++ B and ABI Z?

What if a built-in module is written in C++, as it might be for some
people embedding C++? (this will force use of g++ as the linker, right?)

Don't these cases matter too?  Assuming they can fail now, how will
changing the use of CXX as the linker fix them?

Jeff
PS The Python 2.3 and Python 2.4 binaries installed on my Fedora Core
machine don't list libstdc++ in `rpm -q --requires python' or `ldd
/usr/bin/python'.  I don't see a patch that would change Python's
behavior in the SRPM, though.  I wonder what the difference is between
my FC2 and the other systems...


pgpyoOC0ddHmT.pgp
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com