[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread Christian Häggström

New submission from Christian Häggström :

I hit a variant of issue #12251, namely when you redirect both stdout and 
stderr of a child process and one of them uses a low fd.
Testcase:

import subprocess, sys
subprocess.call(["ls", "asda"], stderr = sys.stdout, stdout = open("/dev/null", 
"w"))

strace output:

open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
[child process]
dup2(3, 1)   = 1  // overwrites the stdout filedescriptor..
dup2(1, 2)   = 2  // that was supposed to be duped here.
close(3)= 0   // okay

The testcase is supposed to print "ls: file not found" on stdout, but is silent.

--
components: Library (Lib)
messages: 140864
nosy: Evgeny.Tarasov, alexey-smirnov, chn, haypo, mmarkk, neologix, 
r.david.murray
priority: normal
severity: normal
status: open
title: subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

The problem is in PyLong_FromDouble(): if (Py_IS_INFINITY(dval)) is evaluated 
as false, whereas dval *is* infinity. Possible causes:

 - Py_IS_INFINITY is not defined as "# define Py_IS_INFINITY(X) isinf(X)" 
(issue with the pyconfig.h file?)
 - the compiler replaces isinf(X) by something else (!?)
 - isinf() is not called with the right argument (conversion between 32, 64 
and/or 80 floats?)
 - issue with the FPU mode (unlikely because in your ctypes test, 
isinf(float("inf")) returns 1, and this test runs in the Python process)

Try to run python in gdb. Set a breakpoint on isinf() (or on 
PyLong_FromDouble() and use step by step) to check that the function is really 
called, and called with the "right" argument.

You may also try to replace Py_IS_INFINITY(dval) directly by isinf(dval) (or 
simply if(1) :-)) in PyLong_FromDouble().

--

___
Python tracker 

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



[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

> stdout = open("/dev/null", "w"), stderr = sys.stdout

You ask to write all outputs to /dev/null. Why do you expect anything on stdout?

--

___
Python tracker 

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



[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread Christian Häggström

Christian Häggström  added the comment:

I expect that 'ls' print the error message on its stderr, which would be 
redirected to stdout of the test Python program.

If I had been using stderr = subprocess.STDOUT, I can agree with you that both 
output streams would go to /dev/null.

--

___
Python tracker 

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



[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

> stdout = open("/dev/null", "w"), stderr = sys.stdout

Oh, I read subprocess.STDOUT instead of sys.stdout.

--

___
Python tracker 

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



[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

It is indeed a problem.

It seems like the problem comes about due to the "swapping" of fds.
i.e. using stdout as stderr. The reverse appears to work due to the order in 
which the dup() calls are performed.

Attached is a patch which fixes the issue.

--
keywords: +patch
nosy: +rosslagerwall
Added file: http://bugs.python.org/file22716/i12607.patch

___
Python tracker 

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



[issue10026] xml.dom.pulldom strange behavior

2011-07-22 Thread Myrosia Dzikovska

Myrosia Dzikovska  added the comment:

I have the same problem, and I tried the solution suggested in here, namely 
expanding the node at END_ELEMENT. It does not work, raising the following 
exception:

Traceback (most recent call last):
  File 
"/group/project/onrbee/data/beetle2-eval-09/annotation_tools/logTools/add_start_times.py",
 line 163, in 
main(sys.argv[1:])
  File 
"/group/project/onrbee/data/beetle2-eval-09/annotation_tools/logTools/add_start_times.py",
 line 130, in main
events.expandNode(node)
  File "/usr/lib/python2.6/site-packages/_xmlplus/dom/pulldom.py", line 248, in 
expandNode
parents[-1].appendChild(cur_node)
IndexError: list index out of range


The code fragment was:

  events = xml.dom.pulldom.parse( outName )
for (event,node) in events:
if (event == xml.dom.pulldom.END_ELEMENT) and (node.tagName == 
"message"):
 events.expandNode(node)

--
nosy: +Myrosia.Dzikovska

___
Python tracker 

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



[issue12434] Strengthen 2.7 io types warning

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0752215f9f91 by Eli Bendersky in branch '2.7':
Issue #12434: make StringIO.write error message consistent with Python 2.7 
nomenclature
http://hg.python.org/cpython/rev/0752215f9f91

--
nosy: +python-dev

___
Python tracker 

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



[issue12434] Strengthen 2.7 io types warning

2011-07-22 Thread Eli Bendersky

Changes by Eli Bendersky :


--
resolution:  -> fixed
status: open -> closed
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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-22 Thread Eli Bendersky

Eli Bendersky  added the comment:

Is the problem happening only on 64-bit Windows, or 32-bit as well?

--

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 Thread Albert Zeyer

New submission from Albert Zeyer :

Code:

```
import ast

globalsDict = {}

fAst = ast.FunctionDef(
name="foo",
args=ast.arguments(
args=[], vararg=None, kwarg=None, defaults=[],
kwonlyargs=[], kw_defaults=[]),
body=[], decorator_list=[])

exprAst = ast.Interactive(body=[fAst])
ast.fix_missing_locations(exprAst)
compiled = compile(exprAst, "", "single")
eval(compiled, globalsDict, globalsDict)

print(globalsDict["foo"])
```

Also CPython 2.6, 2.7, 3.0 and PyPy 1.5 crashes on this.

--
components: Interpreter Core
messages: 140873
nosy: Albert.Zeyer
priority: normal
severity: normal
status: open
title: crash in PyAST_Compile when running Python code
versions: Python 3.2

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 Thread Albert Zeyer

Albert Zeyer  added the comment:

PyPy bug report: https://bugs.pypy.org/issue806

--

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 Thread R. David Murray

R. David Murray  added the comment:

So does default.

--
nosy: +benjamin.peterson, r.david.murray
type:  -> crash
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



[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

2011-07-22 Thread Albert Zeyer

New submission from Albert Zeyer :

Code:

```
from ast import *

globalsDict = {}

exprAst = Interactive(body=[FunctionDef(name=u'Py_Main', 
args=arguments(args=[Name(id=u'argc', ctx=Param()), Name(id=u'argv', 
ctx=Param())], vararg=None, kwarg=None, defaults=[]), 
body=[Assign(targets=[Name(id=u'argc', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='c_int', 
ctx=Load()), args=[Attribute(value=Name(id=u'argc', ctx=Load()), attr='value', 
ctx=Load())], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'argv', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='cast', 
ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_void_p', ctx=Load()), 
args=[Attribute(value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='cast', ctx=Load()), args=[Name(id=u'argv', ctx=Load()), 
Attribute(value=Name(id='ctypes', ctx=Load()), attr='c_void_p', ctx=Load())], 
keywords=[], starargs=None, kwargs=None), attr='value', ctx=Load())], 
keywords=[], starargs=No
 ne, kwargs=None), Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='POINTER', ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='POINTER', ctx=Load()), 
args=[Attribute(value=Name(id='ctypes', ctx=Load()), attr='c_char', 
ctx=Load())], keywords=[], starargs=None, kwargs=None)], keywords=[], 
starargs=None, kwargs=None)], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'c', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='c_int', 
ctx=Load()), args=[], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'sts', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='c_int', 
ctx=Load()), args=[], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'command', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='cast', 
ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), att
 r='c_void_p', ctx=Load()), 
args=[Attribute(value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_uint', ctx=Load()), args=[Num(n=0L)], keywords=[], starargs=None, 
kwargs=None), attr='value', ctx=Load())], keywords=[], starargs=None, 
kwargs=None), Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='POINTER', ctx=Load()), args=[Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='c_char', ctx=Load())], keywords=[], starargs=None, 
kwargs=None)], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'filename', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='cast', 
ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_void_p', ctx=Load()), 
args=[Attribute(value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_uint', ctx=Load()), args=[Num(n=0L)], keywords=[], starargs=None, 
kwargs=None), attr='value', ctx=Load())], keywords=[], starargs=None, 
kwargs=None), 
 Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='POINTER', 
ctx=Load()), args=[Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_char', ctx=Load())], keywords=[], starargs=None, kwargs=None)], 
keywords=[], starargs=None, kwargs=None)), Assign(targets=[Name(id=u'module', 
ctx=Store())], value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='cast', ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='c_void_p', ctx=Load()), 
args=[Attribute(value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_uint', ctx=Load()), args=[Num(n=0L)], keywords=[], starargs=None, 
kwargs=None), attr='value', ctx=Load())], keywords=[], starargs=None, 
kwargs=None), Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='POINTER', ctx=Load()), args=[Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='c_char', ctx=Load())], keywords=[], starargs=None, 
kwargs=None)], keywords=[], starargs=None, kwargs=None)), Assign(targe
 ts=[Name(id=u'fp', ctx=Store())], 
value=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), attr='cast', 
ctx=Load()), args=[Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='c_void_p', ctx=Load()), args=[Num(n=0)], keywords=[], starargs=None, 
kwargs=None), Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='POINTER', ctx=Load()), args=[Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='c_int', ctx=Load())], keywords=[], starargs=None, 
kwargs=None)], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'p', ctx=Store())], 
value=Call(func=Call(func=Attribute(value=Name(id='ctypes', ctx=Load()), 
attr='POINTER', ctx=Load()), args=[Attribute(value=Name(id='ctypes', 
ctx=Load()), attr='c_char', ctx=Load())], keywords=[], starargs=None, 
kwargs=None), args=[], keywords=[], starargs=None, kwargs=None)), 
Assign(targets=[Name(id=u'un

[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

2011-07-22 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



[issue12610] Fatal Python error: non-string found in code slot

2011-07-22 Thread Albert Zeyer

New submission from Albert Zeyer :

Code:

```
from ast import *

globalsDict = {}

body = [
Assign(targets=[Name(id=u'argc', ctx=Store())],
   value=Name(id=u'None', ctx=Load())),
]

exprAst = Interactive(body=[
FunctionDef(
name='foo',
args=arguments(args=[Name(id=u'argc', ctx=Param()), 
Name(id=u'argv', ctx=Param())],
   vararg=None, kwarg=None, 
defaults=[]),
body=body,
decorator_list=[])])

fix_missing_locations(exprAst)
compiled = compile(exprAst, "", "single")
eval(compiled, {}, globalsDict)

f = globalsDict["foo"]
print(f)
```

CPython 2.7.1: Fatal Python error: non-string found in code slot
PyPy 1.5: 

--
messages: 140877
nosy: Albert.Zeyer
priority: normal
severity: normal
status: open
title: Fatal Python error: non-string found in code slot
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



[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

2011-07-22 Thread Albert Zeyer

Albert Zeyer  added the comment:

Simplified code:

```
from ast import *

globalsDict = {}

exprAst = Interactive(body=[
FunctionDef(
name=u'foo',
args=arguments(args=[], vararg=None, kwarg=None, defaults=[]),
body=[Pass()],
decorator_list=[])])

fix_missing_locations(exprAst)
compiled = compile(exprAst, "", "single")
eval(compiled, {}, globalsDict)

f = globalsDict["foo"]
print(f)
```

If I change `name=u'foo'` to `name='foo'`, it works.

--

___
Python tracker 

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



[issue12607] subprocess(stdout=..., stderr=sys.stdout) breaks stderr for child

2011-07-22 Thread Christian Häggström

Christian Häggström  added the comment:

Thanks for the patch, I haven't tried it (I'm still on Python 2.7) but it looks 
very special-cased to my case. I can think about exotic cases like

stdin = sys.stderr, stdout = sys.stdin, stderr = sys.stdout

It can happen in reality if a daemon have closed stdio (see bug 10806) and 
reusing fd's 0,1,2 for other purposes.

--

___
Python tracker 

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



[issue11610] Improved support for abstract base classes with descriptors

2011-07-22 Thread Darren Dale

Darren Dale  added the comment:

I've requested additional feedback based on comments at Rietveld.

--

___
Python tracker 

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



[issue12436] Provide reference to detailed installation instructions

2011-07-22 Thread Adam Woodbeck

Adam Woodbeck  added the comment:

So what we're looking for is comprehensive HOWTOs for installing and running 
Python on Windows, OSX and Linux to be added to 
http://docs.python.org/howto/index.html?

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-22 Thread higery

higery  added the comment:

>>packaging.errors.PackagingOptionError: your specific entry 
>>'script1=foo.bar.main1.main' does not exist!

I think you did not get the latest version of my code.

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-22 Thread higery

higery  added the comment:

>>In your Mercurial configuration file, you should set the git option so that 
>>diffs can display editions to binary files.  See 
>>http://hgtip.com/tips/beginner/2009-10-22-always-use-git-diffs/

Thanks.

>>The new scripts feature should reuse the already existing scripts field, in 
>>the files section.

But they have different string syntax, old scripts field just uses a
path string as a valid value, eg. 'demo/script.py', while our
wrapper-scripts field uses a kind of '=' separated value, eg.
'hello=demo.script.main'.

>>Looks like a great start!  As I said in private email, have a look at the 
>>distribute fork of setuptools to see if they have tests for these features.

OK.

2011/7/22, higery :
>>>packaging.errors.PackagingOptionError: your specific entry
>>> 'script1=foo.bar.main1.main' does not exist!
>
>
> I think you did not get the latest version of my code.
>

--

___
Python tracker 

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



[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

2011-07-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread Landry Breuil

Landry Breuil  added the comment:

$grep -r '#define Py_IS_INF' .
PC/pyconfig.h:#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))


>>> isinf(float('inf'))

Breakpoint 2, __isinf (d=1.0604798301039825e-314) at 
/usr/src/lib/libc/gen/isinf.c:30
30  in /usr/src/lib/libc/gen/isinf.c
(gdb) bt
#0  __isinf (d=1.0604798301039825e-314) at /usr/src/lib/libc/gen/isinf.c:30
#1  0x8fe528d8 in ffi_call_SYSV () from /usr/local/lib/libffi.so.0.0

--

___
Python tracker 

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



[issue12610] Fatal Python error: non-string found in code slot

2011-07-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12436] Provide reference to detailed installation instructions

2011-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

IMO we don’t need HOWTOs that duplicate existing docs, but we may need 
additions to the existing tutorial and “using” docs.  See 
http://bugs.python.org/issue12436#msg140141

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

The '1.06...e-314' number in the gdb output is interesting:  it indicates a 
byte-ordering issue, though maybe that issue is only pertinent to gdb itself.

On a little-endian machine:

>>> struct.pack('>> struct.pack('

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

Question: does this test also fail after configuring with the --with-pydebug 
flag?  (Which I *think* should turn compiler optimizations off, amongst other 
things.)

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

> $grep -r '#define Py_IS_INF' .
> PC/pyconfig.h:#define Py_IS_INFINITY(X) (!_finite(X) && !_isnan(X))

The PC/ directory is specific to Windows. Py_IS_INFINITY should be defined in 
Include/pymath.h (at least, in the 3.2 branch)

> Breakpoint 2, __isinf (d=1.0604798301039825e-314)
> ...
> #1  0x8fe528d8 in ffi_call_SYSV () from /usr/local/lib/libffi.so.0.0

Ah, you ran gdb on ctypes. I forgot to specify that you should run gdb on 
"int(float('inf'))" instruction in Python, sorry. I would like to check 
int(float), not ctypes ;-)

If gdb has an endian issue, you may also try "print /x d" in the gdb shell.

Example on x86_64:
-
$ gdb ./python 
GNU gdb (GDB) 7.1-ubuntu
...
(gdb) run

(gdb) b isinf
Breakpoint 1 at 0xb7f94f16: file ../sysdeps/ieee754/dbl-64/s_isinf.c, line 23. 
(2 locations)
(gdb) cont
>>> int(float('inf'))

Breakpoint 1, *__GI___isinf (x=inf) at ../sysdeps/ieee754/dbl-64/s_isinf.c:23
23  ../sysdeps/ieee754/dbl-64/s_isinf.c: Aucun fichier ou dossier de ce 
type.
in ../sysdeps/ieee754/dbl-64/s_isinf.c
(gdb) print /x x
$1 = 0x8000

(gdb) where
#0  *__GI___isinf (x=inf) at ../sysdeps/ieee754/dbl-64/s_isinf.c:23
#1  0x0819b03e in PyLong_FromDouble (dval=inf) at Objects/longobject.c:280
#2  0x0818d660 in float_trunc (v=) at 
Objects/floatobject.c:896
#3  0x081619c6 in PyNumber_Long (o=) at 
Objects/abstract.c:1348
#4  0x081a4823 in long_new (type=0x824b420, args=(,), kwds=0x0) at Objects/longobject.c:4130
...
(gdb) frame 1
#1  0x0819b03e in PyLong_FromDouble (dval=inf) at Objects/longobject.c:280
280 if (Py_IS_INFINITY(dval)) {
(gdb) print /x dval
$2 = 0x8000
-

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

> If gdb has an endian issue,
> you may also try "print /x d" in the gdb shell.

Oh, forget me: /x converts the argument to an integer...

--

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

> I think you did not get the latest version of my code.
I pulled and updated again and got a different error :)

ERROR: test_install_wrapper_scripts 
(packaging.tests.test_command_build_scripts.BuildScriptsTestCase)
--
Traceback (most recent call last):
  File "Lib/packaging/tests/test_command_build_scripts.py", line 79, in 
test_install_wrapper_scripts
with open(script, "rb") as f:
IOError: [Errno 13] Permission denied: 
'/tmp/user/1013/tmp2xp9qc/tmpwhzzmg/script1'

(/tmp/user/1013 is my $TMP directory)

>> The new scripts feature should reuse the already existing scripts
>> field, in the files section.
> But they have different string syntax

Yes, you will have to update the config file parsing code in config, code that 
uses dist.scripts, etc.

--

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread Landry Breuil

Landry Breuil  added the comment:

Py_IS_INFINITY is defined as

#ifndef Py_IS_INFINITY
#  if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
#define Py_IS_INFINITY(X) isinf(X)
#  else
#define Py_IS_INFINITY(X) ((X) &&   \
   (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
#  endif
#endif


The test still fails when built --with-pydebug.

(gdb)  b isinf 
Function "isinf" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (isinf) pending.
(gdb) r
Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/python 
Breakpoint 2 at 0x852786d4: file /usr/src/lib/libc/gen/isinf.c, line 27.
Pending breakpoint "isinf" resolved
Python 3.2.1 (default, Jul 22 2011, 17:34:54) 
[GCC 4.2.1 20070719 ] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> int(float('inf'))
0
[56408 refs]

isinf is #defined in math.h to

#define isinf(x) \
((sizeof (x) == sizeof (float)) ? \
__isinff(x) \
: (sizeof (x) == sizeof (double)) ? \
__isinf(x) \
:   __isinfl(x))

but setting a bkp on it changes nothing.

Starting program: /usr/obj/ports/Python-3.2.1/Python-3.2.1/python 
Breakpoint 2 at 0x89b4f708: file /usr/src/lib/libc/gen/isinf.c, line 36.
Pending breakpoint "__isinff" resolved
Python 3.2.1 (default, Jul 22 2011, 17:34:54) 
[GCC 4.2.1 20070719 ] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> int(float('inf'))
0

Setting a bkp on PyLong_FromDouble() shows that it's not called.

Sorry, this doesnt make sense to me...

--

___
Python tracker 

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



[issue12611] 2to3 crashes when converting doctest using reduce()

2011-07-22 Thread Vlada Peric

New submission from Vlada Peric :

2to3 crashes when run on a doctest which uses reduce(). This happens with both 
2.7 and 3.2's 2to3. I have the following code in a compatibility file, but even 
using that it fails with the same error: 

try:
from functools import reduce
except ImportError:
reduce = reduce

This is the traceback produced:

Traceback (most recent call last):
  File "/usr/local/bin/2to3", line 6, in 
sys.exit(main("lib2to3.fixes"))
  File "/usr/local/lib/python2.6/lib2to3/main.py", line 173, in main
options.processes)
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 620, in refactor
items, write, doctests_only)
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 275, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 661, in 
refactor_file
*args, **kwargs)
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 321, in 
refactor_file
output = self.refactor_docstring(input, filename)
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 500, in 
refactor_docstring
indent, filename))
  File "/usr/local/lib/python2.6/lib2to3/refactor.py", line 530, in 
refactor_doctest
assert clipped == [u"\n"] * (lineno-1), clipped
AssertionError: [u'from functools import reduce\n', u'\n', u'\n', u'\n', u'\n', 
u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', 
u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', u'\n', 
u'\n', u'\n', u'\n', u'\n', u'\n']

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 140892
nosy: VPeric
priority: normal
severity: normal
status: open
title: 2to3 crashes when converting doctest using reduce()
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



[issue12609] SystemError: Objects/codeobject.c:64: bad argument to internal function

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a21829180423 by Benjamin Peterson in branch '2.7':
verify the types of AST strings and identifiers (closes #12609 and #12610)
http://hg.python.org/cpython/rev/a21829180423

New changeset 3301689bd78d by Benjamin Peterson in branch '3.2':
type check AST strings and identifiers
http://hg.python.org/cpython/rev/3301689bd78d

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12589] test_long.test_nan_inf() failed on OpenBSD (powerpc)

2011-07-22 Thread STINNER Victor

STINNER Victor  added the comment:

I'm not sure that your version of gdb understands macros. You may have to set a 
breakpoint on __isinf. Compile Python with "-g -ggdb" helps gdb.

Py_IS_INFINITY is may not defined as "# define Py_IS_INFINITY(X) isinf(X)". To 
check that, add #error macro in pymath.h for all cases around #ifndef 
Py_IS_INFINITY. For example:

#ifndef Py_IS_INFINITY
#  if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
#error "Py_IS_INFINITY is implemented using isinf()"
#define Py_IS_INFINITY(X) isinf(X)
#  else
#error "Py_IS_INFINITY is implemented using *0.5"
#define Py_IS_INFINITY(X) ((X) &&   \
   (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
#  endif
#else
#  error "Py_IS_INFINITY already set!?"
#endif

And recompile Python. It may be a typo in pyconfig.h (generated by configure) 
or an issue with the inclusion paths of gcc (-I options).

Can you please attach your pyconfig.h and /usr/include/math.h files?

Can you also copy-paste the line used to compile Object/floatobject.c (to check 
the compiler options)? Use touch Object/floatobject.c && make to recompile this 
file.

FYI, isinf() is also a macro on Linux:

# ifdef __NO_LONG_DOUBLE_MATH
#  define isinf(x) \
 (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
# else
#  define isinf(x) \
 (sizeof (x) == sizeof (float)\
  ? __isinff (x)  \
  : sizeof (x) == sizeof (double) \
  ? __isinf (x) : __isinfl (x))
# endif

--

___
Python tracker 

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



[issue12610] Fatal Python error: non-string found in code slot

2011-07-22 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> SystemError: Objects/codeobject.c:64: bad argument to internal 
function

___
Python tracker 

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



[issue12612] Valgrind suppressions

2011-07-22 Thread Paul Price

New submission from Paul Price :

I am running Python 2.7.1 under Valgrind 3.6.1 on a x86_64 GNU/Linux box.  
Valgrind is flagging errors that are not covered by the standard suppressions 
file (Misc/valgrind-python.supp; after uncommenting the part I'm supposed to), 
e.g.:

==5804== Use of uninitialised value of size 8
==5804==at 0x4EBA956: PyObject_Free (obmalloc.c:958)
==5804==by 0x4E85D65: code_dealloc (codeobject.c:317)
==5804==by 0x4ECE23C: tupledealloc (tupleobject.c:220)
==5804==by 0x4E85E42: code_dealloc (codeobject.c:308)
==5804==by 0x4F3315D: load_source_module (import.c:1022)
==5804==by 0x4F33F7E: import_submodule (import.c:2596)
==5804==by 0x4F3420E: load_next (import.c:2416)
==5804==by 0x4F3484F: import_module_level (import.c:2137)
==5804==by 0x4F34DA3: PyImport_ImportModuleLevel (import.c:2189)
==5804==by 0x4F16ABE: builtin___import__ (bltinmodule.c:49)
==5804==by 0x4E6DA42: PyObject_Call (abstract.c:2529)
==5804==by 0x4F16F82: PyEval_CallObjectWithKeywords (ceval.c:3881)

==5804== Use of uninitialised value of size 8
==5804==at 0x4EBA956: PyObject_Free (obmalloc.c:958)
==5804==by 0x4E85D65: code_dealloc (codeobject.c:317)
==5804==by 0x4F3315D: load_source_module (import.c:1022)
==5804==by 0x4F33F7E: import_submodule (import.c:2596)
==5804==by 0x4F3420E: load_next (import.c:2416)
==5804==by 0x4F3484F: import_module_level (import.c:2137)
==5804==by 0x4F34DA3: PyImport_ImportModuleLevel (import.c:2189)
==5804==by 0x4F16ABE: builtin___import__ (bltinmodule.c:49)
==5804==by 0x4E6DA42: PyObject_Call (abstract.c:2529)
==5804==by 0x4F16F82: PyEval_CallObjectWithKeywords (ceval.c:3881)
==5804==by 0x4F1ACD3: PyEval_EvalFrameEx (ceval.c:2332)
==5804==by 0x4F1F347: PyEval_EvalCodeEx (ceval.c:3252)

etc.

Perhaps the suppressions file covers only 32-bit machines, because if I add:

{
   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
   Memcheck:Addr8
   fun:PyObject_Free
}

{
   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
   Memcheck:Value8
   fun:PyObject_Free
}

{
   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
   Memcheck:Addr8
   fun:PyObject_Realloc
}

{
   ADDRESS_IN_RANGE/Use of uninitialised value of size 8
   Memcheck:Value8
   fun:PyObject_Realloc
}

(i.e., "Value8" instead of "Value4") then all is clear.

--
components: None
messages: 140895
nosy: Paul.Price
priority: normal
severity: normal
status: open
title: Valgrind suppressions
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



[issue12612] Valgrind suppressions

2011-07-22 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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-22 Thread Qiang Sun

Qiang Sun  added the comment:

I can reproduce this in 32-bit Windows XP Pro. SP3

--
nosy: +sunqiang

___
Python tracker 

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



[issue12613] itertools fixer fails

2011-07-22 Thread Vlada Peric

New submission from Vlada Peric :

The itertools fixer (izip -> zip, among others), fails for the following code:

from itertools import izip
print msg % str(bool(symbol_swapped) and list(izip(*swap_dict).next()) or 
symbols)

It gets converted to:

print(msg % str(bool(symbol_swapped) and list(next(izip(*swap_dict))) or 
symbols))

(note how izip is still there)

I've worked aroudn this by introducing tmp = izip(...) and using that, but it'd 
be nice if 2to3 caught it by default.

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 140897
nosy: VPeric
priority: normal
severity: normal
status: open
title: itertools fixer fails
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



[issue12613] itertools fixer fails

2011-07-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 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



[issue12599] Use 'is not None' where appropriate in importlib

2011-07-22 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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Miki Tebeka

New submission from Miki Tebeka :

Currently urllib.request.Request decides if it's a "GET" or "POST" by the 
presence of data. However sometimes you want to do an "POST" request without 
data (in my case, it Crucible REST API). Or provide another method. The 
attached patched added a `method` argument to Request __init__.

--
files: request-method.diff
keywords: patch
messages: 140898
nosy: tebeka
priority: normal
severity: normal
status: open
title: Allow to explicitly set the method of urllib.request.Request
versions: Python 3.2
Added file: http://bugs.python.org/file22717/request-method.diff

___
Python tracker 

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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Miki Tebeka

Changes by Miki Tebeka :


--
type:  -> feature request

___
Python tracker 

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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Miki Tebeka

Changes by Miki Tebeka :


--
components: +Library (Lib)

___
Python tracker 

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



[issue12599] Use 'is not None' where appropriate in importlib

2011-07-22 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue12604] VTRACE macro in _sre.c should use do {} while (0)

2011-07-22 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Attached a patch against 2.7 that adds the suggested fix.

--
keywords: +patch
nosy: +petri.lehtinen
Added file: http://bugs.python.org/file22718/fix_empty_macro.patch

___
Python tracker 

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



[issue12604] VTRACE macro in _sre.c should use do {} while (0)

2011-07-22 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
components: +Build, Library (Lib)
keywords: +needs review
stage:  -> patch review

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Good question.
Peter, you said Vista x64. Are you running 32 or 64 bit Python?

My system with the apparently irreversible problem is 32 bit xp home.
I am reluctant to test on my daughter's 64 bit laptop as I do not know that I 
would be able to revert successfully and I want her to be able to write small 
programs for schoolwork without extra hassle.

--

___
Python tracker 

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



[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2011-07-22 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue12615] add array.zeroes

2011-07-22 Thread Alex Gaynor

New submission from Alex Gaynor :

>From python-ideas:

introduce array.zeroes, a new classmethod that provides an alternative 
constructor, its signature is zeroes(typecode, length), which allows for 
preallocating an array, with a lower overhead than methods such as 
array(typecode, [0]) * length, and is more readable (plus consistant with the 
numpy method of the same name).

--
assignee: alex
components: Library (Lib)
messages: 140901
nosy: alex
priority: normal
severity: normal
status: open
title: add array.zeroes
type: feature request
versions: Python 3.4

___
Python tracker 

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



[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2011-07-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.3 -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



[issue4506] 3.0 make test failures on Solaris 10

2011-07-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This appears to be fixed.

Skip: keywords now has a '-no selection-' option to get rid of keywords

--
keywords:  -64bit
nosy: +terry.reedy
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



[issue10760] tarfile doesn't handle sysfs well

2011-07-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> test needed
versions: +Python 2.7 -Python 2.6

___
Python tracker 

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



[issue10436] tarfile.extractfile in "r|" stream mode fails with filenames or members from getmembers()

2011-07-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
keywords: +needs review
stage:  -> patch review

___
Python tracker 

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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-07-22 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This affects bytearray as well as bytes.

What comes to supporting integer argument to str methods, I'm -1 on that. str's 
"contained items" are strings of length 1.

--
title: Bytes.index() and bytes.count() should accept byte ints -> index() and 
count() methods of bytes and bytearray should accept byte ints
versions:  -Python 3.2

___
Python tracker 

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



[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

Patch attached.

> For lseek, we can rely on errno. Try something like that:
>
> errno = 0;
> offset = lseek(...);
> if (offset == (off_t)-1 && errno) /* error */
>

It's a little bit overkill :-) (for mktime, time_t can overflow easily
on 32-bit).

> We can write a test using a sparse file... Or maybe a mmap object?
>

I'm not sure it's easily testable, because it's really a corner case
not addressed by POSIX. On my Linux box, I can't get lseek to return a
negative value, I get EINVAL - which does make sense (the Linux kernel
doesn't accept or return negative file offsets, see
http://lwn.net/Articles/138063/).

Kuberan, on what operating system did you notice this problem? Solaris?

--
keywords: +patch
Added file: http://bugs.python.org/file22719/lseek_negative.diff

___
Python tracker 

___diff -r d3f0f72c31f8 Modules/_io/fileio.c
--- a/Modules/_io/fileio.c  Fri Jul 22 11:10:43 2011 -0500
+++ b/Modules/_io/fileio.c  Fri Jul 22 22:33:54 2011 +0200
@@ -823,7 +823,7 @@
 Py_END_ALLOW_THREADS
 } else
 res = -1;
-if (res < 0)
+if (res == -1)
 return PyErr_SetFromErrno(PyExc_IOError);
 
 #if defined(HAVE_LARGEFILE_SUPPORT)
diff -r d3f0f72c31f8 Modules/posixmodule.c
--- a/Modules/posixmodule.c Fri Jul 22 11:10:43 2011 -0500
+++ b/Modules/posixmodule.c Fri Jul 22 22:33:54 2011 +0200
@@ -6257,7 +6257,7 @@
 res = lseek(fd, pos, how);
 #endif
 Py_END_ALLOW_THREADS
-if (res < 0)
+if (res == -1)
 return posix_error();
 
 #if !defined(HAVE_LARGEFILE_SUPPORT)
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12615] add array.zeroes

2011-07-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

-1

Array's API much more closely matches that of list than it does numpy's arrays 
which are profoundly different.  So we should stick the one-way-to-do-it idiom: 
 array.array('c', '\0') * 100 or array.array('d', [0.0]) * 100.

Also, the current idiom is much more flexible in that it works with any 
initializer, not just a zero (compare with numpy's ones() constructor for 
example).

--
assignee: alex -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

Patch attached (this one should also work with future major releases).

--
keywords: +needs review, patch
nosy: +neologix, pitrou
stage:  -> patch review
Added file: http://bugs.python.org/file22720/configure_openbsd.diff

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Looks fine to me.

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



[issue12614] Allow to explicitly set the method of urllib.request.Request

2011-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

Looks good.  I have made one comment on Rietveld.

--
assignee:  -> orsenthil
nosy: +eric.araujo, orsenthil

___
Python tracker 

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



[issue12599] Use 'is not None' where appropriate in importlib

2011-07-22 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



[issue12613] itertools fixer fails

2011-07-22 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
stage:  -> needs patch
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



[issue12611] 2to3 crashes when converting doctest using reduce()

2011-07-22 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +benjamin.peterson, eric.araujo
stage:  -> needs patch
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



[issue12602] Missing using docs cross-references

2011-07-22 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee: docs@python -> 
keywords: +easy
nosy: +eric.araujo
stage:  -> needs patch

___
Python tracker 

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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Previous frame inner to this frame (corrupt stack?)

Interesting.

Could you post the result of:

$ valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp 
Modules/_testembed

after having un-commented the ADDRESS_IN_RANGE suppressions from 
Misc/valgrind-python.supp?

What compiler version are you using?
Could you try compiling with -O0, then with -fstack-protector-all?

--
nosy: +neologix

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-22 Thread Éric Araujo

Éric Araujo  added the comment:

Hi!  Thanks for the report and patch ideas.  Would both of your fix ideas 
preserve backward compatibility?  If yes, we should take the one that makes the 
code easier to read; if no, we should take the most compatible.  Would you be 
interested in making a patch?  If so, helpful guidelines are available under 
http://docs.python.org/devguide; if not, someone else will do it.

--
nosy: +eric.araujo, haypo, ncoghlan, ron_adam
stage:  -> needs patch
title: pydoc.synopsis breaks if filesystem returns mtime of 0 (common for 
filesystems without mtime) -> pydoc.synopsis breaks if filesystem returns mtime 
of 0
versions: +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



[issue12575] add a AST validator

2011-07-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

>From a top level view, the patch adds PyAST_Validate (with helpers) to ast.c 
>and one call to PyAST_Validate in bltinmodule.c in builtin_compile(). The 
>added tests do every silly thing you can think of.

Does PyAST_Validate get invoked for all calls to compile() or just those with 
an ast as input. To put it another way, does it validate *all* asts, including 
those generated by the code parser, or just user-constructed asts. If just the 
latter now, it seems that turning it on for parser asts at least temporarily 
could test that it does not invalidate valid code and could be used to test an 
ast-level optimizer.

Two obvious questions: 1) does this address a real problem that has happened in 
the field or something that just *might* happen; 2) what is the time penalty 
(compared to the time of compilation). I guess these amount to "Is the 
maintenance burden on developers and speed burden on users worth the benefit?". 
In theory, I am in favor of anything that prevents segfaults. Would that ctypes 
use could be similarly validated (yes, this is a joke;-).

A last question, whose answer might depend on those above: given that the new 
function is not exposed to users, why not validate as part of compilation, to 
avoid walking the tree twice?

--
nosy: +terry.reedy
stage:  -> patch review
type:  -> feature request

___
Python tracker 

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



[issue12575] add a AST validator

2011-07-22 Thread Alex Gaynor

Alex Gaynor  added the comment:

1) Yes, it address a real concern that arose during Armin's GSOC project which 
has been developing a unified template compilation architecture (via the AST 
module) for Django and Jinja2.
2) Asking speed questions about this is silly IMO, if compiling functions is 
your bottleneck, your application design is very very broken.

--

___
Python tracker 

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



[issue12604] VTRACE macro in _sre.c should use do {} while (0)

2011-07-22 Thread Éric Araujo

Changes by Éric Araujo :


--
components: +Extension Modules -Library (Lib)
versions: +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



[issue10881] test_site and macframework builds fails

2011-07-22 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +needs review, patch
stage: needs patch -> patch review

___
Python tracker 

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



[issue12576] urlib.request fails to open some sites

2011-07-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Could we look for 'tion: Closed' instead of "Connection: Closed", to accomodate 
servers that garble the response, even if it is a hack?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b24a2ccae56a by Charles-François Natali in branch '2.7':
Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
http://hg.python.org/cpython/rev/b24a2ccae56a

--
nosy: +python-dev

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9c7f9d5841ff by Charles-François Natali in branch '3.2':
Issue #12592: Make Python build on OpenBSD 5 (and future major releases).
http://hg.python.org/cpython/rev/9c7f9d5841ff

--

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 63de97ae832e by Charles-François Natali in branch 'default':
Merge - Issue #12592: Make Python build on OpenBSD 5 (and future major
http://hg.python.org/cpython/rev/63de97ae832e

--

___
Python tracker 

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



[issue12592] modify configure.in to detect OpenBSD 5.x

2011-07-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

Patch committed.
Rémi, thanks for reporting this (and other OpenBSD-specific bugs :-).

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



[issue12600] Support parameterized TestCases in unittest

2011-07-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

David, is this the sort of thing you mean?

@skip # so do not run without backend
class AbstractDB2Testcase:
  backend = None
  

class PostgressDB2Testcase(AbstractDB2Testcase):
  backend = postgress # well, enough info to fine it

...

If so, I think we should close this.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue12616] zip fixer fails on zip()[:-1]

2011-07-22 Thread Vlada Peric

New submission from Vlada Peric :

The zip fixer fails on this code:

zip(B, D)[:-1]

I fixed this by wrapping explicitly with list(), but that creates a duplicate 
list on Python 2. 

(Like the other fixes I reported, I assume this also applies to 3.3, but I 
didn't test it so I don't know; adding Eric and Benjamin to nosy, though)

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 140919
nosy: VPeric, benjamin.peterson, eric.araujo
priority: normal
severity: normal
status: open
title: zip fixer fails on zip()[:-1]
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



[issue12608] crash in PyAST_Compile when running Python code

2011-07-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12575] add a AST validator

2011-07-22 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy:  -terry.reedy

___
Python tracker 

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



[issue11877] Change os.fsync() to support physical backing store syncs

2011-07-22 Thread Charles-François Natali

Charles-François Natali  added the comment:

>   One could argue that something had happened before the fsync(2),
>   so that code which blindly did so is too dumb to do any right
>   decision anyway.  Even PEP 3151 won't help.

I don't understand. If the syscall supposed to flush the disk's buffer
cache fails - be it fcntl() or sync_file_range() - I think the error
should be propagated, not silently ignored and replaced with another
syscall which doesn't have the same semantic. That's all.

> - I favour haypos fullsync() approach, because that could probably
>   make it into it.  Yet Python doesn't offer any possibility to
>   access NetBSD DISKSYNC stuff sofar.

Are you willing to update your patch accordingly?

> - Currently the programmer must be aware of any platform specific
>   problems.  I, for example, am not aware of Windows.  How can
>   i give any guarantee to users which (will) use my S-Postman on
>   Windows?  I need to put trust in turn into the Framework i am
>   using - Python.  And that makes me feel pretty breathless.

I agree.

> - Fortunately Python is dynamic, so that one simply can replace
>   os.fsync().  Works once only though (think signal handlers :=).

Yes, but since it's a fairly reasonable and useful feature, I think it
could be merged.

>   + Aaarrg!  I'm a liar!!  I lie about - data integrity!!!

Well, actually, some hard disks lie about this too :-)

--

___
Python tracker 

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



[issue12588] test_capi.test_subinterps() failed on OpenBSD (powerpc)

2011-07-22 Thread rpointel

rpointel  added the comment:

Hello,

I just want to inform you that valgrind does not work on OpenBSD (only Linux 
and Darwin).

Thanks for your help,

Remi.

--

___
Python tracker 

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



[issue2771] Test issue

2011-07-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg70327

___
Python tracker 

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



[issue2771] Test issue

2011-07-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

Testing authorage

--
nosy: +loewis

___
Python tracker 

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



[issue2771] Test issue

2011-07-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy:  -loewis

___
Python tracker 

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



[issue12603] pydoc.synopsis breaks if filesystem returns mtime of 0

2011-07-22 Thread Josh Triplett

Josh Triplett  added the comment:

The current behavior of pydoc will cause synopsis to always incorrectly return 
"None" as the synopsis for any module with mtime == 0.  Both of the proposed 
fixes will fix that bug without affecting any case where mtime != 0, so I don't 
think either one has backward-compatibility issues.

I'd suggest using the fix of changing the .get call to return a default of 
(None, None) and changing the conditional to "lastupdate is not None and 
lastupdate < mtime".  That variant seems like more obvious code (since None 
clearly means "no lastupdate time"), and it avoids special-casing an mtime of 0 
and bypassing the synopsis cache.

I don't mind writing a patch if that would help this fix get in.  I'll try to 
write onein the near future, but I certainly won't mind if someone else beats 
me to it. :)

--

___
Python tracker 

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



[issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

2011-07-22 Thread Kuberan Naganathan

Kuberan Naganathan  added the comment:

yes.  i noticed problem on solaris on the /proc//as file which usually
has mapped regions beyond 2^63 in most process files
On Jul 22, 2011 4:35 PM, "Charles-François Natali" 
wrote:
>
> Charles-François Natali  added the comment:
>
> Patch attached.
>
>> For lseek, we can rely on errno. Try something like that:
>>
>> errno = 0;
>> offset = lseek(...);
>> if (offset == (off_t)-1 && errno) /* error */
>>
>
> It's a little bit overkill :-) (for mktime, time_t can overflow easily
> on 32-bit).
>
>> We can write a test using a sparse file... Or maybe a mmap object?
>>
>
> I'm not sure it's easily testable, because it's really a corner case
> not addressed by POSIX. On my Linux box, I can't get lseek to return a
> negative value, I get EINVAL - which does make sense (the Linux kernel
> doesn't accept or return negative file offsets, see
> http://lwn.net/Articles/138063/).
>
> Kuberan, on what operating system did you notice this problem? Solaris?
>
> --
> keywords: +patch
> Added file: http://bugs.python.org/file22719/lseek_negative.diff
>
> ___
> Python tracker 
> 
> ___

--
Added file: http://bugs.python.org/file22721/unnamed

___
Python tracker 

___yes.  i noticed problem on solaris on the /proc//as file which 
usually has mapped regions beyond 2^63 in most process files
On Jul 22, 2011 4:35 PM, "Charles-François 
Natali" rep...@bugs.python.org> wrote:> > Charles-François Natali neolo...@free.fr> added the comment:
> > Patch attached.> >> For lseek, we can rely on 
errno. Try something like that: errno = 0;>> 
offset = lseek(...);>> if (offset == (off_t)-1 && errno) /* 
error */
>>> > It's a little bit overkill :-) (for mktime, 
time_t can overflow easily> on 32-bit).> >> We can 
write a test using a sparse file... Or maybe a mmap object?>>
> > I'm not sure it's easily testable, because it's 
really a corner case> not addressed by POSIX. On my Linux box, I 
can't get lseek to return a> negative value, I get EINVAL - which 
does make sense (the Linux kernel
> doesn't accept or return negative file offsets, see> http://lwn.net/Articles/138063/";>http://lwn.net/Articles/138063/).>
 > Kuberan, on what operating system did you notice this problem? 
Solaris?
> > --> keywords: +patch> Added file: http://bugs.python.org/file22719/lseek_negative.diff";>http://bugs.python.org/file22719/lseek_negative.diff>
 > ___
> Python tracker rep...@bugs.python.org>> 
http://bugs.python.org/issue12545>>
 ___

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



[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-22 Thread py.user

New submission from py.user :

1)
4.6.4 Mutable Sequence Types

| s[i:j] = t |  slice of s from i to j is replaced |
||  by the contents of the iterable t  |


>>> lst = list('abc')
>>> barr = bytearray(b'abc')
>>> lst[:1] = 4
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only assign an iterable
>>> barr[:1] = 4
>>> barr
bytearray(b'\x00\x00\x00\x00bc')
>>>

there is no info about this feature in the documentation

2)
4.6.4 Mutable Sequence Types

| s.extend(x) |  same as s[len(s):len(s)] = x |

>>> lst = list('abc')
>>> barr = bytearray(b'abc')
>>> lst.extend(4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable
>>> barr.extend(4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'int' object is not iterable
>>> lst[len(lst):len(lst)] = 4
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only assign an iterable
>>> barr[len(barr):len(barr)] = 4
>>> barr
bytearray(b'abc\x00\x00\x00\x00')
>>>

barr.extend(x)  !=  barr[len(barr):len(barr)] = x

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 140924
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: Mutable Sequence Type can work not only with iterable in slice[i:j] = t
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue12394] packaging: generate scripts from callable (dotted paths)

2011-07-22 Thread higery

higery  added the comment:

>>IOError: [Errno 13] Permission denied: 
>>'/tmp/user/1013/tmp2xp9qc/tmpwhzzmg/script1'

I have added an 'ensure_directory()' function to build_script.py, but I'm not 
sure if it can fix this error.

--

___
Python tracker 

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



[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t

2011-07-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

To my eye, this looks like a bytearray API bug in the bytearray implementation. 
 ISTM, the rhs of a slice assignment needs to be restricted to iterable inputs.

I'm marking this as low priority because the documented behaviors (i.e. normal 
slice assignment from an iterable) appear to be working fine.  So, there is no 
rush to take away the gratuitous API extension that accepts an integer input 
where a slice is usually expected.  The extension is not entirely harmless 
though -- we do lose the error-checking for the common mistake of writing 
s[i:j]=x instead of s[i:j]=[x].

--
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue12613] itertools fixer fails

2011-07-22 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2011-07-22 Thread R. David Murray

R. David Murray  added the comment:

Yes, except that it would be:

   class PostgressDB2Testcase(AbstractDB2Testcase, unittest.TestCasse):

The fact that other test frameworks have found it worth implementing indicates 
there *might* be something worthwhile there, but unless someone makes the case, 
yes we should close this.

--

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-22 Thread Eli Bendersky

Eli Bendersky  added the comment:

Alright, since *some* tests are better than no tests at all, I will try to 
combine the patches currently attached to the issue, port them to the Hg repo 
and commit.

--

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-22 Thread Eli Bendersky

Eli Bendersky  added the comment:

Brett, what do you mean by "listed as an essential test in regrtest". The 
regrtest.STDTESTS list?

--

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-22 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset be558ad15789 by Eli Bendersky in branch 'default':
Issue #11049: adding some tests to test.support
http://hg.python.org/cpython/rev/be558ad15789

--
nosy: +python-dev

___
Python tracker 

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



[issue11049] add tests for test.support

2011-07-22 Thread Eli Bendersky

Eli Bendersky  added the comment:

This changeset incorporates Giampaolo's patch with a minor fix in 
`test.support.python_is_optimized` (which returned '' for False sometimes).

--

___
Python tracker 

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



  1   2   >