[issue8761] PyUnicode_CompareWithASCIIString name is not mangled (UCS2, UCS4)

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

Martin v. Löwis  added the comment:

It's fine to apply to 3.2.

--
nosy: +loewis
resolution:  -> accepted

___
Python tracker 

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



[issue3051] heapq change breaking compatibility

2010-05-18 Thread R. David Murray

R. David Murray  added the comment:

For what it's worth, I agree with Fijal.  I think the python version and the C 
version should behave the same, so that other implementations of Python can use 
the Python version and be compatible wtih CPython.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue8750] Many of MutableSet's methods assume that the other parameter is not self

2010-05-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Here's a possible fix:

def __isub__(self, it):
if it is self:
self.clear()
else:
for value in it:
self.discard(value)
return self

--
nosy: +rhettinger
versions: +Python 2.6, Python 3.1

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Brett Cannon

Brett Cannon  added the comment:

It wouldn't matter (at least in Python 3) as str is unicode-aware. It's more 
about whether it's worth special-casing the output. I say no and just go with 
using the repr.

--

___
Python tracker 

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



[issue8707] Duplicated document in telnetlib.

2010-05-18 Thread Evelyn Mitchell

Evelyn Mitchell  added the comment:

Fixed for 3.1 branch

--
Added file: http://bugs.python.org/file17397/telnetlib3.1.diff

___
Python tracker 

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



[issue8707] Duplicated document in telnetlib.

2010-05-18 Thread Evelyn Mitchell

Evelyn Mitchell  added the comment:

Fixed for 2.7 branch

--
Added file: http://bugs.python.org/file17396/telnetlib2.7.diff

___
Python tracker 

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



[issue8707] Duplicated document in telnetlib.

2010-05-18 Thread Evelyn Mitchell

Evelyn Mitchell  added the comment:

Fixed for 2.6 branch

--
Added file: http://bugs.python.org/file17395/telnetlib2.6.diff

___
Python tracker 

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



[issue8707] Duplicated document in telnetlib.

2010-05-18 Thread Evelyn Mitchell

Evelyn Mitchell  added the comment:

Fixed for 3.2 branch.

--
keywords: +patch
nosy: +efm
Added file: http://bugs.python.org/file17394/telnetlib3.2.diff

___
Python tracker 

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



[issue7245] better Ctrl-C support in pdb (program can be resumed) (issue216067)

2010-05-18 Thread Ilya Sandler

Ilya Sandler  added the comment:

I tried to understand the cause of failures and I don't see how test_pdb2 could 
have caused them ;-).

Here is the relevant part of buildbot timeline:

http://www.python.org/dev/buildbot/trunk/?last_time=1273368351&show_time=7400

The only test failures which have  log files were sparc solaris 10 and ia64 and 
both failures were in test_unittest. All other buildbot failures don't have 
test logs associated with them..

Is there a way to  access test logs for other platforms?

--

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2010-05-18 Thread Michele

Michele  added the comment:

Attached ccbench-osx.log made today on OSX on latest svn checkout. Hope it helps

--
nosy: +Michele
Added file: http://bugs.python.org/file17393/ccbench-osx.log

___
Python tracker 

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



[issue8762] default value in constructor not unique across objects

2010-05-18 Thread Ray.Allen

Ray.Allen  added the comment:

Here is the explanation from Python Language Reference 7.6: Function Definitions
"""
When one or more top-level parameters have the form parameter = expression, the 
function is said to have ``default parameter values.'' For a parameter with a 
default value, the corresponding argument may be omitted from a call, in which 
case the parameter's default value is substituted. If a parameter has a default 
value, all following parameters must also have a default value -- this is a 
syntactic restriction that is not expressed by the grammar. 
Default parameter values are evaluated when the function definition is 
executed. This means that the expression is evaluated once, when the function 
is defined, and that that same ``pre-computed'' value is used for each call. 
This is especially important to understand when a default parameter is a 
mutable object, such as a list or a dictionary: if the function modifies the 
object (e.g. by appending an item to a list), the default value is in effect 
modified. This is generally not what was intended. A way around this is to use 
None as the default, and explicitly test for it in the body of the function, 
e.g.: 

def whats_on_the_telly(penguin=None):
if penguin is None:
penguin = []
penguin.append("property of the zoo")
return penguin
"""

--
nosy: +ysj.ray

___
Python tracker 

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



[issue8070] Infinite loop in PyRun_InteractiveLoopFlags() if PyRun_InteractiveOneFlags() raises an error

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

tlesher> If you don't have time to update the patch, let me know and I'll put 
one together.

I would be happy if you write a new patch :-)

--

___
Python tracker 

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



[issue8762] default value in constructor not unique across objects

2010-05-18 Thread R. David Murray

R. David Murray  added the comment:

This is not a bug, it's how Python works.  Default values are computed at 
function definition time, so there's only one list across all the function 
invocations.

--
nosy: +r.david.murray
resolution:  -> invalid
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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

A refinement would be to only quote when there is whitespace in the name, but I 
do not know how well that works with unicode versus ascii.

--

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I refinement would be to only quote when there is whitespace in the name, but I 
do not know how well that works with unicode versus ascii.

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file16458/pyunicode_asstringordefault.patch

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

Remove pyunicode_asstringordefault.patch and pythonrun-py3k.patch because the 
new _PyUnicode_AsStringOrDefault() function was rejected (and it's easy to 
avoid it).

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file16461/pythonrun-py3k.patch

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81324 fixes 2 calls in typeobject.c

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81323 fixes 4 calls in _sqlite.

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81322 fixes 2 calls in textio.c.

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81321 fixes 2 calls in builtin_input() (if sys.stdin or sys.stdout encoding 
contain a surrogate: this is *very* unlikely :-)).

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81320 fixes a call in vgetargskeywords() (PyArg_ParseTupleAndKeywords).

--

___
Python tracker 

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



[issue8762] default value in constructor not unique across objects

2010-05-18 Thread andrew

New submission from andrew :

After debugging for a while I finally released that I stumbled across a Python 
bug (at least I believe it is). Here is a proof of concept that produces the 
issue:

!/usr/bin/python

class blah:

def __init__(self, items=[]):
self.items = items

a = blah()
b = blah()

a.items.append("apples")
b.items.append("oranges")

print a.items
print b.items
print id(a.items)
print id(b.items)


and here is the output when the program is run:

r...@x:~# python pythonbug.py
['apples', 'oranges']
['apples', 'oranges']
135923500
135923500
r...@x:~#

as you can see the 'items' reference is the same for both objects even though 
they are different objects. I checked the manual and I couldn't find anything 
explaining such behavior. Can this possibly be correct?

My python info:

Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48)

--
messages: 106018
nosy: bolt
priority: normal
severity: normal
status: open
title: default value in constructor not unique across objects
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue8729] The Mapping ABC's __eq__ method should return NotImplemented if the other type is not a Mapping

2010-05-18 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Here's a patch that adds test cases.  It exercises all of the following special 
methods on Set and Mapping to ensure that they return NotImplemented if they 
don't recognize the other type.

lt, gt, le, ge, eq, ne, or, and, xor, sub

I made the patch against the py3k branch.

I made the test-case patch separate to make it easier to see the before and 
after behavior of the actual fix.

--
Added file: http://bugs.python.org/file17392/eq-test.patch

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

r81314 fixes 2 calls in _PyModule_Clear().

--

___
Python tracker 

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



[issue8761] PyUnicode_CompareWithASCIIString name is not mangled (UCS2, UCS4)

2010-05-18 Thread STINNER Victor

New submission from STINNER Victor :

In unicodeobject.h, you can see:

# define PyUnicode_CompareWithASCII PyUnicodeUCS2_CompareASCII
...
# define PyUnicode_CompareWithASCII PyUnicodeUCS4_CompareWithASCII
...
PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
PyObject *left,
const char *right
);

The defines miss the String suffix :-/

Attached patch adds the suffix but I guess that it breaks backward 
compatibility. Is it a problem to apply this patch in Python 3.2 (but not in 
Python 3.1)?

--
components: Unicode
files: pyunicode_compareascii.patch
keywords: patch
messages: 106015
nosy: haypo
priority: normal
severity: normal
status: open
title: PyUnicode_CompareWithASCIIString name is not mangled (UCS2, UCS4)
versions: Python 3.2
Added file: http://bugs.python.org/file17391/pyunicode_compareascii.patch

___
Python tracker 

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



[issue7447] Sum() doc and behavior mismatch

2010-05-18 Thread Leonhard Vogt

Leonhard Vogt  added the comment:

I changed the documentation regarding string not allowed as start argument and 
performance

I included the list concatenation with itertools.chain from
http://groups.google.com/group/comp.lang.python/msg/33e764d0ac41826a

patch is based on revision 81300 in py3k branch.

--
keywords: +patch
nosy: +lvogt
Added file: http://bugs.python.org/file17390/functions.rst.patch

___
Python tracker 

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



[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

Attached patch creates PySys_AddWarnOptionUnicode() function and decodes 
PYTHONWARNINGS variable with the file system encoding (as it is done for 
os.environ, to be consistent) instead of the locale encoding.

The patch only concerns the POSIX version. Windows is not affected by this 
issue (see below).

--

This issue occurs if the file system encoding is different than the locale 
encoding (especially if the locale encoding is ASCII). It only occurs on Mac OS 
because on this OS, the file system encoding is hardcoded to UTF-8 whereas the 
locale encoding... depends on the locale.

I reproduced the bug on Linux by hardcoding the file system encoding to UTF-8.

--

About the test output (UnicodeEncodeError: 'ascii' codec can't encode character 
'\xf3' ...): I think that Michael Foord executed directly 
Lib/test/test_warnings.py instead of using "Lib/test/regrtest.py -v 
test_warnings". I only patched regrtest.py to use backslashreplace error 
handler on sys.stdout.

--
keywords: +patch
Added file: http://bugs.python.org/file17389/sys_warnoptions_encoding.patch

___
Python tracker 

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



[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

os.environ is decoded with sys.getfilesystemencoding(), whereas PYTHONWARNINGS 
is decoded with the locale encoding (locale.getpreferredencoding()) :-/

--

___
Python tracker 

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



[issue8760] Python 2.6.5 fails to build on AIX 5.3

2010-05-18 Thread Orlando Irrazabal

New submission from Orlando Irrazabal :

Build of Python 2.6.5 on AIX 5.3 fails with the below error message.

The configure line is:
./configure 

[...]
building '_multiprocessing' extension
cc_r -qlanglvl=extc89 -DNDEBUG -O -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. 
-I/sw_install/python-2.6.5/./Include -I. -IInclude -I./Include 
-I/usr/local/include -I/sw_install/python-2.6.5/Include 
-I/sw_install/python-2.6.5 -c 
/sw_install/python-2.6.5/Modules/_multiprocessing/multiprocessing.c -o 
build/temp.aix-5.3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/multiprocessing.o
cc_r -qlanglvl=extc89 -DNDEBUG -O -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. 
-I/sw_install/python-2.6.5/./Include -I. -IInclude -I./Include 
-I/usr/local/include -I/sw_install/python-2.6.5/Include 
-I/sw_install/python-2.6.5 -c 
/sw_install/python-2.6.5/Modules/_multiprocessing/socket_connection.c -o 
build/temp.aix-5.3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/socket_connection.o
cc_r -qlanglvl=extc89 -DNDEBUG -O -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1 
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I. 
-I/sw_install/python-2.6.5/./Include -I. -IInclude -I./Include 
-I/usr/local/include -I/sw_install/python-2.6.5/Include 
-I/sw_install/python-2.6.5 -c 
/sw_install/python-2.6.5/Modules/_multiprocessing/semaphore.c -o 
build/temp.aix-5.3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/semaphore.o
./Modules/ld_so_aix cc_r -qlanglvl=extc89 -bI:Modules/python.exp 
build/temp.aix-5.3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/multiprocessing.o
 
build/temp.aix-5./multim3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/socket_connection.o
 
build/temp.aix-5.3-2.6/sw_install/python-2.6.5/Modules/_multiprocessing/semaphore.o
 -L/usr/local/lib -o build/lib.aix-5.3-2.6/_multiprocessing.so
checking build system type... powerpc-ibm-aix5.3.0.0
checking host system type... powerpc-ibm-aix5.3.0.0
checking target system type... powerpc-ibm-aix5.3.0.0
checking for a BSD-compatible install... 
/sw_install/python-2.6.5/Modules/_ctypes/libffi/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... 
/sw_install/python-2.6.5/Modules/_ctypes/libffi/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gcc... cc_r -qlanglvl=extc89
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc_r -qlanglvl=extc89 accepts -g... yes
checking for cc_r -qlanglvl=extc89 option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of cc_r -qlanglvl=extc89... none
checking dependency style of cc_r -qlanglvl=extc89... none
checking whether cc_r -qlanglvl=extc89 and cc understand -c and -o together... 
yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for non-GNU ld... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... cc_r -qlanglvl=extc89 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... xlC_r
checking whether we are using the GNU C++ compiler... no
checking whether xlC_r accepts -g... yes
checking dependency style of xlC_r... none
checking how to run the C++ preprocessor... xlC_r -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checki

[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

The test was introduced by r80066 (issue #7301).

--

___
Python tracker 

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



[issue8759] 2.7: wrong user site directory on Linux; totally missing on OSX

2010-05-18 Thread Sridhar Ratnakumar

New submission from Sridhar Ratnakumar :

sridh...@triple:~$ /opt/ActivePython-2.7/bin/python -c "import sys; print 
sys.path; import cmdln"
['', '/opt/ActivePython-2.7/lib/python27.zip', 
'/opt/ActivePython-2.7/lib/python2.7', 
'/opt/ActivePython-2.7/lib/python2.7/plat-linux2', 
'/opt/ActivePython-2.7/lib/python2.7/lib-tk', 
'/opt/ActivePython-2.7/lib/python2.7/lib-old', 
'/opt/ActivePython-2.7/lib/python2.7/lib-dynload', 
'/home/sridharr/.local/lib/python/2.7/site-packages', 
'/opt/ActivePython-2.7/lib/python2.7/site-packages']
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named cmdln
sridh...@triple:~$ file 
/home/sridharr/.local/lib/python2.7/site-packages/cmdln.py 
/home/sridharr/.local/lib/python2.7/site-packages/cmdln.py: a python script 
text executable


On OSX, I don't even see a ~/.local directory!

python2.7 -c "import sys; print sys.path"
['', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', 
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages']

Works as expected on Windows, though.

--
components: Library (Lib)
messages: 106009
nosy: srid
priority: normal
severity: normal
status: open
title: 2.7: wrong user site directory on Linux; totally missing on OSX
type: behavior
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



[issue8758] BUILD_LIST followed by BINARY_SUBSCR can be optimized to a BUILD_TUPLE if all members of the list are constants

2010-05-18 Thread Alex

New submission from Alex :

We do the same thing for a BUILD_LIST followed by a COMPARE_OP (in).

--
components: Interpreter Core
messages: 106008
nosy: alex
priority: normal
severity: normal
status: open
title: BUILD_LIST followed by BINARY_SUBSCR can be optimized to a BUILD_TUPLE 
if all members of the list are constants
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue8757] Race condition when checking for set in set

2010-05-18 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

"some_set in some_set_of_sets" contains a race condition that can lead to odd 
behavior.  To perform the test, the set_contains() function in setobject.c 
creates a temporary frozenset object (t), swaps the bodies of some_set and t, 
checks if t is in some_set_of_sets, then swaps the bodies back.

Unfortunately, comparisons or hash functions may release the GIL, so the 
swapped bodies may be exposed on a different thread, i.e., "some_set in 
some_set_of_sets" may cause "some_set" to be empty on some other thread.

The same race condition exists in set_discard() and set_remove().

Attached is a short script that demonstrates the problem and could be easily 
converted to a unit test.

--
components: Interpreter Core
files: set-race.py
messages: 106007
nosy: stutzbach
priority: normal
severity: normal
status: open
title: Race condition when checking for set in set
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file17388/set-race.py

___
Python tracker 

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



[issue8640] subprocess: canonicalize env to bytes on Unix (Python3)

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

My patch to fix #8513 does also fix the examples of this issue and so I think 
that the canonicalization is no more needed. I will only reopen the issue if I 
find a good reason to apply the patch :-)

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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

It slipped under my radar as well. Thanks.
Fixed in r81294 (trunk), r81298 (2.6), r81299 (3.2) and r81300 (3.1) which also 
add tests and include NameError in the list of possible exceptions in case 
os.strerror() is not supported on the current platform (e.g. Windows CE) in 
which case "unknown error $number$" is returned.

--

___
Python tracker 

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



[issue8752] set_contains, etc. should check for collections.Set in addition to PySet_Check

2010-05-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I don't think the set methods can make assumptions about whether instances of 
the Set API can be made frozen.  It is okay to restrict this to just instances 
of "set" where we know its internal structure and know that its elements are 
hashable (see the collections docs for an example of a non-hashable set).

Also, the collections.Set methods are supposed to be minimal.  They are not 
intended to mimic every aspect of regular set objects.

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



[issue3051] heapq change breaking compatibility

2010-05-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Am closing this.  It would make no sense to change simple, pure python code to 
support objects implementing only one of the rich comparison methods.  People 
implementing rich comparisons need to implement all six if they want to 
guarantee total ordering and to be usable by various modules that need to be 
able to make comparisons.

FWIW, the C code is not guaranteed to be exactly the same in terms of 
implementation details, only the published API should be the same.  And, for 
this module, a decision was made for the C code to support only lists 
eventhough the pure python version supports any sequence.

--
status: open -> closed

___
Python tracker 

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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Longpoke

Longpoke  added the comment:

Yes, it should definately be os.sterror. Dunno how I ended up omitting that, 
sorry.

--

___
Python tracker 

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



[issue8729] The Mapping ABC's __eq__ method should return NotImplemented if the other type is not a Mapping

2010-05-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Yes, I think this is a good candidate for backport. The ABCs are new and their 
APIs shouldn't contain any obvious bugs such as this.

--
nosy: +pitrou
versions: +Python 2.6, Python 3.1

___
Python tracker 

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



[issue8729] The Mapping ABC's __eq__ method should return NotImplemented if the other type is not a Mapping

2010-05-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Backport to 2.6 and 3.1?

--

___
Python tracker 

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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Éric Araujo

Changes by Éric Araujo :


--

___
Python tracker 

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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Éric Araujo

Éric Araujo  added the comment:

Hopefully fixing yet another lovely browser or roundup forms friggin bug. Sorry.

--
assignee:  -> giampaolo.rodola
nosy: +giampaolo.rodola, josiahcarlson
type: crash -> 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



[issue8573] Buggy _strerror in asyncore

2010-05-18 Thread Éric Araujo

Éric Araujo  added the comment:

I’ve just checked the diff and the current trunk version of the file, and the 
change from “os.strerror(err)” to “strerror(err)” seems buggy to me.

--
assignee: giampaolo.rodola -> 
nosy:  -giampaolo.rodola, josiahcarlson
resolution: fixed -> 
stage: committed/rejected -> 
status: closed -> open
type: behavior -> crash
versions:  -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



[issue8756] Multiprocessing and UUID bug on Mac OSX

2010-05-18 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> uuid.uuid4() generates non-unique values on OSX

___
Python tracker 

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



[issue8756] Multiprocessing and UUID bug on Mac OSX

2010-05-18 Thread Gavin Roy

New submission from Gavin Roy :

import multiprocessing
import uuid

def test():
print str(uuid.uuid4())

p = multiprocessing.Pool(processes=4)
for x in xrange(0, 4):
  p.apply_async(test)

In MacOS:

Gavin-M-Roys-Office-iMac:kvpbench gmr$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> import multiprocessing
>>> import uuid
>>> 
>>> def test():
... print str(uuid.uuid4())
... 
>>> p = multiprocessing.Pool(processes=4)
>>> for x in xrange(0, 4):
...   p.apply_async(test)
... 




>>> 62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7

In Linux:

g...@binti ~ $ python
Python 2.6.4 (r264:75706, Mar  9 2010, 17:27:45) 
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> import uuid
>>> 
>>> def test():
... print str(uuid.uuid4())
... 
>>> p = multiprocessing.Pool(processes=4)
>>> for x in xrange(0, 4):
...   p.apply_async(test)
... 




>>> 6121782c-008d-42db-9df5-bbf619fb6568
ee7d3ef8-1c54-4ab5-bf06-1eddf5bcf2cb
40efe282-65a5-4160-96ee-b4cc0d14029d
9eb799f2-a46c-41e8-901f-423177f3467d

--
assignee: ronaldoussoren
components: Macintosh
messages: 105997
nosy: Gavin.Roy, ronaldoussoren
priority: normal
severity: normal
status: open
title: Multiprocessing and UUID bug on Mac OSX
versions: Python 2.6

___
Python tracker 

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



[issue8755] idle crash UnicodeDecodeError utf-8 codec

2010-05-18 Thread Andy Harrington

New submission from Andy Harrington :

I was editing in idle in python 3.1, typing away.  I had been doing it for 
hours.  I do not think I had jumped to the shell window.  Suddenly idle 
crashed, with this error message in the the  ubuntu 9,10 terminal window:

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

I do not know what key combination I had just typed.  I may have just hit a 
crtl or alt combination.

The hardware is an Acer notebook.

This is certainly an exception that should be caught!  I did not get to even 
save my work.

--
components: IDLE
messages: 105996
nosy: andyharrington
priority: normal
severity: normal
status: open
title: idle crash  UnicodeDecodeError utf-8 codec
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



[issue8335] distutils test_build_ext's test_get_outputs fails in bootstrap environment

2010-05-18 Thread Dylan Canfield

Dylan Canfield  added the comment:

I am having the exact same problem with test_distutils failing on a clean env. 
Did reverting the changes in r72637 fix your problem?

--
nosy: +Canfield

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Brett Cannon

Changes by Brett Cannon :


--
keywords: +easy

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Brett Cannon

Brett Cannon  added the comment:

I guess it's a question of readability. Does::

  ImportError: No module named mod

read better than::

  ImportError: No module named 'mod'

In my eyes it doesn't by much, so switching to using repr() seems reasonable.

This can't be changed in released versions of Python as that could break 
someone's doctests. So making this only for 2.7 and 3.2.

--
nosy: +brett.cannon
priority: normal -> low
stage:  -> needs patch
versions:  -Python 2.6, Python 3.1

___
Python tracker 

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



[issue8667] Link to PEP 3147 from importlib docs

2010-05-18 Thread Brett Cannon

Brett Cannon  added the comment:

Thanks for wanting to help, Ashley! And Senthil hit all the right points. If 
you need any help with the code checkout you can read 
http://www.python.org/dev/setup/ (and in general dev questions are hopefully 
answered by something linked from http://www.python.org/dev/ ).

--

___
Python tracker 

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



[issue7753] newgil backport

2010-05-18 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

Sorry for the nosy. There is something going wrong with my Firefox caching.

--

___
Python tracker 

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



[issue7753] newgil backport

2010-05-18 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


___
Python tracker 

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



[issue8513] subprocess: support bytes program name (POSIX)

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r81291 + r81292 (py3k).

The final commit contains much more tests ;-) I will watch the buildbot next 
hours and block the commit in 3.1.

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



[issue6419] Broken test_kqueue.py on OpenBSD

2010-05-18 Thread Henry Precheur

Henry Precheur  added the comment:

The patch works well with on amd64/OpenBSD-current (CVS from May 14 or
15).

I don't have access to a 4.7-stable right now.

On Fri, May 14, 2010 at 05:58:10PM +, Stefan Krah wrote:
> 
> Stefan Krah  added the comment:
> 
> Mark, thanks. - The patch is good on OpenBSD-4.5-i386-Celeron,
> but I get additional failures on OpenBSD-4.7-beta-amd64-QEMU.
> 
> This could be the result of running a beta under qemu.
> 
> Henry, could you confirm if the patch works on amd64/OpenBSD-4.7-stable?
> 
> 
> 
> ==
> FAIL: test_create_event (test.test_kqueue.TestKQueue)
> --
> Traceback (most recent call last):
>   File "/home/stefan/svn/py3k/Lib/test/test_kqueue.py", line 29, in 
> test_create_event
> self.assertEqual(ev.ident, fd)
> AssertionError: 562945658454018 != 2
> 
> ==
> FAIL: test_queue_event (test.test_kqueue.TestKQueue)
> --
> Traceback (most recent call last):
>   File "/home/stefan/svn/py3k/Lib/test/test_kqueue.py", line 130, in 
> test_queue_event
> (server.fileno(), select.KQ_FILTER_WRITE, flags)])
> AssertionError: Lists differ: [(1688841270329350, -2, 5), (1... != [(6, -2, 
> 0), (7, -2, 0)]
> 
> First differing element 0:
> (1688841270329350, -2, 5)
> (6, -2, 0)
> 
> - [(1688841270329350, -2, 5), (1688841270329351, -2, 5)]
> + [(6, -2, 0), (7, -2, 0)]
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue3051] heapq change breaking compatibility

2010-05-18 Thread Maciek Fijalkowski

Maciek Fijalkowski  added the comment:

I cannot honestly make much sense from what you said. My concern is whether 
python and C version behaves the same or not. It seems that in current version 
they intentionally behave differently, for simplicity and it's against policy 
of having the same functionality. I agree that it's an obscure corner case, but 
still.

--

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-05-18 Thread Terry J. Reedy

New submission from Terry J. Reedy :

ImportError messages should quote the name it cannot import since the actual 
problem may be whitespace in the name that is currently invisible in the 
message.  In other words, display

ImportError: no module named 'bad name\r'

instead of

ImportError: no module named bad name

This defect lead to the current python-list thread
  pickle unable to load collection

Peter Otten figured out that it was unable to load 'collections\r' rather than 
'collections', which he demonstrated with

>>> >>> try: pickle.loads(garbled_data)
... except ImportError as e:
... e
...
ImportError('No module named collections\r',)

The OP used 2.6, I tested 3.1, hence presume, after searching tracker issues, 
that this applies to 2.7 and 3.2 as well.

I marked this as a bug since the current message is wrong and misleading. I 
suspect the same may be true of a few other error messages, but I cannot think 
of any at the moment.

--
components: Interpreter Core
messages: 105988
nosy: tjreedy
priority: normal
severity: normal
status: open
title: ImportError: quote bad module name in message
type: behavior
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



[issue8741] 2.7 regression in tarfile: IOError: link could not be created

2010-05-18 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

Thanks - just a suggestion: it may be a good idea to add a test case for this 
makelink emulation code.

Also, any thoughts on raising (a derived class of) TarError instead of IOError?

--

___
Python tracker 

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



[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-05-18 Thread Daniel Stutzbach

Changes by Daniel Stutzbach :


--
assignee: stutzbach
components: Documentation
nosy: stutzbach
priority: normal
severity: normal
stage: needs patch
status: open
title: Py_ReprEnter and Py_ReprLeave are undocumented
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8751] Threading and KeyError: 51

2010-05-18 Thread Raghuram Devarakonda

Raghuram Devarakonda  added the comment:

As suggested, please post in c.l.py or other forums. Open a bug here only if 
you are sure that there is a bug in Python.

--
nosy: +draghuram
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue8751] Threading and KeyError: 51

2010-05-18 Thread Mattias Nilsson

Mattias Nilsson  added the comment:

Correct me if I'm wrong, but you seem to be creating a new lock object for each 
iteration in the loop?
If other threads should be blocked, they must be using the same lock object and 
you can't create new ones for each time you want to write something to the file.

This doesn't seem to be a Python bug at all, but instead a problem in your 
implementation. It might be better to post this at stackoverflow.com or 
somewhere similar.

--
nosy: +Mattias.Nilsson

___
Python tracker 

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



[issue7946] Convoy effect with I/O bound threads and New GIL

2010-05-18 Thread Peter Portante

Changes by Peter Portante :


--
nosy: +portante

___
Python tracker 

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



[issue8748] integer-to-complex comparisons give incorrect results

2010-05-18 Thread Mark Dickinson

Mark Dickinson  added the comment:

More fun arising from the current complex comparison implementation:  usually 
you can put a complex number and an integer into the same set:

>>> {1, 2j}  # (Python 3 code)
{1, 2j}
>>> s = {10**1000, 2j}  # huge integers no problem

But if you happen to pick the wrong combination

>>> x, n = 9.3 + 0j, 10**300*(2**64-1)+hash(9.3)
>>> x
(9.3+0j)
>>> n
18446744073709551615002107349606
>>> {x, n}
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: long int too large to convert to float

--

___
Python tracker 

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



[issue8752] set_contains, etc. should check for collections.Set in addition to PySet_Check

2010-05-18 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

For operations that test membership in a set, Python coerces sets and 
subclasses of set into a temporary frozenset before testing membership.

For example, this works:

>>> set() in set([frozenset()])
True

Although the set() is not hashable itself, Python creates a temporary 
frozenset() out of the set().  It should do the same for user-types derived 
from collections.Set, so they can inter-operate in the same way.

In setobject.c, the following methods behave in the described manner: 
set_contains, set_remove, and set_discard.

--
components: Interpreter Core
messages: 105983
nosy: stutzbach
priority: normal
severity: normal
stage: unit test needed
status: open
title: set_contains, etc. should check for collections.Set in addition to 
PySet_Check
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8741] 2.7 regression in tarfile: IOError: link could not be created

2010-05-18 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

@senthil: Yes, this is a platform-specific problem. The code that is failing is 
in fact supposed to somehow "emulate" symlink and hardlink extraction on 
platforms that don't support these, e.g. Windows. What tarfile is trying to do 
here is to extract links as if they were regular files.

@sridhar: Thanks for the detailed report. I am currently working on the problem.

--

___
Python tracker 

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



[issue8751] Threading and KeyError: 51

2010-05-18 Thread Vignesh

New submission from Vignesh :

I have a python script which runs a particular script large number of times 
(for monte carlo purpose) and the way I have scripted it is that, I queue up 
the script the desired number of times it should be run then I spawn threads 
and each thread runs the script once and again when its done.

Once the script in a particular thread is finished, the output is written to a 
file by accessing a lock (so my guess was that only one thread accesses the 
lock at a given time). Once the lock is released by one thread, the next thread 
accesses it and adds its output to the previously written file and rewrites it. 

I am not facing a problem when the number of iterations is small like 10 or 20 
but when its large like 50 or 150, python returns a KeyError: 51 telling me 
element doesn't exist and the error it points out to is within the lock which 
puzzles me since only one thread should access the lock at once and I do not 
expect an error. 

This is the class I use:

class errorclass(threading.Thread):

 def __init__(self, queue):
 self.__queue=queue
 threading.Thread.__init__(self)
 
 def run(self):
 while 1:
   item = self.__queue.get()
   if item is None: break
   result = myfunction()
   lock = threading.RLock()
   lock.acquire()
   ADD entries from current thread to entries in file and
   REWRITE FILE   
   lock.release()

--
components: IDLE
messages: 105981
nosy: Vignesh.K
priority: normal
severity: normal
status: open
title: Threading and KeyError: 51
versions: Python 2.5

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2010-05-18 Thread Tomas Hoger

Tomas Hoger  added the comment:

> My reading of PySys_SetArgv is that if argv is NULL, then 
> "char *argv0 = argv[0];" will read through NULL and thus will
> segfault on a typical platform.

Right.

> I favor Antoine's approach in
> http://bugs.python.org/file13860/setargvex.patch of adding a new API
> entry point, whilst maximizing compatibilty for all of the code our
> there using the existing entry point.

Sadly, this won't help existing applications affected by this problem, without 
all of them needing to be changed.

My change proposed in msg90336 won't help either, at least not in all cases.  
Apps that call PySys_SetArgv with 1, { "myappname", NULL } can still be tricked 
to add full CWD path at the beginning of sys.path on platforms with realpath().

--

___
Python tracker 

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



[issue8741] 2.7 regression in tarfile: IOError: link could not be created

2010-05-18 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

This is a platform specific bug. It is happening only on windows.
BTW, makelink should not have been called for this file, because it
is not a link or symlink, but a regular file.

--
nosy: +orsenthil

___
Python tracker 

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



[issue8727] test_import failure

2010-05-18 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

r81290

--
assignee: brett.cannon -> barry
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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-05-18 Thread Nir Aides

Nir Aides  added the comment:

> Nir, would you be interested in looking at this?

yes, I'll take a look, but will take me a few days.

--

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2010-05-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, I will try to write better documentation.

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



[issue8742] broken asdl link in Parser/asdl.py

2010-05-18 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Here is the proper link:
http://www.cs.princeton.edu/research/techreps/TR-554-97

Fixed those references in the code too.

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



[issue8750] Many of MutableSet's methods assume that the other parameter is not self

2010-05-18 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

For example, here is one of MutableSet's methods:

def __isub__(self, it):
for value in it:
self.discard(value)
return self

However, if I do "x -= x", then it mutates my set-like object during iteration, 
which even the built-in set does not support.  ior, iand, and ixor have the 
same problem.

I'm working on running test_set.py (with suitable modifications) on my class 
that derives from collections.MutableSet, so I'm going to be bumping into all 
kinds of fun problems like this.

I'm going to override the methods in my class, and I can contribute my new 
methods back to Python as a patch once they're working.

--
assignee: stutzbach
components: Library (Lib)
messages: 105974
nosy: stutzbach
priority: normal
severity: normal
stage: unit test needed
status: open
title: Many of MutableSet's methods assume that the other parameter is not self
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8667] Link to PEP 3147 from importlib docs

2010-05-18 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Ashley Sands wrote:
> Is this the right approach?

Follow the process mentioned here:
http://www.python.org/dev/faq/

And create a patch against Docs/library/importlib.rst with the
reference to PEP 3147 included. That is it. Look for other places
where it might need reference too.

Attach the patch to this bug report.

--
nosy: +orsenthil

___
Python tracker 

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-05-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Sorry, the calibration loop actually looks correct in case of preemption, since 
it simply divides the TSC delta by the elapsed physical time (and both continue 
increasing monotonously when another thread runs). It is still vulnerable to 
the thread migration problem, though.

--

___
Python tracker 

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-05-18 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-05-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Regarding the calibrating loop when using ASM timestamp counters, there's one 
problem if the thread gets preempted in the middle of the loop: the calibration 
will return incorrect results. Perhaps a way of avoiding this would be to call 
nanosleep(1 ns) just before the loop, which should relinquish the current 
timeslice.

Another issue can appear when threads migrate from one CPU core to another, 
according to Wikipedia: “AMD processors up to the K8 core always incremented 
the time-stamp counter every clock cycle.[5] Thus, power management features 
were able to change the number of increments per second, and the values could 
get out of sync between different cores or processors in the same system.”

Perhaps using clock_gettime(CLOCK_REALTIME or CLOCK_MONOTONIC) is better than 
using raw ASM timestamp counters, when available.

--

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-05-18 Thread Meador Inge

Meador Inge  added the comment:

Sure - http://codereview.appspot.com/1258041

--

___
Python tracker 

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



[issue8749] Cruft in object.c: PyObject_GenericGetAttr

2010-05-18 Thread Yaniv Aknin

Yaniv Aknin  added the comment:

Oops, of course I meant r59944, off by one. :)

--

___
Python tracker 

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



[issue8749] Cruft in object.c: PyObject_GenericGetAttr

2010-05-18 Thread Mark Dickinson

Mark Dickinson  added the comment:

Looks like r59944 to me.

Amaury, any objections to removing this '#if 0' code?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue8749] Cruft in object.c: PyObject_GenericGetAttr

2010-05-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue8749] Cruft in object.c: PyObject_GenericGetAttr

2010-05-18 Thread Yaniv Aknin

New submission from Yaniv Aknin :

While reading the source I saw that recent py3k has this in Objects/object.c 
(reasonably recent trunk has it as well):

#if 0 /* XXX this is not quite _PyType_Lookup anymore */
/* Inline _PyType_Lookup */
{ ... removed ...
}
#else
descr = _PyType_Lookup(tp, name);
#endif

This was commented out (on trunk, I assumed on py3k it was for the same reason) 
by amaury.forgeotdarc on revision 59943, when a patch to the real 
_PyType_Lookup was applied.

I think it can be safely removed.

--
components: Interpreter Core
messages: 105967
nosy: Yaniv.Aknin
priority: normal
severity: normal
status: open
title: Cruft in object.c: PyObject_GenericGetAttr
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue8745] zipimport is a bit slow

2010-05-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> brett.cannon
nosy: +brett.cannon
stage:  -> patch review
versions: +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



[issue2281] Enhanced cPython profiler with high-resolution timer

2010-05-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Nir, would you be interested in looking at this?

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



[issue8727] test_import failure

2010-05-18 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Thanks, Antoine filled me in on IRC just before my 'net connection went down 
for many hours.  The good news is that I have a fix for this and will commit it 
in a little while.

--

___
Python tracker 

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



[issue8748] integer-to-complex comparisons give incorrect results

2010-05-18 Thread Mark Dickinson

Mark Dickinson  added the comment:

Right thread, wrong message.  That should have been:

http://www.mail-archive.com/sage-de...@googlegroups.com/msg20839.html

--

___
Python tracker 

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



[issue8741] 2.7 regression in tarfile: IOError: link could not be created

2010-05-18 Thread Lars Gustäbel

Changes by Lars Gustäbel :


--
assignee:  -> lars.gustaebel

___
Python tracker 

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



[issue8748] integer-to-complex comparisons give incorrect results

2010-05-18 Thread Mark Dickinson

New submission from Mark Dickinson :

I've just discovered that integer-to-complex comparisons are broken, in all 
versions of Python that I've tested.  It looks as though the integer is first 
converted to a complex number, and then the two complex numbers are compared.  
That's not correct, and it's contrary to what happens for floats, where there's 
special handling in place to make sure that exact values are compared.  This 
leads to loss of transitivity of equality:

>>> n = 2**53+1
[51529 refs]
>>> float(n) == complex(n)  # expect True
True
[51531 refs]
>>> n == float(n)   # expect False
False
[51531 refs]
>>> n == complex(n) # expect False, but Python returns True
True
[51531 refs]

Apparently the SAGE folks noticed this some time ago, but AFAICT didn't report 
it as a bug. See 
http://www.mail-archive.com/sage-de...@googlegroups.com/msg20891.html

For a complex number z and an integer i, 'z == i' should be exactly equivalent 
to 'z.real == i and z.imag == 0.0'.

--
assignee: mark.dickinson
components: Interpreter Core
messages: 105963
nosy: mark.dickinson
priority: high
severity: normal
status: open
title: integer-to-complex comparisons give incorrect results
type: behavior
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



[issue8513] subprocess: support bytes program name (POSIX)

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, os.get_exec_path() has no test for the new features (support b'PATH' key 
and bytes value).

--

___
Python tracker 

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



[issue8640] subprocess: canonicalize env to bytes on Unix (Python3)

2010-05-18 Thread STINNER Victor

STINNER Victor  added the comment:

os.exeve() and os.exevpe() should also canonicalize env to bytes.

os.exeve() and os.exevpe(), but not os._exevpe() to avoid doing it twice (once 
in subprocess, once in os._exevpe). Patch os._exevpe() is not enough because 
subprocess doesn't call it on Unix if _subprocessposix module is present.

--

___
Python tracker 

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



[issue8745] zipimport is a bit slow

2010-05-18 Thread Ray.Allen

Ray.Allen  added the comment:

When I perform some test on debian-5.0, I see the timing results almost the 
same before and after apply your patch(I modified the patch to against the 
trunk). 

Could you give some test result on windows? I can't see the speedups on 
debian-5.0.

--
nosy: +ysj.ray

___
Python tracker 

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



[issue8732] Should urrllib2.urlopen send an Accept-Encoding header?

2010-05-18 Thread Dave Abrahams

Dave Abrahams  added the comment:

How many tests did you run?  My two tests were minutes apart.  I have the 
feeling that this has something to do with cacheing behavior on the server.

--

___
Python tracker 

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



[issue8747] Autoconf tests in python not portably correct

2010-05-18 Thread Garrett Cooper

New submission from Garrett Cooper :

A number of features are being blindly enabled on python that aren't correct 
from a porting standpoint; a handful in configure.in I noticed are:

# The later defininition of _XOPEN_SOURCE disables certain features
# on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])

# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
# them.
AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library 
features])

# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
# them.
AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library 
features])

# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])

# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
# them.
AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library 
features])

these are only applicable on certain platforms and thus, shouldn't be enabled 
on all platforms (the default should be off, and then the values should be 
tuned according to the platform detection performed by autoconf).

--
components: Build
messages: 105958
nosy: yaneurabeya
priority: normal
severity: normal
status: open
title: Autoconf tests in python not portably correct
type: compile error
versions: Python 2.6

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-05-18 Thread Garrett Cooper

New submission from Garrett Cooper :

os.chflags isn't `available' even though chflags support is available on the 
system:

>>> filter(lambda x: x.startswith('chflags'), dir(os))
[]
>>> platform.uname()
('FreeBSD', 'bayonetta.local', '9.0-CURRENT', 'FreeBSD 9.0-CURRENT #0 r206173M: 
Mon Apr 26 22:45:06 PDT 2010 
r...@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA.ata', 'amd64', 'amd64')
>>> filter(lambda x: x.startswith('chflags'), dir(os))
[]
>>> sys.version
'2.6.5 (r265:79063, May 16 2010, 23:37:42) \n[GCC 4.2.1 20070719  [FreeBSD]]'

I'm looking into why this is not properly detected via configure (here's the 
snippet though):

configure:17257: checking for chflags
configure:17288: cc -o conftest -O2 -pipe -fno-strict-aliasing -pipe -O2 
-march=nocona -D__wchar_t=wchar_t  -DTHREAD_STACK_SIZE=0x10  -pthread  
conftest.c  >&5
conftest.c:173: error: expected identifier or '(' before '[' token
In file included from /usr/include/sys/_types.h:33,
 from /usr/include/sys/_timespec.h:37,
 from /usr/include/sys/stat.h:42,
 from conftest.c:174:
/usr/include/machine/_types.h:75: error: expected '=', ',', ';', 'asm' or 
'__attribute__' before '__int_least8_t'
In file included from /usr/include/sys/time.h:37,
 from /usr/include/sys/stat.h:99,
 from conftest.c:174:
/usr/include/sys/types.h:64: error: expected '=', ',', ';', 'asm' or 
'__attribute__' before 'int8_t'
conftest.c:182: error: expected identifier or '(' before ']' token
configure:17291: $? = 1

Compiling the standalone test works:

$ cat ~/test_chflags.c 
#include 
#include 
int main(int argc, char*argv[])
{
  if(chflags(argv[0], 0) != 0)
return 1;
  return 0;
}
$ gcc -o ~/test_chflags ~/test_chflags.c
$ echo $?
0

Also, another sidenote: nowhere is *chflags(2) considered a POSIX feature (I 
doublechecked opengroup.org and Google). It is strictly a _Unix_ feature. I say 
this because the POSIX functionality tester explicitly looks for this `POSIX' 
compatible feature.

--
messages: 105957
nosy: yaneurabeya
priority: normal
severity: normal
status: open
title: *chflags detection broken on FreeBSD 9-CURRENT
type: compile error
versions: Python 2.6, Python 3.1

___
Python tracker 

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



[issue3051] heapq change breaking compatibility

2010-05-18 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

All six of the rich comparisons need to be implemented or the result is 
undefined.  This module never made guarantees for objects defining only one of 
the six.

We could change the pure python code to handle both __lt__ and __le__ but that 
would make it much harder to read and understand.  The C version supports and 
that is what runs by default.

--
priority: normal -> low

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-05-18 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for this.

Any chance you could upload the patch to Rietveld 
(http://codereview.appspot.com/) for ease of review?

--

___
Python tracker 

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