Re: [Python-Dev] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis
Bill Janssen wrote:
> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> which makes sense, because it's running as a background twisted process,
> and thus can't access the window server.

It doesn't really make sense. It should skip the test, instead of
failing it. I.e. aborting the Python process is definitely not a good
response.

Regards,
Martin
___
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] Possible patch for functools partial - Interested?

2010-05-13 Thread Yaniv Aknin
I'm never certain where to reply in such a case, on the list or on the
issue, but since no one is nosy yet to Daniel's patch, I thought I'd ask
here.

While a partial object should reasonably never change, you could change it:
>>> from functools import partial
>>> p = partial(lambda *a, **kw: kw, 1, 2, spam='eggs')
>>> p()
{'spam': 'eggs'}
>>> p.keywords['spam'] = 'bacon'
>>> p()
{'spam': 'bacon'}
>>>

I realize touching p.keywords voids your warranty, but if we can stop people
from doing it, maybe we should (or at least put a warning in the
documentation, no?). So I'm thinking either we make an immutable/hashable
dict while we're at it, or store the keyword arguments as a tuple (which
guarantees immutability), and only convert them back to a dict when you want
to call the partial object (simpler, slower).

Your thoughts? Should we continue this discussion at issue8699?

 - Yaniv

On Thu, May 13, 2010 at 1:11 AM, Daniel Urban  wrote:

> On Fri, May 7, 2010 at 17:02, Antoine Pitrou  wrote:
> > It would be more useful to provide equality, hashing and repr to partial
> itself,
> > rather than a subclass. Feel free to propose a patch :)
>
> Hi!
>
> I've done that.
> I've opened a feature request: http://bugs.python.org/issue8699
> The patch is also at Rietveld: http://codereview.appspot.com/1179044
>
> I'm a beginner, so my patch is probably far from perfect, but I'd
> appreciate any help, and will try to correct my mistakes.
>
> Thanks,
> Daniel Urban
> ___
> Python-Dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/yaniv%40aknin.name
>
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Nick Coghlan
Bill Janssen wrote:
> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> which makes sense, because it's running as a background twisted process,
> and thus can't access the window server.  I should configure that out.
> 
> I'm looking for documentation on how to configure the build slave so
> that it skips this test.

It may be better to try to detect the "no window server" case and skip
it in the test itself rather than in the build slave configuration.

Cheers,
Nick.


-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
---
___
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] Possible patch for functools partial - Interested?

2010-05-13 Thread Steven D'Aprano
On Thu, 13 May 2010 06:50:02 pm Yaniv Aknin wrote:
> I'm never certain where to reply in such a case, on the list or on
> the issue, but since no one is nosy yet to Daniel's patch, I thought
> I'd ask here.
>
> While a partial object should reasonably never change, you could 
change it:
[...]
> I realize touching p.keywords voids your warranty, but if we can stop
> people from doing it, maybe we should (or at least put a warning in
> the documentation, no?). 

Modifying partial.keywords will almost certainly effect hashing, so I 
think this is relevant to the patch.



> So I'm thinking either we make an 
> immutable/hashable dict while we're at it, or store the keyword
> arguments as a tuple (which guarantees immutability), and only
> convert them back to a dict when you want to call the partial object
> (simpler, slower).

I'd support an immutable dict. partial objects already impose a 
significant (~ 30%) performance penalty:

>>> from timeit import Timer
>>> min(Timer('f(5)', 'f = lambda x: x').repeat())
0.93580079078674316
>>> min(Timer('p(5)', 'from functools import partial; p = partial(lambda 
x: x)').repeat())
1.2715129852294922

No need to make that worse if that can be avoided.



-- 
Steven D'Aprano
___
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] Possible patch for functools partial - Interested?

2010-05-13 Thread Daniel Urban
> While a partial object should reasonably never change, you could change it:
 from functools import partial
 p = partial(lambda *a, **kw: kw, 1, 2, spam='eggs')
 p()
> {'spam': 'eggs'}
 p.keywords['spam'] = 'bacon'
 p()
> {'spam': 'bacon'}

> I realize touching p.keywords voids your warranty, but if we can stop people
> from doing it, maybe we should (or at least put a warning in the
> documentation, no?). So I'm thinking either we make an immutable/hashable
> dict while we're at it, or store the keyword arguments as a tuple (which
> guarantees immutability), and only convert them back to a dict when you want
> to call the partial object (simpler, slower).

You're right. I think it is possible to stop people from modifying
p.keywords. If p.keywords wouldn't be a dict, but a read-only proxy
for that dict, that may solve this problem. I think that is possible,
with PyDictProxy_New [1]. But I'm not certain if that is a good idea,
it may have side effects I'm not aware of. Any thoughts about this?

> Your thoughts? Should we continue this discussion at issue8699?
I don't know, I'm new here...

[1] http://docs.python.org/py3k/c-api/dict.html#PyDictProxy_New

Thanks,
Daniel Urban
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread exarkun

On 03:17 am, [email protected] wrote:

I've got parc-tiger-1 up and running again.  It's failing on test_tk,
which makes sense, because it's running as a background twisted 
process,

and thus can't access the window server.  I should configure that out.


You can run it in an xvfb.

Jean-Paul
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis
>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
>> which makes sense, because it's running as a background twisted process,
>> and thus can't access the window server.  I should configure that out.
>>
>> I'm looking for documentation on how to configure the build slave so
>> that it skips this test.
> 
> It may be better to try to detect the "no window server" case and skip
> it in the test itself rather than in the build slave configuration.

Even better would be if Python wouldn't crash when you try to run Tk
commands without a window server. Instead of aborting Python, that
should raise an exception (which can then be detected as a test skip).

Regards,
Martin
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis
[email protected] wrote:
> On 03:17 am, [email protected] wrote:
>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
>> which makes sense, because it's running as a background twisted process,
>> and thus can't access the window server.  I should configure that out.
> 
> You can run it in an xvfb.

But that's beside the point! The slave configuration detected a bug in
Python, so rather than working around the bug by modifying the slave
configuration, the bug should get fixed.

Of course, the slave is then useless until somebody contributes such a fix.

Regards,
Martin
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Paul Moore
On 13 May 2010 15:43, "Martin v. Löwis"  wrote:
> Of course, the slave is then useless until somebody contributes such a fix.

That's the sad part. If there was a means of temporarily marking the
test on a particular slave as a known issue, it would avoid a single
bug rendering a buildslave useless...

(Having said that, a similar situation with my buildslave prompted me
to spend the time fixing the bug so I didn't have to keep restarting
the slave, so maybe it's a good thing after all :-))

Paul.
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis
> (Having said that, a similar situation with my buildslave prompted me
> to spend the time fixing the bug so I didn't have to keep restarting
> the slave, so maybe it's a good thing after all :-))

Indeed. More generally, I'd question the point of automated testing if
people try to work around serious problems rather than fixing them. And
an interpreter crash in the test suite *is* a serious problem, IMO.

Of course, it may turn out to be an unfixable Tcl or Apple bug, in which
case working around would become more interesting.

Regards,
Martin
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Bill Janssen
Martin v. Löwis  wrote:

> Bill Janssen wrote:
> > I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> > which makes sense, because it's running as a background twisted process,
> > and thus can't access the window server.
> 
> It doesn't really make sense. It should skip the test, instead of
> failing it. I.e. aborting the Python process is definitely not a good
> response.

Yes, you're right.  It's a bug in the test.

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] configuring the buildbot to skip some tests?

2010-05-13 Thread Glyph Lefkowitz

On May 13, 2010, at 9:41 AM, [email protected] wrote:

> On 03:17 am, [email protected] wrote:
>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
>> which makes sense, because it's running as a background twisted process,
>> and thus can't access the window server.  I should configure that out.
> 
> You can run it in an xvfb.

See 
:
 this isn't an X server that he's talking about, it's "WindowServer", the OS X 
windowing system, so Xvfb won't help.___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Bill Janssen
[email protected] wrote:

> On 03:17 am, [email protected] wrote:
> >I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> > which makes sense, because it's running as a background twisted
> > process,
> >and thus can't access the window server.  I should configure that out.
> 
> You can run it in an xvfb.

I don't think that would work -- it's a Mac.

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] PEP 7 updated

2010-05-13 Thread Brett Cannon
Feel free to look at Misc/Vim/python.vim and see if this works better
than what is already there.

On Wed, May 12, 2010 at 20:47, Trent Nelson  wrote:
>
>> Does anyone know of a way to teach vim that C sources in a python checkout
>> should have 4-space indents without changing the defaults for other C files?
>
> I use this in my vimrc:
>
> ""
> " indentation: use detectindent plugin if possible
> ""
> set autoindent
> set smartindent
> try
>    let g:detectindent_preferred_expandtab = 1
>    let g:detectindent_preferred_tabsize = 8
>    let g:detectindent_preferred_indent = 4
>
>    source $VIMRUNTIME/plugin/detectindent.vim
>    au BufNewFile,BufRead * .* DetectIndent
> catch
>    set smarttab
>    set expandtab
>    set tabstop=8
>    set shiftwidth=4
>    set softtabstop=4
>    set textwidth=80
> endtry
>
> *** And this is plugin/detectindent.vim:
>
> " Name:          detectindent (global plugin)
> " Version:       1.0
> " Author:        Ciaran McCreesh 
> " Updates:       http://dev.gentoo.org/~ciaranm/vim/
> " Purpose:       Detect file indent settings
> "
> " License:       You may redistribute this plugin under the same terms as
> Vim
> "                itself.
> "
> " Usage:         :DetectIndent
> "
> "                " to prefer expandtab to noexpandtab when detection is
> "                " impossible:
> "                :let g:detectindent_preferred_expandtab = 1
> "
> "                " to set a preferred indent level when detection is
> "                " impossible:
> "                :let g:detectindent_preferred_indent = 4
> "
> " Requirements:  Untested on Vim versions below 6.2
>
> fun! IsCommentStart(line)
>    " &comments isn't reliable
>    if &ft == "c" || &ft == "cpp"
>        return -1 != match(a:line, '/\*')
>    else
>        return 0
>    endif
> endfun
>
> fun! IsCommentEnd(line)
>    if &ft == "c" || &ft == "cpp"
>        return -1 != match(a:line, '\*/')
>    else
>        return 0
>    endif
> endfun
>
> fun! DetectIndent()
>    let l:has_leading_tabs            = 0
>    let l:has_leading_spaces          = 0
>    let l:shortest_leading_spaces_run = 0
>    let l:longest_leading_spaces_run  = 0
>
>    let l:idx_end = line("$")
>    let l:idx = 1
>    while l:idx <= l:idx_end
>        let l:line = getline(l:idx)
>
>        " try to skip over comment blocks, they can give really screwy indent
>        " settings in c/c++ files especially
>        if IsCommentStart(l:line)
>            while l:idx <= l:idx_end && ! IsCommentEnd(l:line)
>                let l:line = getline(l:idx)
>                let l:idx = l:idx + 1
>            endwhile
>            let l:idx = l:idx + 1
>            continue
>        endif
>
>        let l:leading_char = strpart(l:line, 0, 1)
>
>        if l:leading_char == "\t"
>            let l:has_leading_tabs = 1
>
>        elseif l:leading_char == " "
>            " only interested if we don't have a run of spaces followed by a
>            " tab.
>            if -1 == match(l:line, '^ \+\t')
>                let l:has_leading_spaces = 1
>                let l:spaces = strlen(matchstr(l:line, '^ \+'))
>                if l:shortest_leading_spaces_run == 0 ||
>                            \ l:spaces < l:shortest_leading_spaces_run
>                    let l:shortest_leading_spaces_run = l:spaces
>                endif
>                if l:spaces > l:longest_leading_spaces_run
>                    let l:longest_leading_spaces_run = l:spaces
>                endif
>            endif
>
>        endif
>
>        let l:idx = l:idx + 1
>    endwhile
>
>    if l:has_leading_tabs && ! l:has_leading_spaces
>        " tabs only, no spaces
>        set noexpandtab
>        if exists("g:detectindent_preferred_tabsize")
>            let &shiftwidth  = g:detectindent_preferred_indent
>            let &tabstop     = g:detectindent_preferred_indent
>        endif
>
>    elseif l:has_leading_spaces && ! l:has_leading_tabs
>        " spaces only, no tabs
>        set expandtab
>        let &shiftwidth  = l:shortest_leading_spaces_run
>
>    elseif l:has_leading_spaces && l:has_leading_tabs
>        " spaces and tabs
>        set noexpandtab
>        let &shiftwidth = l:shortest_leading_spaces_run
>
>        " , time to guess how big tabs are
>        if l:longest_leading_spaces_run < 2
>            let &tabstop = 2
>        elseif l:longest_leading_spaces_run < 4
>            let &tabstop = 4
>        else
>            let &tabstop = 8
>        endif
>
>    else
>        " no spaces, no tabs
>        if exists("g:detectindent_preferred_tabsize")
>            let &shiftwidth  = g:detectindent_preferred_indent
>            let &tabstop     = g:detectindent_preferred_indent
>        endif
>        if exists("g:detectindent_preferred_expandtab")
>            set expandtab
>        endif
>
>    endif
> endfun
>
> command! 

Re: [Python-Dev] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis
Bill Janssen wrote:
> Martin v. Löwis  wrote:
> 
>> Bill Janssen wrote:
>>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
>>> which makes sense, because it's running as a background twisted process,
>>> and thus can't access the window server.
>> It doesn't really make sense. It should skip the test, instead of
>> failing it. I.e. aborting the Python process is definitely not a good
>> response.
> 
> Yes, you're right.  It's a bug in the test.

No, I'd say it's even deeper, in the Tcl integration.

There shouldn't be a way to cause an interpreter abort, except by
calling os.abort().

Regards,
Martin
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Ronald Oussoren

On 13 May, 2010, at 20:41, Martin v. Löwis wrote:

> Bill Janssen wrote:
>> Martin v. Löwis  wrote:
>> 
>>> Bill Janssen wrote:
 I've got parc-tiger-1 up and running again.  It's failing on test_tk,
 which makes sense, because it's running as a background twisted process,
 and thus can't access the window server.
>>> It doesn't really make sense. It should skip the test, instead of
>>> failing it. I.e. aborting the Python process is definitely not a good
>>> response.
>> 
>> Yes, you're right.  It's a bug in the test.
> 
> No, I'd say it's even deeper, in the Tcl integration.
> 
> There shouldn't be a way to cause an interpreter abort, except by
> calling os.abort().

This is a bug in Tk: 

>>> root = Tkinter.Tk()
Thu May 13 20:45:13 Rivendell.local python[84887] : kCGErrorFailure: Set 
a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the 
WindowServer, _CGSDefaultConnection() is NULL.
>>> 2010-05-13 20:45:16.751 Python[84887:d07] An uncaught exception was raised
2010-05-13 20:45:16.762 Python[84887:d07] Error (1002) creating CGSWindow
2010-05-13 20:45:16.955 Python[84887:d07] *** Terminating app due to uncaught 
exception 'NSInternalInconsistencyException', reason: 'Error (1002) creating 
CGSWindow'
*** Call stack at first throw:
(
0   CoreFoundation  0x7fff85e31d24 
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x7fff86f3 
objc_exception_throw + 45
2   CoreFoundation  0x7fff85e31b47 
+[NSException raise:format:arguments:] + 103
3   CoreFoundation  0x7fff85e31ad4 
+[NSException raise:format:] + 148
4   AppKit  0x7fff84614aba 
_NSCreateWindowWithOpaqueShape2 + 473
5   AppKit  0x7fff845a9055 -[NSWindow 
_commonAwake] + 1214
6   AppKit  0x7fff845c6d3d -[NSWindow 
_makeKeyRegardlessOfVisibility] + 96
7   AppKit  0x7fff845c6cb2 -[NSWindow 
makeKeyAndOrderFront:] + 24
8   Tk  0x00010075b86c XMapWindow + 
155
9   Tk  0x0001006ca6d0 Tk_MapWindow 
+ 89
10  Tk  0x0001006d35e6 
TkToplevelWindowForCommand + 2658
11  Tcl 0x0001006300d3 
TclServiceIdle + 76
12  Tcl 0x0001006162ce 
Tcl_DoOneEvent + 329
13  _tkinter.so 0x000100595683 
Tkapp_CallDeallocArgs + 277
14  readline.so 0x0001001f1f9a initreadline 
+ 1280
15  Python  0x000176a1 
PyOS_Readline + 239
16  Python  0x00018a57 
PyTokenizer_FromString + 1322
17  Python  0x000190a0 
PyTokenizer_Get + 154
18  Python  0x00015698 
PyParser_AddToken + 1018
19  Python  0x0001000a2320 
PyParser_ASTFromFile + 146
20  Python  0x0001000a443f 
PyRun_InteractiveOneFlags + 345
21  Python  0x0001000a4615 
PyRun_InteractiveLoopFlags + 206
22  Python  0x0001000a4685 
PyRun_AnyFileExFlags + 76
23  Python  0x0001000b0286 Py_Main + 
2718
24  Python  0x00010e6c start + 52
25  ??? 0x0001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Abort trap


This is running /usr/bin/python in a session as a user that doesn't have access 
to the GUI.  The text above says that there is an uncaught ObjC exception, 
caused by the lack of a connection to the window server. Tk should have 
converted that to its own style of errors but didn't.

Bill: could you please file an issue for this in the python tracker, it should 
be possible to add a workaround for this to the Tkinter extension.

Ronald



smime.p7s
Description: S/MIME cryptographic 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] configuring the buildbot to skip some tests?

2010-05-13 Thread Martin v. Löwis

> This is running /usr/bin/python in a session as a user that doesn't
> have access to the GUI.  The text above says that there is an
> uncaught ObjC exception, caused by the lack of a connection to the
> window server. Tk should have converted that to its own style of
> errors but didn't.

That makes sense to me; thanks for investigating it.

If we are kind, we could also file a Tk bug, then.

Regards,
Martin
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Bill Janssen
Martin v. Löwis  wrote:

> Bill Janssen wrote:
> > Martin v. Löwis  wrote:
> > 
> >> Bill Janssen wrote:
> >>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> >>> which makes sense, because it's running as a background twisted process,
> >>> and thus can't access the window server.
> >> It doesn't really make sense. It should skip the test, instead of
> >> failing it. I.e. aborting the Python process is definitely not a good
> >> response.
> > 
> > Yes, you're right.  It's a bug in the test.
> 
> No, I'd say it's even deeper, in the Tcl integration.
> 
> There shouldn't be a way to cause an interpreter abort, except by
> calling os.abort().

There are some cases where the OS X security mechanism interprets an
invalid attempt to connect to the window server as a privilege
violation, and just terminates the process.  I've seen that before.

This is basically a resource issue in the testing framework, too, like
having network access.  The problem is, for lot of external libraries,
it's not clear just what resources they assume are available.  If we
believe that Tk doesn't intend to require access to the window server,
it's a Tk bug.  If we know that it does, it's a resource issue.

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] configuring the buildbot to skip some tests?

2010-05-13 Thread Bill Janssen
Martin v. Löwis  wrote:

> Bill Janssen wrote:
> > Martin v. Löwis  wrote:
> > 
> >> Bill Janssen wrote:
> >>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
> >>> which makes sense, because it's running as a background twisted process,
> >>> and thus can't access the window server.
> >> It doesn't really make sense. It should skip the test, instead of
> >> failing it. I.e. aborting the Python process is definitely not a good
> >> response.
> > 
> > Yes, you're right.  It's a bug in the test.
> 
> No, I'd say it's even deeper, in the Tcl integration.
> 
> There shouldn't be a way to cause an interpreter abort, except by
> calling os.abort().

Yes, I agree.  It's an undesirable design bug in the Apple OS, IMO.
When some Apple libraries ask for some things that they're not allowed
to have, the library calls abort() instead of signalling an error.

Google for "FAILED TO GET ASN FROM CORESERVICES" sometime.

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] configuring the buildbot to skip some tests?

2010-05-13 Thread Nick Coghlan
Martin v. Löwis wrote:
>>> I've got parc-tiger-1 up and running again.  It's failing on test_tk,
>>> which makes sense, because it's running as a background twisted process,
>>> and thus can't access the window server.  I should configure that out.
>>>
>>> I'm looking for documentation on how to configure the build slave so
>>> that it skips this test.
>> It may be better to try to detect the "no window server" case and skip
>> it in the test itself rather than in the build slave configuration.
> 
> Even better would be if Python wouldn't crash when you try to run Tk
> commands without a window server. Instead of aborting Python, that
> should raise an exception (which can then be detected as a test skip).

Yes, when I commented I didn't realise that "failing" in this case
actually meant "crashing" :P

Regards,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
---
___
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] Possible patch for functools partial - Interested?

2010-05-13 Thread Daniel Urban
I wrote an e-mail yesterday, but it seems, it didn't reach python-dev.
Here it is again:

On Thu, May 13, 2010 at 13:30, Steven D'Aprano  wrote:
> I'd support an immutable dict. partial objects already impose a
> significant (~ 30%) performance penalty:
>
 from timeit import Timer
 min(Timer('f(5)', 'f = lambda x: x').repeat())
> 0.93580079078674316
 min(Timer('p(5)', 'from functools import partial; p = partial(lambda
> x: x)').repeat())
> 1.2715129852294922
>
> No need to make that worse if that can be avoided.

I've made a new patch, in which the keywords attribute is a read-only
proxy of the dictionary. I've used your benchmark, and I haven't found
any significant difference in execution times.
The patch is in the tracker (http://bugs.python.org/issue8699) and
Rietveld (http://codereview.appspot.com/1179044).


Daniel Urban
___
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] configuring the buildbot to skip some tests?

2010-05-13 Thread Vincent Davis
Not to interrupt you  you conversation but I am interested in setting
up a buildbot on one of my Macs. Is there any documentations or advise
that is different from that of a linux machine?  Any advise would be
appreciated.
Thanks
Vincent


On Thu, May 13, 2010 at 3:44 PM, Nick Coghlan  wrote:
> Martin v. Löwis wrote:
 I've got parc-tiger-1 up and running again.  It's failing on test_tk,
 which makes sense, because it's running as a background twisted process,
 and thus can't access the window server.  I should configure that out.

 I'm looking for documentation on how to configure the build slave so
 that it skips this test.
>>> It may be better to try to detect the "no window server" case and skip
>>> it in the test itself rather than in the build slave configuration.
>>
>> Even better would be if Python wouldn't crash when you try to run Tk
>> commands without a window server. Instead of aborting Python, that
>> should raise an exception (which can then be detected as a test skip).
>
> Yes, when I commented I didn't realise that "failing" in this case
> actually meant "crashing" :P
>
> Regards,
> Nick.
>
> --
> Nick Coghlan   |   [email protected]   |   Brisbane, Australia
> ---
> ___
> Python-Dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-dev/vincent%40vincentdavis.net
>
___
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