Re: [Python-Dev] Decimal(unicode)

2008-03-28 Thread Nick Coghlan
Greg Ewing wrote:
> Georg Brandl wrote:
> 
>> As Nick said, a drop-in replacement in C isn't feasible
> 
> Yes, but that appears to be so only because of some
> unfortunate features of the Python version's API.
> 
> Seems to me it would be better to undergo a little
> pain now and get a well-designed C-friendly API.

What features do you find particularly unfortunate? Just because 
something isn't particularly amenable to implementation in C, doesn't 
make it a bad API for a Python library (e.g. the dicts to enable/signal 
the different error traps are a natural interface for Python code, even 
though C code would be inclined to use a bit field for the same thing).

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
 http://www.boredomandlaziness.org
___
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] Decimal(unicode)

2008-03-28 Thread Georg Brandl
Mark Dickinson schrieb:
> On Thu, Mar 27, 2008 at 4:46 AM, Georg Brandl <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> As Nick said, a drop-in replacement in C isn't feasible
> 
> But probably users of decimal won't really care if they have to slightly
> adapt their code if they get the speed increase instead.
> 
> 
> Could you give me an example of the sort of adaptations that might be
> necessary, or the API changes that would be necessary to make a
> drop-in replacement possible?
> 
> Are you just talking about things like removing the context argument
> from __add__ and friends, or is it more serious than this?

One thing Nick already said is the handling of signal traps via a
dict with class keys -- with that, it's necessary to check the dict
all the time. Having e.g. a method to set traps would enable the
implementation to work with a bit field.

There were some other things I can't remember right now, but this was
the most problematic one.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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] Windows build bot failure

2008-03-28 Thread Christian Heimes
Some Windows build bots can't compile openssl. The MS assembler fails to
assemble a file. I *think* the issue can be fixed by using nasm32
instead of masm.

Christian

 ml /Cp /coff /c /Cx /Zi /Focrypto\sha\asm\s1_win32.obj
.\crypto\sha\asm\s1_win32.asm
Microsoft (R) Macro Assembler Version 7.10.6030
Copyright (C) Microsoft Corporation.  All rights reserved.
 Assembling: .\crypto\sha\asm\s1_win32.asm
 ml /Cp /coff /c /Cx /Zi /Focrypto\sha\asm\sha512-sse2.obj
.\crypto\sha\asm\sha512-sse2.asm
Microsoft (R) Macro Assembler Version 7.10.6030
Copyright (C) Microsoft Corporation.  All rights reserved.
 Assembling: .\crypto\sha\asm\sha512-sse2.asm
.\crypto\sha\asm\sha512-sse2.asm(29) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(30) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(31) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(32) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(35) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(36) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(37) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(38) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(125) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(138) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(151) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(154) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(155) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(156) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(278) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(279) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(280) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(281) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(282) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(283) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(284) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(285) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(286) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(287) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(288) : error A2006: undefined symbol :
XMMWORD
.\crypto\sha\asm\sha512-sse2.asm(289) : error A2006: undefined symbol :
XMMWORD
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
Executing ms\d32.mak failed
2

Build log was saved at
"file://s:\buildbots\python\2.5.nelson-windows\build\PCbuild\x86-temp-debug\_ssl\BuildLog.htm"
_ssl - 27 error(s), 0 warning(s)

___
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] FreeBSD test suite failure -> curses

2008-03-28 Thread Jeroen Ruigrok van der Werven
-On [20080309 23:59], "Martin v. Löwis" ([EMAIL PROTECTED]) wrote:
>So this now *is* a FreeBSD/ncurses expert's question.

Actually, given my recent results and discussion with Thomas Dickey I am not
so sure.

Some basic debugging I did with Georg Brandl led to this:

comment the requires('curses') line in test_curses.py.

Then start python in the build root with ./pyton; from the interactive
prompt I do import curses and import test.test_curses and python
subsequently coredumps after some screen manipulation. Setting an awatch
with gdb on newscr shows that at one point it gets set to 0.

When I put import curses and import test.test_curses in a file and
subsequently execute this with ./python the test passes without any
problems.

Thomas mentioned after seeing an ltrace:

Perhaps it's failing on that:

curses.setupterm(fd=sys.__stdout__.fileno())

That would have newscr null. The failure might be from closing stdout, e.g.,
if it was redirected.

-- 
Jeroen Ruigrok van der Werven  / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/
We've laid together in the sun before the mind-rape has begun...
___
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] Windows build bot failure

2008-03-28 Thread Jeroen Ruigrok van der Werven
-On [20080328 10:44], Christian Heimes ([EMAIL PROTECTED]) wrote:
>Some Windows build bots can't compile openssl. The MS assembler fails to
>assemble a file. I *think* the issue can be fixed by using nasm32
>instead of masm.

A posting to the OpenSSL list on 2007-10-22:

It's a problem with older versions of MASM.

The following patch works around this issue:

http://cvs.openssl.org/chngview?cn=16708

However MASM is being phased out in OpenSSL (it wont be supported at all in
0.9.9) so you are advised to switch to the free NASM instead which doesn't
have such problems.

(http://www.mail-archive.com/[EMAIL PROTECTED]/msg50725.html)

-- 
Jeroen Ruigrok van der Werven  / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/
Atone me to my throes curtail...
___
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] nested classes leaking in compiler

2008-03-28 Thread Georg Brandl
While preparing the Python-AST compilation patch, I noticed that each
class nested in a class leaks one reference (2.5 and trunk).

It wasn't found by regrtest -R because it only happens on compiling,
and it seems that all snippets compiled during the tests as opposed to
on import didn't contain such a construct.

The AST generation stage is fine, the leak happens somehwere
after that (I suspect the symtable code). It would be nice if someone
who understands more about that code than I do could fix this.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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] [Python-3000] the release gods are angry at python

2008-03-28 Thread skip

Neal> Anything that connects to a remote host is definitely flaky.

Would it maybe help to set up a dedicated host (or virtual host) to serve as
the sole target of all network tests?

Skip
___
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] Summary of Tracker Issues

2008-03-28 Thread Tracker

ACTIVITY SUMMARY (03/21/08 - 03/28/08)
Tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue 
number.  Do NOT respond to this message.


 1794 open (+40) / 12535 closed (+18) / 14329 total (+58)

Open issues with patches:   528

Average duration of open issues: 715 days.
Median duration of open issues: 1243 days.

Open Issues Breakdown
   open  1770 (+40)
pending24 ( +0)

Issues Created Or Reopened (58)
___

2to3 translates "import foobar" to "import .foobar" rather than  03/21/08
   http://bugs.python.org/issue2446created  dangyogi  
   

Python 2.6 refleak test issues   03/21/08
   http://bugs.python.org/issue2447created  tiran 
   

namedtuple breaks refleak tests  03/21/08
   http://bugs.python.org/issue2448created  tiran 
   

Improved serialization error logging in xmlrpclib03/21/08
   http://bugs.python.org/issue2449created  blunck2   
   

urllib2.Request constructor has no timeout parameter 03/21/08
CLOSED http://bugs.python.org/issue2450created  jjlee 
   

No way to disable socket timeouts in httplib, etc.   03/27/08
   http://bugs.python.org/issue2451reopened facundobatista
   

inaccuracy in httplib timeout documentation  03/21/08
   http://bugs.python.org/issue2452created  jjlee 
   

fix_except needs to allow for empty excepts  03/22/08
CLOSED http://bugs.python.org/issue2453created  loewis
   

sha and md5 fixer03/22/08
   http://bugs.python.org/issue2454created  loewis
   

stat.ST_CTIME and stat.ST_ATIME problem  03/22/08
   http://bugs.python.org/issue2455created  sassas
   

Make sysmodule.c compatible with Bazaar  03/22/08
   http://bugs.python.org/issue2456created  barry 
   

add --help and -h options to pdb 03/22/08
CLOSED http://bugs.python.org/issue2457created  benjamin.peterson 
   patch   

Allow Python code to change Py3k warning flag03/22/08
   http://bugs.python.org/issue2458created  benjamin.peterson 
   patch   

speedup loops with better bytecode   03/22/08
   http://bugs.python.org/issue2459created  pitrou
   patch   

Ellipsis not copyable03/22/08
CLOSED http://bugs.python.org/issue2460created  aronacher 
   patch   

test_util.py for distutils   03/23/08
   http://bugs.python.org/issue2461created  tarek 
   patch   

python.exe slowing my system 03/23/08
CLOSED http://bugs.python.org/issue2462created  FireSnake 
   

python.exe slowing my system 03/23/08
CLOSED http://bugs.python.org/issue2463created  FireSnake 
   

urllib2 can't handle http://www.wikispaces.com   03/23/08
   http://bugs.python.org/issue2464created  weijie90  
   

sphinx-quickstart.py still creates makefile even if u

Re: [Python-Dev] nested classes leaking in compiler

2008-03-28 Thread Amaury Forgeot d'Arc
On Fri, Mar 28, 2008 at 11:50 AM, Georg Brandl <[EMAIL PROTECTED]> wrote:
> While preparing the Python-AST compilation patch, I noticed that each
>  class nested in a class leaks one reference (2.5 and trunk).
>
>  It wasn't found by regrtest -R because it only happens on compiling,
>  and it seems that all snippets compiled during the tests as opposed to
>  on import didn't contain such a construct.
>
>  The AST generation stage is fine, the leak happens somehwere
>  after that (I suspect the symtable code). It would be nice if someone
>  who understands more about that code than I do could fix this.

The problem is actually in compile.c, in compiler_class():
Each compilation scope holds the name of the enclosing class (for
__name mangling).
In the case of nested classes, the inner scope is first initialized
with the outer class name, then replaced with the inner class name.
But a Py_XDECREF(c->u->u_private) is missing here...

I will submit the correction in a few hours.

-- 
Amaury Forgeot d'Arc
___
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] [Python-3000] the release gods are angry at python

2008-03-28 Thread Neal Norwitz
On Fri, Mar 28, 2008 at 3:31 AM,  <[EMAIL PROTECTED]> wrote:
>
> Neal> Anything that connects to a remote host is definitely flaky.
>
>  Would it maybe help to set up a dedicated host (or virtual host) to serve as
>  the sole target of all network tests?

It would help, but not fix the problem.  There will still be transient
network issues that come up.

n
___
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] Removing callable() from the stdlib

2008-03-28 Thread Collin Winter
I've been running 2to3's fix_callable over 2.6's stdlib to remove -3
warnings due to callable() usage; 2to3 replaces callable(x) with
has_attr(x, "__call__"). Unfortunately, this breaks code that wants to
run callable() on old-style classes (like test_builtin), because
old-style classes don't have a __call__ attribute (new-style classes
do, however).

How should this be handled? I'm tempted to just add __call__ to
old-style classes for 2.6, but Neal Norwitz thought that might break
some user code. Any other thoughts?

Collin Winter
___
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] [Python-3000] the release gods are angry at python

2008-03-28 Thread Bill Janssen
> On Fri, Mar 28, 2008 at 3:31 AM,  <[EMAIL PROTECTED]> wrote:
> >
> > Neal> Anything that connects to a remote host is definitely flaky.
> >
> >  Would it maybe help to set up a dedicated host (or virtual host) to serve 
> > as
> >  the sole target of all network tests?
> 
> It would help, but not fix the problem.  There will still be transient
> network issues that come up.

We really need to be able to wrap a timeout around any individual
test, perhaps throwing a TimeoutException if the timeout is reached,
and have the ability to regard a TimeoutException as not being a
"failure".

Bill
___
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] nested classes leaking in compiler

2008-03-28 Thread Georg Brandl
Amaury Forgeot d'Arc schrieb:
> On Fri, Mar 28, 2008 at 11:50 AM, Georg Brandl <[EMAIL PROTECTED]> wrote:
>> While preparing the Python-AST compilation patch, I noticed that each
>>  class nested in a class leaks one reference (2.5 and trunk).
>>
>>  It wasn't found by regrtest -R because it only happens on compiling,
>>  and it seems that all snippets compiled during the tests as opposed to
>>  on import didn't contain such a construct.
>>
>>  The AST generation stage is fine, the leak happens somehwere
>>  after that (I suspect the symtable code). It would be nice if someone
>>  who understands more about that code than I do could fix this.
> 
> The problem is actually in compile.c, in compiler_class():
> Each compilation scope holds the name of the enclosing class (for
> __name mangling).
> In the case of nested classes, the inner scope is first initialized
> with the outer class name, then replaced with the inner class name.
> But a Py_XDECREF(c->u->u_private) is missing here...
> 
> I will submit the correction in a few hours.

Somehow I knew you'd be the one to find the problem :)

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
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] Removing callable() from the stdlib

2008-03-28 Thread Guido van Rossum
On Fri, Mar 28, 2008 at 10:51 AM, Collin Winter <[EMAIL PROTECTED]> wrote:
> I've been running 2to3's fix_callable over 2.6's stdlib to remove -3
>  warnings due to callable() usage; 2to3 replaces callable(x) with
>  has_attr(x, "__call__"). Unfortunately, this breaks code that wants to
>  run callable() on old-style classes (like test_builtin), because
>  old-style classes don't have a __call__ attribute (new-style classes
>  do, however).
>
>  How should this be handled? I'm tempted to just add __call__ to
>  old-style classes for 2.6, but Neal Norwitz thought that might break
>  some user code. Any other thoughts?

I don't see how this would break user code, as long as the __call__
shows up for the *class* but not for the *instance*, and as long as it
doesn't break users overriding __call__ in a classic class to make the
instances callable.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
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] Removing callable() from the stdlib

2008-03-28 Thread Collin Winter
On Fri, Mar 28, 2008 at 12:58 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>
> On Fri, Mar 28, 2008 at 10:51 AM, Collin Winter <[EMAIL PROTECTED]> wrote:
>  > I've been running 2to3's fix_callable over 2.6's stdlib to remove -3
>  >  warnings due to callable() usage; 2to3 replaces callable(x) with
>  >  has_attr(x, "__call__"). Unfortunately, this breaks code that wants to
>  >  run callable() on old-style classes (like test_builtin), because
>  >  old-style classes don't have a __call__ attribute (new-style classes
>  >  do, however).
>  >
>  >  How should this be handled? I'm tempted to just add __call__ to
>  >  old-style classes for 2.6, but Neal Norwitz thought that might break
>  >  some user code. Any other thoughts?
>
>  I don't see how this would break user code, as long as the __call__
>  shows up for the *class* but not for the *instance*, and as long as it
>  doesn't break users overriding __call__ in a classic class to make the
>  instances callable.

Yep, I was only going to make it appear on the class. I'll go ahead
and whip up a patch.

Collin
___
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] Decimal(unicode)

2008-03-28 Thread Greg Ewing
Nick Coghlan wrote:

> What features do you find particularly unfortunate?

Whichever ones are making people think that implementing
it in C is infeasible.

> Just because 
> something isn't particularly amenable to implementation in C, doesn't 
> make it a bad API for a Python library

No, but for something like a number type, which benefits
greatly from speed, making it actively C-hostile doesn't
seem like a good idea.

> (e.g. the dicts to enable/signal 
> the different error traps are a natural interface for Python code

I don't see why there can't be an object with a mapping
interface for this, that stores them internally as a
bit field or whatever is convenient for the C code.

-- 
Greg

___
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] [Python-3000] the release gods are angry at python

2008-03-28 Thread Jeffrey Yasskin
On Fri, Mar 28, 2008 at 11:15 AM, Bill Janssen <[EMAIL PROTECTED]> wrote:
> > On Fri, Mar 28, 2008 at 3:31 AM,  <[EMAIL PROTECTED]> wrote:
>  > >
>  > > Neal> Anything that connects to a remote host is definitely flaky.
>  > >
>  > >  Would it maybe help to set up a dedicated host (or virtual host) to 
> serve as
>  > >  the sole target of all network tests?
>  >
>  > It would help, but not fix the problem.  There will still be transient
>  > network issues that come up.
>
>  We really need to be able to wrap a timeout around any individual
>  test, perhaps throwing a TimeoutException if the timeout is reached,
>  and have the ability to regard a TimeoutException as not being a
>  "failure".

Something like:

@contextmanager
def timeout(max_time):
def RaiseTimeout(signal, frame):
raise TimeoutException
# Why don't we have a context manager for the next line?
old_alarm = signal.signal(signal.SIGALRM, RaiseTimeout)
try:
signal.alarm(max_time)
try:
yield
finally:
signal.alarm(0)
finally:
signal.signal(signal.SIGALRM, old_alarm)

with appropriate fallbacks for Windows. I may not be poking at
test_support for a bit, so anyone else is welcome to check that in, or
a fixed version of it, whenever they're fixing a timing-out test.

Someone else will have to implement the support in regrtest, although
I wouldn't mind having it treat a timeout as a failure, as long as
it's easier to diagnose than the SIGKILL it currently uses for
timeouts.

-- 
Namasté,
Jeffrey Yasskin
___
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