[issue5703] inside *currentmodule* some links is disabled

2009-04-13 Thread Georg Brandl

Georg Brandl  added the comment:

If you want that level of control, it may be better to just write
:meth:`Message.add_header() `.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5730] setdefault speedup

2009-04-13 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

> The missing key reports the default object, but doesn't set that key  
> or value object in the dict.

That's just not true. Re-read the line in the doc string where it
puts the default value into the dict, under the key being accessed.

> For example, to represent a graph structure, it is helpful to use a  
> dict-of-dicts.

No problem:

py> from collections import defaultdict
py> weights=defaultdict(dict)
py> weights['a']['b']=17
py> weights['a']['c']=5
py> weights['a']
{'c': 5, 'b': 17}

See? It remembered the default value, and the value for the 'a'
key got changed and can now be modified. The whole point of defaultdict
was to replace setdefault, so that setdefault can eventually be
eliminated, see

http://mail.python.org/pipermail/python-dev/2006-February/061169.html
http://mail.python.org/pipermail/python-dev/2006-February/061261.html

Apparently, the plan for removing setdefault is now forgotten. Perhaps
this would be a good time to revive it, with a proper deprecation
procedure. If it is to be removed, I'm -1 for "fixing" anything about
it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5706] setuptools doesn't honor standard compiler variables

2009-04-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

You can submit an entry at http://bugs.python.org/setuptools.

Although, what you mean by "distutils does support the environment
variables properly"

--
components: +Distutils -Installation
versions:  -Python 2.4, Python 2.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5735] Segfault when loading not recompiled module

2009-04-13 Thread Tarek Ziadé

Changes by Tarek Ziadé :


--
assignee: tarek -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5741] SafeConfigParser incorrectly detects lone percent signs

2009-04-13 Thread Márcio Faustino

Márcio Faustino  added the comment:

Shouldn't the "replace('%%', '')" take place before 
"_interpvar_re.sub"? For example, the value "%%(test)s" should be 
accepted as valid but it isn't because "_interpvar_re" has already 
changed it to "%".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5741] SafeConfigParser incorrectly detects lone percent signs

2009-04-13 Thread Georg Brandl

Georg Brandl  added the comment:

You're right, of course. Fixed in r71564.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5607] Lib/distutils/test/test_util: test_get_platform bogus for OSX

2009-04-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

fixed in r71560 and r71565.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5736] Add the iterator protocol to dbm modules

2009-04-13 Thread Martin v. Löwis

Martin v. Löwis  added the comment:

I agree with Skip that using a static variable is not appropriate. The
proper solution probably would be to define a separate gdbm_iter object
which always preserves the last key returned.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5745] email document update (more links)

2009-04-13 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, committed in r71572.

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5736] Add the iterator protocol to dbm modules

2009-04-13 Thread Akira Kitada

Akira Kitada  added the comment:

Yes, using a static variable there is wrong and
actually I'm now working on "dbm_iterobject" just as Martin suggested.

dbm iterator should behave just like one in dict.
I think I can use Objects/dictobject.c as a good example for this.

Attached is minimal tests for dbm iterator.

--
Added file: http://bugs.python.org/file13682/test_issue5736.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5724] 2.6.2c1 fails to pass test_cmath on Solaris10

2009-04-13 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

We'll omit this for 2.6.2.  Mark, please feel free to apply it once
2.6.2 is released so that it makes it into 2.6.3.

--
priority: release blocker -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5724] 2.6.2c1 fails to pass test_cmath on Solaris10

2009-04-13 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Accepted for 2.6.3.

--
resolution:  -> accepted

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5747] knowing the parent command

2009-04-13 Thread Tarek Ziadé

New submission from Tarek Ziadé :

Right now there's no way in a command to know that it was launched as a
subcommand from another command.

For instance every install_* command knows explicitely that it is
launched as a subcommand of 'install' and takes back its options in
finalize_options() using set_undefined_options().

For commands that might be used as subcommands of several commands, we
need to pass the name of the parent command to finalize_options() so 
we can call set_undefined_options() without knowing explicitely the name
of the parent command.

This will be done by adding an optional parameter called
'parent_command', to run_command(), then to ensure_finalized() and to
finalized_options().

The first use case of this will be the check command, that will be used
by "register" and "sdist".

This change will be backward compatible with the existing commands and
ths new parameter optional

--
assignee: tarek
components: Distutils
messages: 85950
nosy: tarek
priority: normal
severity: normal
status: open
title: knowing the parent command
type: feature request
versions: Python 2.7, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5746] socketserver problem upon disconnection (undefined member)

2009-04-13 Thread Victor Godoy Poluceno

Victor Godoy Poluceno  added the comment:

Can you provide a small example of this error?

This problem seems only occurer when a subclass of
socketserver.StreamRequestHandler provide a blank method "setup".

In your log error:

>> AttributeError: 'RequestHandler' object has no attribute 'wfile'

The class 'RequestHandler' is a subclass of
socketserver.StreamRequestHandler?

--
nosy: +victorpoluceno

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5746] socketserver problem upon disconnection (undefined member)

2009-04-13 Thread Eric Blond

Eric Blond  added the comment:

That's it actually.

I forgot to call base class' setup() method when I redefined it in my 
subclass. When I properly call StreamRequestHandler.setup() on my 
derived class' setup(), everything works fine.

I'm not a socketserver specialist, but I would have expected 
StreamRequestHandler to derive from RequestHandler and not the other 
way round, although it makes little difference to me as a user's point 
of view.

Thanks a lot for pointing my mistake!

Cheers,
-Eric

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5746] socketserver problem upon disconnection (undefined member)

2009-04-13 Thread Eric Blond

Changes by Eric Blond :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3440] Starting any program as a subprocess fails when subprocess.Popen has env argument

2009-04-13 Thread R. David Murray

R. David Murray  added the comment:

As I said, if you replace the environment it is your responsibility to
supply a working environment.  I've attached a doc patch that adds a
warning about this with the information that a valid SystemRoot is
needed to run a side-by-side assembly (whatever that is :).

If you think the doc patch is accurate I will commit it (unless Georg
objects).

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file13683/issue3440-doc.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3440] Starting any program as a subprocess fails when subprocess.Popen has env argument

2009-04-13 Thread Georg Brandl

Georg Brandl  added the comment:

Looks good to me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5748] Objects/bytesobject.c should include stringdefs.h, instead of defining its own macros

2009-04-13 Thread Eric Smith

New submission from Eric Smith :

All of the macros it defines around line 565 should either already be in
stringdefs.h, or they should be added there.

The same issue exists in Objects/bytearrayobject.c. I haven't looked in
2.7, but I assume the same problem exists there.

--
assignee: eric.smith
components: Interpreter Core
keywords: easy
messages: 85954
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Objects/bytesobject.c should include stringdefs.h, instead of defining 
its own macros
type: behavior
versions: Python 2.7, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5746] socketserver problem upon disconnection (undefined member)

2009-04-13 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> invalid

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5725] process SysV-Semaphore support

2009-04-13 Thread R David Murray

R David Murray  added the comment:

On Sat, 11 Apr 2009 at 09:29, jvdias wrote:
> jvdias  added the comment:
>
> Thanks for responding !

You are welcome.  If you want something to happen, though,
you'll have to get support from the community and submit
a patch.

> Can't Python provide a better print() implementation or a fflush()
> implementation that will enable print()'s buffers to be flushed ?
> Perhaps something like PERL's IO::Handle::autoflush() ?

Is there some way in which sys.stdout.flush() is not equivalent to "an
fflush implementation that will enable print()'s buffers to be flushed"?

> Maybe I should raise another "fflush() support required" bug ?

If it's a real issue, yes.  But I don't think it is.

--David

--
nosy: +r.david.murray-old

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5749] Allow bin() to have an optional "Total Bits" argument.

2009-04-13 Thread MechPaul

New submission from MechPaul :

As it stands right now, bin() only shows the minimum number of bits to
display the number, however I think having a "Total Bits" argument would
be very, very useful for bin().

bin(value, [Total bits to display])

"Total bits to display" is an integer.

Here's how it should work:

>>> bin(0x7F)
'0b111'
>>> #Note, there are seven 1's there to represent the value 127
>>> bin(0x7F, 8)
'0b0111'
>>> #Now there are eight bits displayed.
>>> bin(0xFF, 16)
'0b'
>>> #This makes it a lot easier to read and compare binary numbers!

--
components: Interpreter Core
messages: 85956
nosy: MechPaul
severity: normal
status: open
title: Allow bin() to have an optional "Total Bits" argument.
type: feature request
versions: Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5725] process SysV-Semaphore support

2009-04-13 Thread R. David Murray

Changes by R. David Murray :


--
nosy:  -r.david.murray-old

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5749] Allow bin() to have an optional "Total Bits" argument.

2009-04-13 Thread R. David Murray

R. David Murray  added the comment:

A better (more flexible) way already exists (as of 2.6) to accomplish
your goal:

>>> "0b{0:08b}".format(127)
'0b0111'

--
nosy: +r.david.murray
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()

2009-04-13 Thread Victor Godoy Poluceno

Changes by Victor Godoy Poluceno :


--
nosy: +victorpoluceno

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5742] inspect.findsource() should look only for sources

2009-04-13 Thread Daniel Diniz

Changes by Daniel Diniz :


--
priority:  -> normal
stage:  -> test needed
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5730] setdefault speedup

2009-04-13 Thread Dan Schult

Dan Schult  added the comment:

Thank you... I stand corrected
That's actually very helpful!

Of course using defdict makes the default assignment take two hashes,  
two lookups, an attribute/function lookup (__missing__) and the extra  
function call, plus doesn't allow arguments to the object factory...  
but it means that there is a hook into the dict API that allows us to  
create something when GetItem/subscript gives a KeyError...  I  
understand much more what I should be doing and where to look for it.

Thanks very much!

I still would prefer that the C-API allow PyDict_SetItem to be called  
without a hash or lookup.  Maybe a method called PyDict_SetEntry().   
But I haven't really looked at it, don't have a patch and am not sure  
if it is worth it.  I am willing to spend time doing looking into  
that kind of thing if you think that might be helpful.  Otherwise I  
will put it on my list of fun-projects-for-hazy-summer-weekends and  
get to it when I get to it.

Dan

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5749] Allow bin() to have an optional "Total Bits" argument.

2009-04-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I concur with closing this one.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5750] weird seg fault

2009-04-13 Thread utilitarian

New submission from utilitarian :

In python 2.5.2 on ubuntu Ibex. If your run the command python
round_robin_seg.py  smallest_tomog. Using the files provided.
There is a segfault. It happens in the core interpreter. It happened
when I added line 35 to the python code. Sorry I do not have time at the
moment to pin it down better.

--
components: Interpreter Core
files: python_crash.tar.gz
messages: 85960
nosy: utilitarian
severity: normal
status: open
title: weird seg fault
versions: Python 2.5
Added file: http://bugs.python.org/file13684/python_crash.tar.gz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5750] weird seg fault

2009-04-13 Thread Peter Lonjers

Changes by Peter Lonjers :


--
type:  -> crash

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com