[issue6097] Encoded surrogate characters on command line not escaped in sys.argv

2009-05-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue5274] sys.exc_info()[1] - different handling from str() and unicode() - py 2.6

2009-05-29 Thread Georg Brandl

Georg Brandl  added the comment:

Duplicate of #6108.

--
nosy: +georg.brandl
resolution:  -> duplicate
status: open -> closed
superseder:  -> unicode(exception) behaves differently on Py2.6 when 
len(exception.args) > 1

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Thanks, it fixed it. Applied in the trunk. 

Can you guys merge r73008 into Py3k please ? 

I have a problem today, I can't build py3k on Mac OS X anymore, I am
trying to figure out why.

--

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Done in r73010. I think it would be better to patch release26maint.patch
for release26-maint (and same patch for release30-maint) to complete
super() issue.

--

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto :


Added file: http://bugs.python.org/file14110/release26maint.patch

___
Python tracker 

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



[issue4829] confusing error for file("foo", "w++")

2009-05-29 Thread John Szakmeister

John Szakmeister  added the comment:

On trunk, it seems that it's perfectly happy if you specify more than 
one '+':

Python 2.7a0 (trunk, May 29 2009, 05:57:26) 
[GCC 4.0.1 (Apple Inc. build 5470) (Aspen 5470.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> open('foo.txt', 'w++')


Is this still really an issue then?  The current trunk also allows 
multiple mode letters too, so it seems like a decision has been made.

--
nosy: +jszakmeister

___
Python tracker 

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



[issue6141] missing first argument on subprocess.Popen w/ executable

2009-05-29 Thread Lie Ryan

New submission from Lie Ryan :

Following from http://comments.gmane.org/gmane.comp.python.tutor/55576

>>> import subprocess
>>> subprocess.Popen(['a', 'b', 'c', 'd'], executable='echo')

b c d

instead of the (what I) expected result
a b c d

I suggests two possible change:
1. add another optional argument called displayed_executable (or
something similar) and make the arg argument contains only arguments
2. it is made clear in the documentation that the first argument is used
as executable display name

Since the first alternative is behavioral change, it couldn't possibly
go through already released version; therefore if it is the chosen
solution it would have to go to Python 2.7 and Python 3.2. 

Changing the documentation should be easier, although the problem will
persist for unsuspecting users; and even if the first alternative is
taken, perhaps documentation change should still be done retrospectively
(I don't know the policy on doc change on old python version)

It should be noted that I tested this only with Python 2.5 on Gentoo
(although from the discussion, I presumed this is considered a feature
and would have persisted in later versions). And at the time of this
writing, I have no idea how it behaves in Windows.

--
assignee: georg.brandl
components: Documentation, Library (Lib)
messages: 88504
nosy: georg.brandl, lieryan
severity: normal
status: open
title: missing first argument on subprocess.Popen w/ executable
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

___
Python tracker 

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



[issue3329] API for setting the memory allocator used by Python

2009-05-29 Thread John Szakmeister

Changes by John Szakmeister :


--
nosy: +jszakmeister

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

done thx for the help.

Do you happen to know the exact reason why using super rather than an
explicit call avoids the leaking ?

--
status: open -> closed
versions: +Python 2.6, Python 2.7, Python 3.0

___
Python tracker 

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



[issue4618] print_function and unicode_literals don't work together

2009-05-29 Thread John Szakmeister

Changes by John Szakmeister :


--
nosy: +jszakmeister

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Well, I don't know... But probably mixing super() and non super() caused
too many call of setUp() or tearDown(). I saw such case before.

To track down this, probably this info helps.
1. Revert to previous revision of distutils
2. Remove distutils tests except for test_archive_util.py and
test_bdist_dumb.py
3. Run regrtest.py -R2:3: test_distutils

test_distutils
beginning 5 repetitions
12345
.
test_distutils leaked [280, 280] references, sum=560
1 test failed:
test_distutils

--

___
Python tracker 

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



[issue6131] test_modulefinder leaks when run after test_distutils

2009-05-29 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I tracked down more deeper.

LoggingSilencer.setUp() was called twice, so restoration of log.Log._log
was not done correctly. log.Log._log becomes method of TestCase class
after test done in most cases. Probably this keeps reference to TestCase
and its instance variables.

--

___
Python tracker 

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



[issue672115] Assignment to __bases__ of direct object subclasses

2009-05-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Lars, I think that your question has a simple explanation, and is not
related to the original issue:
- On 4th line, the variable named "A" is bound to a new type object.
This type has no attribute by itself.
- The first dir(A) displays the attributes of the bases class, which are
the previous A and B: you see ['one', 'two']
- The second dir(A) displays the attributes of the bases class, which
are B and C: you see ['two', 'three']

The instruction "A = type(...)" causes A to refer to another object; it
does not change the object previously contained in A.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6012] enhance getargs O& to accept cleanup function

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I have now committed this patch with the proposed modifications as r73014.

I don't believe that the additional destr call is necessary, as
releasing the capsule will invoke destr already.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6141] missing first argument on subprocess.Popen w/ executable

2009-05-29 Thread R. David Murray

R. David Murray  added the comment:

The way it works is the way most programmers expect it to work, even
though most get bitten by it more than once.  So the behavior isn't
going to change.  I've attached a doc fix, but I'm not sure whether or
not the 'diplay name' piece applies only to unix, although I've
documented it that way.  The windows documentation I found for
CreateProcess does not mention it, though it does note that "most C
programmers" treat argv[0] as the process name, consistent with the way
subprocess handles the argument string.

The Windows documentation I consulted is here:

http://msdn.microsoft.com/en-us/library/ms682425.aspx

--
keywords: +patch
nosy: +r.david.murray
priority:  -> normal
versions:  -Python 2.5
Added file: http://bugs.python.org/file14111/issue6141-doc.patch

___
Python tracker 

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



[issue4859] pwd, spwd, grp functions vulnerable to denial of service

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Thanks for the patches. Committed as r73015.

--
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



[issue6142] Distutils doesn't remove .pyc files

2009-05-29 Thread James

New submission from James :

Priority: 4
Keywords: patch, distutils, pyc
Comment:
I posted this on the distutils mailing list, and they said I should post
it here instead.

---
Hi,
I'm certaintly new to distutils and setuptools, however I figured I'd
send in this patch, and either it will get merged because it's a great
idea or someone will perhaps tell me why this doesn't exist already.
(or maybe it does and i can't find it)
In any case, it adds the pyc option to the clean command so that the
.pyc can be removed on request. Personally i'll have a [clean] pyc=1
option in my setup.cfg, but that's for my convenience.
cheers,

_J


---

ps: i wasn't able to pick a priority or keywords, there isn't a box to
type those in, however the titles are there. so either i don't have
permissions or there's a bug ?

--
files: clean.py.patch
keywords: patch
messages: 88512
nosy: purpleidea
severity: normal
status: open
title: Distutils doesn't remove .pyc files
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file14112/clean.py.patch

___
Python tracker 

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



[issue4873] Refcount error and file descriptor leaks in pwd, grp modules

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Thanks for the patch. Committed as r73016, r73017, r73018, r73019.

--
nosy: +loewis
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



[issue6097] Encoded surrogate characters on command line not escaped in sys.argv

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Thanks for the patch. Committed as r73020.

--
nosy: +loewis
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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Collin Winter

Changes by Collin Winter :


--
nosy: +collinwinter

___
Python tracker 

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



[issue5903] strftime fails in non UTF-8 locale

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This is a duplicate of issue 3061.

--
nosy: +loewis
resolution:  -> duplicate
status: open -> closed
superseder:  -> time.strftime() always decodes result with UTF-8

___
Python tracker 

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



[issue5562] Locale-based date formatting crashes on non-ASCII data

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This is a duplicate of issue 3061.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> time.strftime() always decodes result with UTF-8

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Antoine: Don't use autoconf 2.63 to generate pyconfig.h.in and
configure. Use 2.61 instead (until it is agreed to switch to a newer
version).

--
nosy: +loewis

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Here is a patch that resolves this issue for systems supporting
wcsftime, which should be the majority of systems on which the problem
can occur.

--
keywords: +patch
priority: high -> release blocker
Added file: http://bugs.python.org/file14113/wcsftime.diff

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine: Don't use autoconf 2.63 to generate pyconfig.h.in and
> configure. Use 2.61 instead (until it is agreed to switch to a newer
> version).

Oops, sorry. Are there any known issues with 2.63?

--

___
Python tracker 

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



[issue6092] Changed Shortcuts don't show up in menu

2009-05-29 Thread jamesie

jamesie  added the comment:

At least for Run in the main menu the changed shortcut shows up after a
restart of IDLE. Nevertheless in the Options dialog the string "F5"
seems to be hard coded.

--

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The patch looks good. (Can this be tested?)

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue6141] missing first argument on subprocess.Popen w/ executable

2009-05-29 Thread Georg Brandl

Georg Brandl  added the comment:

Patch looks good, just replace `ps` by :program:`ps` please.

--

___
Python tracker 

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



[issue6102] When the package has non-ascii path and .pyc file, we cannot import them.

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Am closing based on 'My problem seems resolved'.
I don't know whether it will be fixed in 3.0.2 or not,
but that is pretty much a moot point.

--
nosy: +tjreedy
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6141] missing first argument on subprocess.Popen w/ executable

2009-05-29 Thread R. David Murray

R. David Murray  added the comment:

Fixed in r73026, thanks.

--
resolution:  -> fixed
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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

It's difficult to test. The only test I can think of is one that gets
skipped if the fr_FR (say) locale is not configured. The test would then
try to find out what the name of February is, which should return a
string (see issue5562).

--

___
Python tracker 

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



[issue6132] Implement the GIL with critical sections in Windows

2009-05-29 Thread Phillip Sitbon

Changes by Phillip Sitbon :


Removed file: http://bugs.python.org/file14096/thread_nt.h.patch

___
Python tracker 

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



[issue6132] Implement the GIL with critical sections in Windows

2009-05-29 Thread Phillip Sitbon

Phillip Sitbon  added the comment:

Tabified new code and removed one C++-style comment.

--
Added file: http://bugs.python.org/file14114/thread_nt.h.patch

___
Python tracker 

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



[issue6119] Confusing DeprecationWarning

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I believe that is a bug.  The warning should be about 'order
comparisons', which did disappear, and not 'inequality comparisons', and
should not trigger on == or !=.

--
nosy: +tjreedy

___
Python tracker 

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



[issue6127] Unexpected universal newline behavior (newline duplication) in Windows

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

FWIW, WindowsXP, Py3.1b1, May 7

>>> io.StringIO('foo\r\nbar\r\n', newline=None).read()
'foo\nbar\n'

I believe there were changes to io after April 14 for May 7 release, so
this may be fixed in 2.6.3 branch already.

--
nosy: +tjreedy

___
Python tracker 

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



[issue5922] Multi-with patch

2009-05-29 Thread R. David Murray

R. David Murray  added the comment:

This was applied by Georg in r72925.

--
nosy: +r.david.murray
resolution:  -> accepted
stage: patch review -> committed/rejected
status: open -> closed
type:  -> feature request

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread R. David Murray

Changes by R. David Murray :


--
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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Martin, I agree that we would have to think carefully about all
attributes of all constants loaded by LOAD_CONST, and about
special-casing marshal, but given that "'str' object attribute 'join' is
read-only", how is ''.join not a constant?  Do you have another example
in mind?

--
nosy: +tjreedy

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I'm working a better patch now.  Will give to collin to review when it's
ready.  Here's a draft of the new opcode:

TARGET(LOAD_CONST_ATTR)
u = GETLOCAL(oparg);/* Cached attribute or NULL */
t = TOP();  /* t = (obj, 
name) where obj is constant */
if (u != NULL) {/* If cache is 
non-null, use it */
Py_INCREF(u);
SET_TOP(u);
Py_DECREF(t);
FAST_DISPATCH();
}
/* Cache is empty, do regular attribute lookup */
assert(PyTuple_CheckExact(t) && Py_SIZE(t) == 2);
v = PyTuple_GET_ITEM(t, 0);
w = PyTuple_GET_ITEM(t, 1);
x = PyObject_GetAttr(v, w);
Py_DECREF(t);
if (x != NULL) {/* Successful lookup; 
cache it and return */
SETLOCAL(oparg, x);
Py_INCREF(x);
SET_TOP(x);
break;
}
STACKADJ(-1);   /* Attribute not found; 
goto err handler */
break;

--

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Can you use test_support.run_with_locale?

--

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I was hoping this would make 3.1.  Too late, I guess.  What about 3.2?

--
nosy: +tjreedy

___
Python tracker 

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



[issue6100] Expanding arrays inside other arrays

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree.  This and more is part of #2292

--
nosy: +tjreedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> Missing *-unpacking generalizations

___
Python tracker 

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



[issue6139] Typo in email.base64mime

2009-05-29 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in r73028.

--
nosy: +georg.brandl
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6001] Test discovery for unittest

2009-05-29 Thread Michael Foord

Michael Foord  added the comment:

Committed in revision 73027.

--
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



[issue2292] Missing *-unpacking generalizations

2009-05-29 Thread Guido van Rossum

Guido van Rossum  added the comment:

> I was hoping this would make 3.1.  Too late, I guess.  What about 3.2?

Here's what I said before:

"""
I think we should either get this into the 3.0a5 release planned for May
7, or wait for 3.1.  I'd prefer to see some kind of PEP discussion on
the python-3000 list, rather than just a BDFL approval in a tracker
issue.  I think it's a useful feature (especially now we already have
PEP 3132) but we're getting close to the release, so I'd like to see
some more eyeballs on this code...  I expect the PEP discussion will be
short and sweet -- either most folks like it, or we should not push
through at this point in time.
"""

I still think this is the way to do it.  I'm +0 myself.  We might decide
not to do it just because py3k needs stability more than it needs more
features.

--

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Attaching a rough patch for caching constant attribute lookups.   Has an
open TODO for adding the new name to co->co_varnames.

--
Added file: http://bugs.python.org/file14115/constattr.diff

___
Python tracker 

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



[issue6143] IDLE - an extension to clear the shell window

2009-05-29 Thread Roger Serwy

New submission from Roger Serwy :

I noticed that the feature to clear the shell window has been a
discussion topic in the IDLE-dev archives for a few years. Here's an
extension that can clear the contents of the shell window. It provides
"Clear Shell Window" under "Options" and a  key binding.

The source code provides two methods to do this. The
ModifiedUndoDelegator prevents changing the contents of the text widget
before "iomark". One solution is to disable the filter, make the
changes, then re-enable it. Another solution is move "iomark" to the
beginning of the document. Any thoughts?

--
components: IDLE
files: ClearWindow.py
messages: 88539
nosy: serwy
severity: normal
status: open
title: IDLE - an extension to clear the shell window
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14116/ClearWindow.py

___
Python tracker 

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



[issue6144] [IDLE] UnicodeDecodeError when invoking force-open-completions

2009-05-29 Thread jamesie

New submission from jamesie :

IDLE 3.1b1 crashes when I press Control-SPACE in order to invoke Show
Completions from the Edit submenu. When I run that funtionality from the
menu it works ok.

Traceback (most recent call last):
  File "/usr/local/bin/idle3", line 5, in 
main()
  File "/usr/local/lib/python3.1/idlelib/PyShell.py", line 1420, in main
root.mainloop()
  File "/usr/local/lib/python3.1/tkinter/__init__.py", line 1009, in
mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1:
illegal encoding

I rund a hand-compiled Python 3.1b1 on Debian/GNU Linux Lenny.

--
components: IDLE
messages: 88540
nosy: gpolo, jamesie
severity: normal
status: open
title: [IDLE] UnicodeDecodeError when invoking force-open-completions
type: crash
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



[issue3821] trace module bug when using --missing

2009-05-29 Thread R. David Murray

R. David Murray  added the comment:

Brett Cannon apparently fixed this in r69111 for 3.1.  I merged it to
the 30-maint branch in r73030.

It would be nice to add the tests, but they don't currently pass
(test_coverage_ignore fails).  I don't know if that's a test bug or a
code bug, not being familiar with the trace module.

--
nosy: +r.david.murray
priority: critical -> low
resolution:  -> fixed
stage:  -> patch review
type:  -> behavior
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



[issue6145] distutils.extension.read_setup_file misinterprets -C switch

2009-05-29 Thread Lorenz Quack

New submission from Lorenz Quack :

I'm not sure if this is a bug or some weird backward-compatible behaviour...

In "distutil.extension.read_setup_file" it checks for the "-C" switch
but then appends "word" instead of "value"
So if you pass "-C-Wall" it actually passes exactly that to the compiler
instead of just "-Wall"

In the file it says the switch is "only here 'cause makesetup has it!"
so is this some behaviour the way it is for compability reasons or am I
missing something?

If this is indeed a bug I attached a patch

--
assignee: tarek
components: Distutils
files: distutil_extension.patch
keywords: patch
messages: 88542
nosy: donlorenzo, tarek
severity: normal
status: open
title: distutils.extension.read_setup_file misinterprets -C switch
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 
3.1, Python 3.2
Added file: http://bugs.python.org/file14117/distutil_extension.patch

___
Python tracker 

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



[issue4236] Crash when importing builtin module during interpreter shutdown

2009-05-29 Thread R. David Murray

Changes by R. David Murray :


--
components: +Interpreter Core
stage:  -> needs patch
type:  -> crash
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue4486] Exception traceback is incorrect for strange exception handling

2009-05-29 Thread R. David Murray

Changes by R. David Murray :


--
assignee: barry -> 
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Oops, sorry. Are there any known issues with 2.63?

Yes: it puts a carriage-return character into configure
which completely confuses subversion.

I'm puzzled how you were able to commit the generated
files; subversion should have reported an error

svn: File 'configure' has inconsistent newlines
svn: Inconsistent line ending style

See

http://mail.python.org/pipermail/python-dev/2008-November/083781.html

--

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Yes: it puts a carriage-return character into configure
> which completely confuses subversion.
> 
> I'm puzzled how you were able to commit the generated
> files; subversion should have reported an error
> 
> svn: File 'configure' has inconsistent newlines
> svn: Inconsistent line ending style

I did get that message (and got puzzled by it).
I worked around it by reading the file in universal newlines mode and
saving it again.

--

___
Python tracker 

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



[issue1563] asyncore and asynchat incompatible with Py3k str and bytes

2009-05-29 Thread R. David Murray

R. David Murray  added the comment:

Reducing priority since the critical issues seem to have been resolved
already.  Also retargeting for 3.2 since 3.1 is about to go rc.

--
nosy: +r.david.murray
priority: critical -> normal
versions: +Python 3.2 -Python 3.0

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Terry J. Reedy wrote:
> Terry J. Reedy  added the comment:
> 
> Martin, I agree that we would have to think carefully about all
> attributes of all constants loaded by LOAD_CONST, and about
> special-casing marshal, but given that "'str' object attribute 'join' is
> read-only", how is ''.join not a constant?  

py> s = ""
py> s.join is s.join
False

Every time you read it, you get a new object. Not what I would call a
constant. If you don't see how this matters, try

def foo():
  return "".join

print foo() is foo()

with and without your patch.

--
title: LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST 
-> LOAD_CONST followed by LOAD_ATTR can be optimized to justbe a LOAD_COST

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Benjamin Peterson wrote:
> Benjamin Peterson  added the comment:
> 
> Can you use test_support.run_with_locale?

I don't think so. IIUC, run_with_locale will fallback to not
setting the locale if none of the listed locales actually works
on the system. This would be undesirable for this issue - it
would be a proper test only if you have a locale for which
strftime currently fails (i.e. returns non-ASCII characters,
and doesn't use UTF-8).

--

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2009/5/29 Martin v. Löwis :
>
> Martin v. Löwis  added the comment:
>
> Benjamin Peterson wrote:
>> Benjamin Peterson  added the comment:
>>
>> Can you use test_support.run_with_locale?
>
> I don't think so. IIUC, run_with_locale will fallback to not
> setting the locale if none of the listed locales actually works
> on the system. This would be undesirable for this issue - it
> would be a proper test only if you have a locale for which
> strftime currently fails (i.e. returns non-ASCII characters,
> and doesn't use UTF-8).

Well, I think you should just apply the patch then.

--

___
Python tracker 

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



[issue2775] Implement PEP 3108

2009-05-29 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6, Python 3.0

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> I did get that message (and got puzzled by it).
> I worked around it by reading the file in universal newlines mode and
> saving it again.

I believe this has broken part of the configure script. There is an
ac_cr variable that is supposed to hold a sole carriage-return
character; it now holds a newline character instead. This will break
the test whether the system autoconf deals with carriage-return
characters correctly, which probably means that it may decide to use
awk to do file substitution when it should have been using /bin/sh,
or vice versa (I haven't fully understood the purpose of this test).

--

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ouch, unfortunately it seems my distribution doesn't package autoconf
2.61. Is there any risk in installing it from scratch?

--

___
Python tracker 

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



[issue6146] markup error in Doc/library/rlcompleter.rst

2009-05-29 Thread Trundle

New submission from Trundle :

There is a small markup error in the description of Completer objects.
The attached patch fixes this.

--
assignee: georg.brandl
components: Documentation
files: rlcompleter_doc_markup.patch
keywords: patch
messages: 88551
nosy: Trundle, georg.brandl
severity: normal
status: open
title: markup error in Doc/library/rlcompleter.rst
versions: Python 2.7
Added file: http://bugs.python.org/file14118/rlcompleter_doc_markup.patch

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

You are right, of course: bound methods are currently created fresh on
each access, even though each is equal except for identity.  I was
thinking in terms of 
>>> str.join is str.join
True

This appears to be a classic time-space tradeoff: caching bound methods,
which is what I understand Raymond's patch does (when the attribute is a
method), saves time (with enough reuses) but takes space that could
gradually grow.

The reply to the OP could be that people who care about time should use
the standard idiom of explicitly  savingthe bound method:
>>> bjoin = ''.join
...
On the other hand, such bindings look a bit messy and tend to be local.

--

___
Python tracker 

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



[issue2919] Merge profile/cProfile in 3.0

2009-05-29 Thread Humberto Diogenes

Humberto Diogenes  added the comment:

How is this going?

--
nosy: +hdiogenes

___
Python tracker 

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



[issue3585] pkg-config support

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Ouch, unfortunately it seems my distribution doesn't package autoconf
> 2.61. Is there any risk in installing it from scratch?

I usually install it into a private location, such as ~/ac261. This is
absolutely safe.

--

___
Python tracker 

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



[issue2742] example code does not work

2009-05-29 Thread Gordon Fogus

Gordon Fogus  added the comment:

I am having this issue again with python code running under python 2.6.2
compiled from source on May 28, 2009 in CentOS 5.3.  The patch in the
socketmodule.diff file does not seem to be applied to the socketmodule.c
file in the current 2.6.2 in
http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz .

I need to be able to bind a port all interfaces to listen to responses
from a server.  This currently only works under windows due to this
issue.  Linux does not like the blank "" IP address; it requires a NULL.

Please advise on a workaround or new patch for this issue.

--
components: +IO -Documentation
nosy: +fogus
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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Collin Winter

Collin Winter  added the comment:

On Fri, May 29, 2009 at 3:45 PM, Martin v. Löwis  wrote:
> py> s = ""
> py> s.join is s.join
> False
>
> Every time you read it, you get a new object. Not what I would call a
> constant. If you don't see how this matters, try
>
> def foo():
>  return "".join
>
> print foo() is foo()
>
> with and without your patch.

The fact that it returns a new object every time seems like an
implementation detail, and one that users find confusing (I know I
once filed a bug about it).

One problem I recognize is that the proposed patch would presumably
create an asymmetry between "x".join is "x".join and "x = 'x'; x.join
is x.join" where the former would evaluate to True and the latter to
False. That seems surmountable, though.

--
title: LOAD_CONST followed by LOAD_ATTR can be optimized to justbe a 
LOAD_COST -> LOAD_CONST followed by LOAD_ATTR can be optimized to just be a 
LOAD_COST

___
Python tracker 

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



[issue6147] multithreading.Pool.map() crashes Windows computer

2009-05-29 Thread Alex James

New submission from Alex James :

When calling multithreading.Pool().map() to distribute computational
load I've recently got system crashes.  

The attached minimalist script exhibits this issue.  
On a Windows Vista home premium sp1 running Python 2.6.2 on a dual-core
laptop, the script stops executing at
threading.Condition(threading.Lock()).wait() called from
multithreading.ApplyResult().wait() called from
multithreading.ApplyResult().get() called from
multithreading.Pool().map() and then compiles the original script as it
starts the script form the beggining twice simultaneously.  The printed
output gets mixed content and both new instances of the script hit the
same problem and spawn more instances.  All old processes are still
active in memory so this leads to system resources being fully consumed.  

This behavior started occurring recently, immediately after attempting
to install a Python .Egg package.  I have uninstalled python an all
extensions, restarted windows, deleted all orphan files and registry
keys I could find, restarted windows, and then re-installed a fresh
download of 2.6.2, but the problem remains.  

The error output retrievable from Keyboard Interrupt (which only works
when script was started on commandline) contains several copies of """
Traceback:
file "", line 1, in 
'import site' failed: use -v for traceback
script opening print statement
script opening print statement
'import site' failed: use -v for traceback
File "C:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "C:\Python26\lib\multiprocessing\forking.py", line 456, in prepare
'__parents_main__', file, path_name, etc
File "H:\builder26\test_a6.py", line 1, in 
Traceback:
from custom_module import *
"""
amoung many pieces thereof stuffed bytewise into other pieces thereof.  

Identical code running in Unix operates just fine, and the identical
code worked on my machine last week.  Reproducability of this error is
thus doubtful.  Repeatability is perfect however.  

Any possible workarounds and/or understanding of root cause is
appreciated for this very rare extreme error.

--
components: Windows
files: test_a10.py
messages: 88557
nosy: ac.james
severity: normal
status: open
title: multithreading.Pool.map() crashes Windows computer
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file14119/test_a10.py

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Does this optimization actually help in real-world cases?

--
nosy: +pitrou

___
Python tracker 

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



[issue6147] multithreading.Pool.map() crashes Windows computer

2009-05-29 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> jnoller
nosy: +jnoller
status: open -> 

___
Python tracker 

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



[issue1563] asyncore and asynchat incompatible with Py3k str and bytes

2009-05-29 Thread Josiah Carlson

Josiah Carlson  added the comment:

You can probably close this unless someone says otherwise.  asyncore/asynchat 
work in Python 3.0+, as long as only bytes are passed.  
As of right now, this is a request for documentation stating "you can only 
send/receive bytes"...which may be implicit with the fact that we are 
reading/writing to sockets.

--

___
Python tracker 

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



[issue6147] multithreading.Pool.map() crashes Windows computer

2009-05-29 Thread Jesse Noller

Jesse Noller  added the comment:

Can you wrap the execution of the main code in a if __name__ == 
"__main__": block, as shown in the documentation? Failure to do so can 
cause a fork bomb on windows

--

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Returning the same object vs new object for bound methods is a
non-guaranteed implementation detail (as long the other semantics remain
true).   I think Martin's real concern is that trying to intern bound
methods would be a can of worms (one that I wouldn't want to open).

FWIW, str.join ignored by this patch.  The "str" builtin is an
overridable builtin (LOAD_GLOBAL "str" LOAD_ATTR "join").  In contrast,
",".join or "{}".format does not have dynamically changeable behavior
(LOAD_CONST "{}" LOAD_ATTR "format").

--

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

[AP]
> Does this optimization actually help in real-world cases?

Yes and no.  Yes, there are real world cases like ','.join and
'{}'.format that are dramatically sped-up.  No, there are probably no
real-world programs that are sped-up significantly in their entirety --
no one optimization will ever do that (Amdahl's law).  Pretty much
anytime the substitution gets made there is a savings on second and
subsequent calls (just like any form of caching).

--

___
Python tracker 

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



[issue6133] LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Returning the same object vs new object for bound methods is a
> non-guaranteed implementation detail (as long the other semantics remain
> true).   I think Martin's real concern is that trying to intern bound
> methods would be a can of worms (one that I wouldn't want to open).

I'm also concerned about the change in behavior. Whether or not it is
guaranteed - some code in the world *will* notice. IMO, optimizations
should only be implemented if there is no change in observable behavior,
or if the improvement is so large that breaking compatibility is
justified.

--
title: LOAD_CONST followed by LOAD_ATTR can be optimized to just be a LOAD_COST 
-> LOAD_CONST followed by LOAD_ATTR can be optimized to justbe a LOAD_COST

___
Python tracker 

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



[issue3061] time.strftime() always decodes result with UTF-8

2009-05-29 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Committed as r73043, r73044

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6148] Help well execute code it is called on

2009-05-29 Thread Ian Miers

New submission from Ian Miers :

when calling help() from the python interpreter on a function 
whose default argument is provided by another function 
( e.g. def foo(bar=baz() ) :  ), help will call baz().

This can cause problems because baz() can alter statefull
data  like a file or database entry. 

This is both a bug in that it does this and in that
its undocumented 

To see this download the attached file and then : 
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bug
>>> help(bug)

at this point the file bug now has been written to disk. 
This is a problem

I've got to think there is a reason for this, but seeing as I cant 
come up with it , better safe than sorry.

--
assignee: georg.brandl
components: Documentation, Interpreter Core
files: bug.py
messages: 88565
nosy: georg.brandl, imiers1
severity: normal
status: open
title: Help well execute code it is called on
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file14120/bug.py

___
Python tracker 

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



[issue6148] Help well execute code it is called on

2009-05-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Default args are evaluated when the module is imported, if the arg is a
function call, the function is called.
You can see how the file is created just after the import, you don't
even need to call help().

This behavior is documented here:
http://docs.python.org/tutorial/controlflow.html#default-argument-values

The doc doesn't mention explicitly function calls, that could be added.

--
components:  -Interpreter Core
nosy: +ezio.melotti
versions:  -Python 2.5, Python 2.6

___
Python tracker 

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