[issue3445] Ignore missing attributes in functools.update_wrapper

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Implemented in r84132 (not based on this patch though).

--
stage: patch review -> 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



[issue9567] Add attribute pointing to wrapped function in functools.update_wrapper

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Implemented in r84132

--
stage: unit test needed -> 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



[issue9189] Improve CFLAGS handling

2010-08-16 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

issue9047 is related to the issue Stefan mentions

--

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Test script attached that demonstrates the underlying problem directly via 
imp.lock_held() (this could easily form the basis of a unit test)

--
Added file: http://bugs.python.org/file18552/fork_on_import.py

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Minimal patch attached (no niceties like NEWS or unit tests included yet)

--
keywords: +patch
Added file: http://bugs.python.org/file18551/issue9573_fork_on_import.diff

___
Python tracker 

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



[issue9620] Python 2.7 IDLE fails on OS X 10.6

2010-08-16 Thread Ned Deily

Ned Deily  added the comment:

This is a duplicate of open Issue9227.  As described there, a workaround is to 
use the 32-bit only ("10.3") python.org installer for Python 2.7.

--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +ned.deily, ronaldoussoren
title: IDLE subprocess error -> Python 2.7 IDLE fails on OS X 10.6

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

One slight tweak to that suggested change - the lock reinitialisation needs to 
acquire the new lock in the first branch.

--

___
Python tracker 

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Added Greg to nosy list as the one that fixed issue 7242 with the current 
_PyImport_ReInitLock semantics.

Also kicking over to Barry regarding implications for 2.6.6 (this is a 
regression from 2.6.4 due to the resolution of 7242).

7242 was about forking from a *thread*. This is about forking as a side effect 
of import, which, just like spawning a thread as a side effect of import, can 
easily cause issues.

The RuntimeError noted by the OP isn't thrown by the fork() call - it is thrown 
at the end of the import when control is returned to the main module. 
Completely reinitialising the lock without accounting for the current depth of 
nesting is incorrect. Instead, I believe ReInitLock should look more like:

if (import_lock != NULL)
import_lock = PyThread_allocate_lock();
if (import_lock_level > 1) {
/* Forked as a side effect of import */
long me = PyThread_get_thread_ident();
import_lock_thread = me;
import_lock_level--;
} else {
import_lock_thread = -1;
import_lock_level = 0;
}

(I haven't tested that yet, but will soon)

--
assignee:  -> barry
nosy: +barry, gregory.p.smith
priority: normal -> release blocker

___
Python tracker 

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



[issue2521] ABC caches should use weak refs

2010-08-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Some comments:
- The test should be in test_abc.py and should probably not use a collections 
class.
- Use test_support.gc_collect().
- What's the __len__() stuff for?

--
keywords:  -26backport

___
Python tracker 

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



[issue9569] Add tests for posix.mknod() and posix.mkfifo()

2010-08-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Thanks for the patch. r84129

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



[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Applied in r84124. Thanks for the patch.

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

r84122 saves/restores the exception around "filename = 
_PyUnicode_AsString(co->co_filename);" because it raises an unicode error on 
unencodable filename.

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

r84121: repr() method zipimporter object uses unicode.

--

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Éric Araujo

Éric Araujo  added the comment:

Looks good.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

r84120: get_data() function of zipimport uses an unicode path.

--

___
Python tracker 

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



[issue9624] 2755

2010-08-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Please be more descriptive about the problem you have.
What were you trying to do?
On which operating system?
How could we try to reproduce the problem?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue9624] 2755

2010-08-16 Thread Jay Ballard

New submission from Jay Ballard :

failure to find drive

--
components: None
messages: 114085
nosy: Kartton
priority: normal
severity: normal
status: open
title: 2755
versions: Python 2.7

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2010-08-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The calls to Py_GetFinalPathNameByHandle come in pairs: one to get the length, 
the other to retrieve the value.  They should at least be consistent.
There are two other issues:

- in all three places, it's possible for the function to return after malloc(), 
but before the call to free(); and PyMem_Malloc()/PyMem_Free() would be better.

- on my windows XP, os.stat() is slower than before, and is now significantly 
slower than os.lstat() (26.6 usec -> 32.8 usec); I found that 
check_GetFinalPathNameByHandle() repeatedly checks for the presence of the 
function, and always calls GetModuleHandle() and GetProcAddress(). The attached 
patch fixes this, can you test it on Vista?

--
Added file: http://bugs.python.org/file18550/faster_stat.diff

___
Python tracker 

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



[issue1104249] configure doesn't set up CFLAGS properly

2010-08-16 Thread Stefan Krah

Stefan Krah  added the comment:

Closing as a duplicate of issue 9189.

--
nosy: +skrah
resolution:  -> duplicate
stage: unit test needed -> committed/rejected
status: open -> closed
superseder:  -> Improve CFLAGS handling

___
Python tracker 

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



[issue7902] relative import broken

2010-08-16 Thread Florent Xicluna

Florent Xicluna  added the comment:

Merged in 3.1 with r84115.

--

___
Python tracker 

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



[issue9189] Improve CFLAGS handling

2010-08-16 Thread Stefan Krah

Stefan Krah  added the comment:

This is what happens. In the Makefile, I have:

CONFIGURE_LDFLAGS=  -fprofile-arcs
PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)


But since LDFLAGS=-fprofile-arcs is in the environment, too, we get the
duplication.

The sysconfig issue is related. In Lib/sysconfig.py, _parse_makefile
grabs LDFLAGS from the environment if it is set, so LDFLAGS ultimately
expands to '-fprofile-arcs -fprofile-arcs'.

--

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18548/Py_UNICODE_strncmp-2.patch

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

Py_UNICODE_strncmp-2.patch commited as r84111.

--

___
Python tracker 

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



[issue9623] test_site.py has a couple of stray self.assertTrue calls that test for equality

2010-08-16 Thread Dave Malcolm

Dave Malcolm  added the comment:

Hopefully actually attaching the patch this time

I've used assertEqual in the lines I've touched.  I haven't touched the other 
lines, in order to isolate the semantic fix from the stylistic one.

--
Added file: http://bugs.python.org/file18549/fix-stray-assertTrue-calls.patch

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18547/Py_UNICODE_strncmp.patch

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

Py_UNICODE_strncmp.patch was wrong for n=0. New version based on 
libiberty/strncmp.c source code.

--
Added file: http://bugs.python.org/file18548/Py_UNICODE_strncmp-2.patch

___
Python tracker 

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



[issue2548] Undetected error in exception handling

2010-08-16 Thread Mark Lawrence

Changes by Mark Lawrence :


--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue6724] r74463 causes failures in test_xmlrpc

2010-08-16 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

> Using www.google.com for IPv6 lookups is a bad idea (...)

There is also ipv6.google.com

--
nosy: +haypo

___
Python tracker 

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



[issue9568] test_urllib2_localnet fails on OS X 10.3

2010-08-16 Thread Ned Deily

Ned Deily  added the comment:

Committed fix verified on 2.6: test_urllib2_localnet no longer fails on 10.3.

--

___
Python tracker 

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



[issue9623] test_site.py has a couple of stray self.assertTrue calls that test for equality

2010-08-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

(BTW assertEquals is deprecated, see #9424)

--

___
Python tracker 

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



[issue9623] test_site.py has a couple of stray self.assertTrue calls that test for equality

2010-08-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

It looks like you forgot to attach the patch :)

--
nosy: +ezio.melotti
versions:  -Python 3.3

___
Python tracker 

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



[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Using www.google.com for IPv6 lookups is a bad idea: whether or not you get an 
IPv6 address depends on whether your nameserver participates in "google over 
ipv6". www.python.org would be a better choice.

--

___
Python tracker 

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



[issue8983] Docstrings should refer to help(name), not name.__doc__

2010-08-16 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed in r84106.  I left the __init__ docstring issue unresolved because it 
is orthogonal to the name.__doc__ vs. help(name) issue here.

With redundant help(type(x)), the meaning of the docstring is not changed. I am 
leaving docstrings on magic methods question for a separate issue.

--
resolution:  -> accepted
stage: commit review -> 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



[issue998998] pickle bug - recursively memoizing class?

2010-08-16 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: pending -> closed

___
Python tracker 

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



[issue1581183] pickle protocol 2 failure on int subclass

2010-08-16 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: pending -> closed

___
Python tracker 

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



[issue8739] Update to smtpd.py to RFC 5321

2010-08-16 Thread Alberto Trevino

Alberto Trevino  added the comment:

On Monday, August 16, 2010 12:58:07 pm Barry A. Warsaw wrote:
> The one thing that looks weird to me is VRFY.  Since it never actually
> does verify the user, should we even claim to support the command?  Why
> not let subclasses claim support if they want to add it?

RFC 5321 section 4.5.1 states VRFY should be implemented in order to be 
considered an RFC 5321-compliant implementation.  But, in section 3.5.3 
paragraph 2 it states that if the actual verification was not performed but 
syntax was checked similar to RCPT, then the response code should be 252.

So my purposes for providing the plumbing for VRFY are:

1. Provide a basic, valid implementation to be as RFC 5321-compliant as 
possible.

2. Let users know the command is there so that it can be reimplemented as 
they build their solutions.

--

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2010-08-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

In the case where I did use VOLUME_NAME_NT, I think I chose it because it 
returned a more robust result. That is, it's not clear what the result is if 
the result is not on a volume that is assigned a drive letter, but all files 
referenced must have a VOLUME_NAME_NT.

In other usage, I found that use of VOLUME_NAME_NT was unnatural, because it 
returned for the user a path that would be unfamiliar, rather than the more 
traditional VOLUME_NAME_DOS.

So, where the result is to be used by the interpreter and isn't exposed to the 
user, it seems prudent to use VOLUME_NAME_NT, and where the user will see the 
result, use VOLUME_NAME_DOS.

I admit, this is only a rule of thumb and may be subject to correction, but 
this was my motivation when making these selections.

--

___
Python tracker 

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



[issue9623] test_site.py has a couple of stray self.assertTrue calls that test for equality

2010-08-16 Thread Dave Malcolm

New submission from Dave Malcolm :

test_site.py has a couple of assertions of the form

  self.assertTrue(len(foo), some number)

which appear to be incorrect, and should read:

  self.assertEqual(len(foo), some number)

or assertEquals (that file uses both methods).

r76047 fixed some of these, but a couple remain (introduced in r74526) in both 
2.7 branch and py3k.  Patch attached (for 2.7 branch)

--
components: Tests
keywords: easy, needs review, patch
messages: 114069
nosy: dmalcolm
priority: normal
severity: normal
stage: patch review
status: open
title: test_site.py has a couple of stray self.assertTrue calls that test for 
equality
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue9568] test_urllib2_localnet fails on OS X 10.3

2010-08-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

r84103 in release26-maint

I will let Ronald commit to the other branches.  I did this one due to the 
timing of 2.6.6 rc 2.  Bumping status away from release blocker.

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



[issue7902] relative import broken

2010-08-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Guido has spoken: 
http://mail.python.org/pipermail/python-dev/2010-August/103104.html

We'll keep the change for 2.6.6rc2.

--
nosy: +barry
status: open -> closed

___
Python tracker 

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



[issue665761] reduce() masks exception

2010-08-16 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed to py3k in r84098.   Accepting this change for py3k was an easy 
decision to make because zip and map already behave this way in 3.x.

I am inclined to reject this for 2.7, however.  While I agree that this is a 
bug, fixing it has a potential of breaking users' code.  I also note that for 
zip and map, 2.7 users can switch to izip and imap which don't have this 
problem.  Arguably, switching to izip and imap in new code is a good idea 
regardless of this issue.  While there is no similar work-around for reduce, I 
don't think this bug is important enough to introduce backward incompatible 
change in the stable series.

--
status: open -> pending

___
Python tracker 

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



[issue7902] relative import broken

2010-08-16 Thread Florent Xicluna

Florent Xicluna  added the comment:

Comment changed in r84097, 3.2 branch, with minor fixes.

--

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2010-08-16 Thread Brian Curtin

Brian Curtin  added the comment:

I committed the code you speak of (posix__getfinalpathname in 
Modules/posixmodule.c), but I don't know if I have a great answer for that 
question. It looks like VOLUME_NAME_NT (path with volume device path) should 
just be changed to VOLUME_NAME_DOS (path with drive letter). In fact, I think 
it would be more "accurate" since NT yields with a larger path, thus we 
over-allocate up front before we go on and use DOS and then trim the target 
path down.

Jason (author of that function, added as nosy) might have some other input as 
to why he used VOLUME_NAME_NT there.

--
assignee: rhettinger -> 
nosy: +jaraco
status: pending -> open

___
Python tracker 

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



[issue8739] Update to smtpd.py to RFC 5321

2010-08-16 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

The one thing that looks weird to me is VRFY.  Since it never actually does 
verify the user, should we even claim to support the command?  Why not let 
subclasses claim support if they want to add it?

--

___
Python tracker 

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



[issue7352] pythonx.y-config --ldflags out of /usr and missing -L

2010-08-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: python2.6-config --ldflags out of /usr and missing -L 
-> pythonx.y-config --ldflags out of /usr and missing -L
versions: +Python 3.2 -Python 2.7

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

Py_UNICODE_strncmp.patch: create Py_UNICODE_strncmp() function.

--
Added file: http://bugs.python.org/file18547/Py_UNICODE_strncmp.patch

___
Python tracker 

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



[issue9445] Fix undefined symbol errors on VS8.0 build

2010-08-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Can someone explain why among the 6 calls to Py_GetFinalPathNameByHandle, 5 of 
them use VOLUME_NAME_DOS and only one uses VOLUME_NAME_NT?

--
nosy: +amaury.forgeotdarc
status: closed -> pending

___
Python tracker 

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



[issue8739] Update to smtpd.py to RFC 5321

2010-08-16 Thread Alberto Trevino

Alberto Trevino  added the comment:

On Monday, August 16, 2010 11:42:51 am you wrote:
> Re-adapted patch including size_limit change as described in my previous
> message is in attachment. Barry and Alberto, could you take a final look
> at it before committing?

Looks good to me.  If the tests pass, then I'm good to go.

--

___
Python tracker 

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



[issue7352] python2.6-config --ldflags out of /usr and missing -L

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, tarek

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18527/zipimport_read_directory.patch

___
Python tracker 

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



[issue9425] Rewrite import machinery to work with unicode paths

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

zipimport_read_directory.patch commited as r84095.

--

___
Python tracker 

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



[issue9562] Slightly misleading wording in documentation of dict.update

2010-08-16 Thread Éric Araujo

Éric Araujo  added the comment:

+1 on committing this change.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue9618] IDLE shell ignores all but first statement

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, kbk

___
Python tracker 

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



[issue7741] Allow multiple statements in code.InteractiveConsole.push

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue9189] Improve CFLAGS handling

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Build
nosy: +eric.araujo
type:  -> behavior

___
Python tracker 

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



[issue9189] Improve CFLAGS handling

2010-08-16 Thread Éric Araujo

Changes by Éric Araujo :


Removed file: http://bugs.python.org/file18062/smime.p7s

___
Python tracker 

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



[issue8739] Update to smtpd.py to RFC 5321

2010-08-16 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Re-adapted patch including size_limit change as described in my previous 
message is in attachment.
Barry and Alberto, could you take a final look at it before committing?

--
Added file: http://bugs.python.org/file18546/smtpd.patch

___
Python tracker 

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



[issue9599] Add PySys_FormatStdout and PySys_FormatStderr functions

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

Commited as r84094 to 3.2.

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



[issue7352] python2.6-config --ldflags out of /usr and missing -L

2010-08-16 Thread Joel Brobecker

Joel Brobecker  added the comment:

More update on this patch: It's incomplete, and possibly wrong, unfortunately. 
The issue that someone else noticed is that it does not handle the case when 
Python was configured with --libdir=...; and I think that the default lib dir 
on platforms such as Windows and Darwin might be different from the traditional 
/lib as well, although I don't remember anymore (I did the 
investigation a couple of weeks ago).

I tried to find simple ways to update the script to make it work with a 
different libdir, but to no avail. :-(

I think that the best option is to enhance the sysconfig module to return the 
relocated lib path, but the problem is that the script would no longer work 
with older versions of Python (as older versions of Python would be missing 
that function). Perhaps one possible acceptable compromise is to call that 
function only when available and default to the old behavior otherwise. So it'd 
still be working as well as it does now with older versions of Python, while 
being slightly better with newer ones...

Just some thoughts...

--

___
Python tracker 

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



[issue1615] descriptor protocol bug

2010-08-16 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue9622] Allow to set profile/trace function globally

2010-08-16 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson :

issue 9609 updates _lsprof.c to be multi-stack aware.  This allows 
cProfile.Profile() objects to be shared by many threads and provide meaningfull 
results.

This update makes it more convenient to profile running, multi-threaded, 
applications.  By adding a set of global (cross thread) profiling hooks that 
override the per-thread hooks, it is possible to enable and disable 
profiling/tracing for the entire program.

A multithreaded python could then do something like this:
def ProfileMe(t):
  p = cProfile.Profile()
  p.enable(global=True)
  time.sleep(t)
  p.disable()
  p.print_stats()

A patch is provided, also, an updated _lsprof adding the new 'global' flag to 
the "enable" function.

(This paradigm is used successfully in EVE, albeit with "global" there meaning 
all tasklets, to do snapshot profiling of a running server.  The results are 
displayed on a web page served by the server backend.)

--
components: Interpreter Core
files: globaltrace.patch
keywords: patch, patch
messages: 114054
nosy: krisvale
priority: normal
severity: normal
status: open
title: Allow to set profile/trace function globally
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file18545/globaltrace.patch

___
Python tracker 

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



[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

2010-08-16 Thread STINNER Victor

STINNER Victor  added the comment:

> Note that the buffer interface release API is meant to protect
> against such modifications, so I don't see why rejecting objects
> that do implement this API should be rejected.

As I explained, the release API is *not* used by PyObject_AsCharBuffer() in 
Python 2.7 and 3.2.

Pseudo-code example:
---
PyObject_AsCharBuffer(obj, &str, &size)
... modify or destroy obj ...
str is no more valid here
---

> Restricting the API to read-only buffers would seriously limit
> it's functionality. I'm -1 on doing that.

PyObject_AsCharBuffer() is dangerous because the caller has to ensure that the 
object is not modified or destroyed. Antoine proposes to deprecated 
PyObject_AsCharBuffer().

PyObject_GetBuffer() can replace PyObject_AsCharBuffer(): it's easy to get the 
pointer to the buffer content (view.buf) and the size (view.len) using 
PyObject_GetBuffer(), and it does protect the buffer against modification or 
destuction thanks to the release API (PyBuffer_Release). But 
PyObject_GetBuffer() is maybe a little bit to low level, eg. it doesn't check 
that the buffer is contiguous, and it requires a flag argument. A new function 
is maybe needed to replace PyObject_AsCharBuffer(). Eg. 
PyObject_GetCharBuffer() which will call PyObject_GetBuffer() (the caller will 
then have to call PyBuffer_Release() to release the buffer).

Example:
---
PyObject_GetCharBuffer(obj, &view, &str, &size)
... use str and size ...
PyBuffer_Release(view);
---
or just
---
PyObject_GetCharBuffer(obj, &view)
... use view.buf and view.len ...
PyBuffer_Release(view);
---

--

___
Python tracker 

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



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2010-08-16 Thread Tim Golden

Changes by Tim Golden :


--
components: +Windows
nosy: +tim.golden

___
Python tracker 

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



[issue6724] r74463 causes failures in test_xmlrpc

2010-08-16 Thread Mark Lawrence

Mark Lawrence  added the comment:

Does this still need a patch or can it be closed?

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2010-08-16 Thread Mark Lawrence

Changes by Mark Lawrence :


--
stage:  -> patch review
type:  -> behavior
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue9145] test_coercion fails in refleak runs

2010-08-16 Thread Florent Xicluna

Florent Xicluna  added the comment:

Fixed in 2.6.6 with release manager approval on r84093.

--
status: open -> closed

___
Python tracker 

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



[issue1982] Feature: extend strftime to accept milliseconds

2010-08-16 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
resolution:  -> out of date
stage: unit test needed -> 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



[issue8739] Update to smtpd.py to RFC 5321

2010-08-16 Thread Alberto Trevino

Alberto Trevino  added the comment:

On Sunday, August 15, 2010 09:19:27 am Giampaolo Rodola' wrote:
> Patch no longer applies cleanly because smtpd.py changed in the meantime.

Is someone going to fix that or I am expected to play daily catch-up until 
this gets merged?

> A further comment:
> 
> -def __init__(self, server, conn, addr):
> +def __init__(self, server, conn, addr, size = 0):
> -def __init__(self, localaddr, remoteaddr):
> +def __init__(self, localaddr, remoteaddr, size = 0):
> 
> This change breaks backward compatibility. I think it would be better to
> provide this as a SMTPChannel.size_limit class attribute.

Unfortunately, I don't have the time in the next few weeks to make that 
change.  Can someone else make it?

--

___
Python tracker 

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



[issue9621] Graphviz output for 2to3 fixer patterns

2010-08-16 Thread Matt Bond

New submission from Matt Bond :

As part of my GSoC project working on 2to3, I've created a script which will 
allow compiled fixer patterns to be visualized using graphviz. This would be 
useful for debugging and understanding exactly how patterns are matched. I've 
written using the 2to3 sandbox as my base.

The script is named pat2dot and is found in the scripts directory. The script 
currently relies on an external graphviz library (I provided bindings for the 
GvGen library with this patch), they are separated enough from the rest of the 
code that it would be trivial to create a class that would work using a 
different graphviz library. Additionally, since the code is never called within 
2to3 proper, this dependency will only appear if you wish to use pat2dot, and 
will not affect any other usages of lib2to3.

Usage of the script is `python pat2dot.py fixername` where fixername is any 
fixer provided in 2to3, as named by 2to3's -l option.

--
components: 2to3 (2.x to 3.0 conversion tool)
files: 2to3-graph.diff
keywords: patch
messages: 114049
nosy: facundobatista, gmattbond, loewis
priority: normal
severity: normal
status: open
title: Graphviz output for 2to3 fixer patterns
versions: Python 2.6
Added file: http://bugs.python.org/file18544/2to3-graph.diff

___
Python tracker 

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



[issue7902] relative import broken

2010-08-16 Thread Florent Xicluna

Florent Xicluna  added the comment:

Btw, the comment and failure message in r81380/r81381 look wrong.

-# If absolute import syntax is used, then do not try to perform
-# a relative import in the face of failure.
+# If explicit relative import syntax is used, then do not try
+# to perform an absolute import in the face of failure.

 self.fail("explicit relative import triggered "
-  "an implicit relative import")
+  "an implicit absolute import")


In addition the TestCase.assertRaises method could be used:

def test_absolute_import_without_future(self):
# If explicit relative import syntax is used, then do not try
# to perform a relative import in the face of failure.
# Issue #7902.
with self.assertRaises(ImportError):
from .os import sep
self.fail("explicit relative import triggered an "
  "implicit absolute import")

--
nosy: +flox

___
Python tracker 

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



[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I think the main problem here is that it's not easy to write reliable tests 
that work across all platforms (getaddrinfo(host, 'ftp') returning UDP 
addresses on FreeBSD/Qemu only is an example).
We might try to go a little deeper as you suggested but it's very likely that 
some buildbots turn red, IMHO.

> One example of this: test the 'family' flag by looking for 
> www.google.com with both AF_INET and AF_INET6 and then check that the 
> first returns IPv4 information and the second IPv6.

This is already done, although for IPv4 only and by using localhost instead of 
google.com.

infos = socket.getaddrinfo(HOST, None, socket.AF_INET)
for family, _, _, _, _ in infos:
self.assertEqual(family, socket.AF_INET)

I'm attaching a new patch which adds some additional checks.
Feel free to extend it, if you want.

--
Added file: http://bugs.python.org/file18543/getaddrtests.patch

___
Python tracker 

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



[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

2010-08-16 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> New submission from STINNER Victor :
> 
> mmap, buffer, bytearray, string and unicode objects set the char buffer 
> callback (bf_getcharbuffer). The bytearray object sets also the release 
> buffer callback (bf_releasebuffer).
> 
> In Python 2.7, PyObject_AsCharBuffer() accepts bytearray objects, whereas the 
> "t#" format of PyArg_Parse functions rejects byte bytearray objects (expect 
> an "pinned buffer object").
> 
> In Python 3.2, PyObject_AsCharBuffer() releases the buffer.
> 
> PyObject_AsCharBuffer() documentation (in 2.7 and 3.2) says that the function 
> only accepts read-only objects.
> 
> Something is wrong here. If the caller doesn't hold a kind of lock, the 
> object cannot be protected against futher modifications. The caller has to 
> ensure that the object is not modifiable until it finishs to use the char* 
> pointer.
> 
> I think that it would be safer to respect the documentation: 
> PyObject_AsCharBuffer() should only accept read-only objects. The most 
> important change is that functions using PyObject_AsCharBuffer() will not 
> accept bytearray objects anymore.
> 
> Attached patch (for Python 2.7) changes PyObject_AsCharBuffer() to reject 
> modifiable objects. It removes also the character buffer callback from the 
> bytearray type. To avoid breaking compatibility too much, I patched int(), 
> long() and float() to still support bytearray objects.
> 
> Examples of functions rejecting bytearray with the patch:
>  - int(), long(), float(), complex()
>  - many str methods: split, partition, rpartition, rsplit, index, find, 
> count, translate, replace, startswith, endswith
>  - writelines() of file objects (eg. sys.stdout.writelines)
>  - writelines() method of a bz2 file
> 
> --
> 
> My patch breaks backward compatibility, and I don't know that it is 
> acceptable in Python 2.7.

Simple answer: no.

Long answer: The caller is responsible for making sure that the object
is not modified while in use.

> I will write a similar patch for Python 3.2.

Restricting the API to read-only buffers would seriously limit
it's functionality. I'm -1 on doing that.

Instead, it's better to clarify the documentation and mention the
fact that the used object may not change during use.

Note that the buffer interface release API is meant to protect
against such modifications, so I don't see why rejecting objects
that do implement this API should be rejected. It's object that
don't implement the release buffer slot which you'd have to worry
about. Then again, this has never really been an issue in practice
during the 10 years of the 2.x branch, so I wouldn't call this
a serious issue.

See PEP 3118... "All that is specifically required by the exporter, however, is 
to ensure that any
memory shared through the bufferinfo structure remains valid until 
releasebuffer is called on the
bufferinfo structure exporting that memory."

--
nosy: +lemburg

___
Python tracker 

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



[issue9592] Limitations in objects returned by multiprocessing Pool

2010-08-16 Thread Jesse Noller

Jesse Noller  added the comment:

Thanks Freek - we're actually discussing some stuff like this in issue9205 as 
well

--

___
Python tracker 

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



[issue1982] Feature: extend strftime to accept milliseconds

2010-08-16 Thread Thomas Guettler

Thomas Guettler  added the comment:

Yes, I think this can be closed, too.

--
nosy: +guettli

___
Python tracker 

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



[issue5622] wrong error from curses.wrapper if curses initialization fails

2010-08-16 Thread Freek Dijkstra

Freek Dijkstra  added the comment:

I can confirm that both the problem exists and the patch works on Python 2.6 
and 3.1. I love to see it committed.

--
nosy: +macfreek

___
Python tracker 

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



[issue9257] cElementTree iterparse requires events as bytes; ElementTree uses strings

2010-08-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

No, apparently, r78942 was not included in 3.1.2.

--

___
Python tracker 

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



[issue9587] unittest.assertRaises() return the raised exception

2010-08-16 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Pehaps it hasn't been demonstrated before, but just for the sake of argument 
(and because I'm a persistant bugger), here are the two different cases:

current:
ctxt = self.assertRaises(MyException)
with ctxt:
foo()
self.assertEqual(ctxt.exception.value, 1)

suggested:
e = self.assertRaises(MyExcetpion, foo)
self.assertEqual(e.value, 1)

The inconvenient bit about the current method is having to keep the context 
manager around.  Also note that the current way of looking at the exception 
object makes it blatantly clear that self.assertRaises() is returning an 
object.  That, imho, breaks the argument about self.assert* methods not 
returning any info.

--

___
Python tracker 

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



[issue9592] Limitations in objects returned by multiprocessing Pool

2010-08-16 Thread Freek Dijkstra

Freek Dijkstra  added the comment:

If it would help to separate things, let me know, and I split this up in three 
separate bug reports.

(For the record, knowing these limitations, I could work around it in my code, 
so they are low priority for me; I just think that it will benefit other users 
if multiprocessing would fail graciously with a clear exception. Though I 
probably can't help solving the issues, I can write a unit test).

--

___
Python tracker 

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



[issue9620] IDLE subprocess error

2010-08-16 Thread beng umali

New submission from beng umali :

I can't seem to get my head around solving this problem after installing Python 
2.7 on a mac os x 10.6.4. The error message that comes out after clicking IDLE 
from the applications reads:

"IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess 
or personal firewall software is blocking the connection."

Appreciate any help.

Cheers!

--
components: +IDLE
title: IDLE -> IDLE subprocess error
versions: +Python 2.7

___
Python tracker 

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



[issue9620] IDLE

2010-08-16 Thread beng umali

Changes by beng umali :


--
nosy: bpumali
priority: normal
severity: normal
status: open
title: IDLE

___
Python tracker 

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



[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Daniel Urban

Daniel Urban  added the comment:

I'm attaching a new patch containing also some documentation for the two new 
decorators. The doc is rather terse, and english is not my first language, so 
please let me know if some corrections are needed.

--
Added file: http://bugs.python.org/file18542/abstractclassstaticmethod+doc.diff

___
Python tracker 

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