[issue4356] Add key argument to bisect module functions

2008-11-20 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

What about cases where performance is unimportant, or where the key 
function is fast (e.g. an attribute access)?  Then something like

bisect(a, x, key=attrgetter('size'))

is easy to write and read.  Mightn't this be considered good design,
from some perspectives?

Another thought:  if your list is a list of user-defined objects then a 
natural way to do the 'decorate' step of DSU might be to add a 'key' 
attribute to each object, rather than the usual method of constructing 
pairs.  (This has the advantage that you might not have to bother with the 
'undecorate' step.)  With a key argument, bisect could make use of this 
technique too.

Disclaimer: I haven't personally had any need for a key argument on 
bisect, so all this is hypothetical.  That's why I'm asking for real use-
cases.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4356
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread kai zhu

New submission from kai zhu [EMAIL PROTECTED]:


# super_closure.py
class A(object):
  def foo(self):
return super()
# remove the closure below
#  SystemError goes away ???
lambda: self
A().foo()


when run on 3.0rc1  3.0rc2:

hpc-login2 3 ~/work/py3to2: python3.0 super_closure.py
Traceback (most recent call last):
  File super_closure.py, line 9, in module
A().foo()
  File super_closure.py, line 5, in foo
return super()
SystemError: super(): __class__ is not a type (A)

SystemError seems to b raised from typeobject.c (line6155):

static int
super_init(PyObject *self, PyObject *args, PyObject *kwds)
{...
if (!PyType_Check(type)) {
PyErr_Format(PyExc_SystemError,
  super(): __class__ is not a type (%s),
  Py_TYPE(type)-tp_name);
return -1;
}
break;

--
components: Build, Interpreter Core
messages: 76093
nosy: kaizhu
severity: normal
status: open
title: SystemError when method has both super()  closure
type: behavior
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread kai zhu

kai zhu [EMAIL PROTECTED] added the comment:

here's a printout of bytecode from script


 s = open(super_closure.py).read()
 c = compile(s, super_closure.py, exec)
 t = py3to2.codetree(c)
 print( t )
codetree(
co_argcount = 0,
co_cellvars = (),
co_code =
b'Gd\x00\x00\x84\x00\x00d\x01\x00e\x00\x00\x83\x03\x00Z\x01\x00e\x01\x00\x83\x00\x00j\x02\x00\x83\x00\x00\x01d\x02\x00S',
co_filename = 'super_closure.py',
co_firstlineno =  3,
co_flags =64,
co_freevars = (),
co_kwonlyargcount =0,
co_lnotab =   b'\x13\x06',
co_name = 'module',
co_names =('object', 'A', 'foo'),
co_nlocals =  0,
co_stacksize =4,
co_varnames = (),
depth =   0,
co_consts = (
 codetree(
 co_argcount = 1,
 co_cellvars = ('__class__',),
 co_code =
b'|\x00\x00Ee\x00\x00Z\x01\x00\x87\x00\x00f\x01\x00d\x00\x00\x86\x00\x00Z\x02\x00\x87\x00\x00S',
 co_filename = 'super_closure.py',
 co_firstlineno =  3,
 co_flags =2,
 co_freevars = (),
 co_kwonlyargcount =0,
 co_lnotab =   b'\n\x01',
 co_name = 'A',
 co_names =('__name__', '__module__', 'foo'),
 co_nlocals =  1,
 co_stacksize =2,
 co_varnames = ('__locals__',),
 depth =   1,
 co_consts = (
  codetree(
  co_argcount = 1,
  co_cellvars = ('self',),
  co_code =
b't\x00\x00\x83\x00\x00S\x87\x00\x00f\x01\x00d\x01\x00\x86\x00\x00\x01',
  co_filename = 'super_closure.py',
  co_firstlineno =  4,
  co_flags =3,
  co_freevars = ('__class__',),
  co_kwonlyargcount =0,
  co_lnotab =   b'\x00\x01\x07\x03',
  co_name = 'foo',
  co_names =('super',),
  co_nlocals =  1,
  co_stacksize =2,
  co_varnames = ('self',),
  depth =   2,
  co_consts = (
   None,
   codetree(
   co_argcount = 0,
   co_cellvars = (),
   co_code = b'\x88\x00\x00S',
   co_filename = 'super_closure.py',
   co_firstlineno =  8,
   co_flags =19,
   co_freevars = ('self',),
   co_kwonlyargcount =0,
   co_lnotab =   b'',
   co_name = 'lambda',
   co_names =(),
   co_nlocals =  0,
   co_stacksize =1,
   co_varnames = (),
   depth =   3,
   co_consts = (
)),
   )),
  )),
 A,
 None,
 ))


and disassembly:


 print( t.dis() )
  3   0 LOAD_BUILD_CLASS
  1 LOAD_CONST   0 (code object A at
0x2a987af9b0, file super_closure.py, line 3)
  4 MAKE_FUNCTION0
  7 LOAD_CONST   1 ('A')
 10 LOAD_NAME0 (object)
 13 CALL_FUNCTION3
 16 STORE_NAME   1 (A)

  9  19 LOAD_NAME1 (A)
 22 CALL_FUNCTION0
 25 LOAD_ATTR2 (foo)
 28 CALL_FUNCTION0
 31 POP_TOP
 32 LOAD_CONST   2 (None)
 35 RETURN_VALUE

  3   0 LOAD_FAST0 (__locals__)
  3 STORE_LOCALS
  4 LOAD_NAME0 (__name__)
  7 STORE_NAME   1 (__module__)

  4  10 LOAD_CLOSURE 0 (__class__)
 13 BUILD_TUPLE  1
 16 LOAD_CONST   0 (code object foo at
0x2a987afd30, file super_closure.py, line 4)
 19 MAKE_CLOSURE 0
 22 STORE_NAME   2 (foo)
 25 LOAD_CLOSURE 0 (__class__)
 28 RETURN_VALUE

  5   0 LOAD_GLOBAL  0 (super)
  3 CALL_FUNCTION0
  6 RETURN_VALUE

  8   7 LOAD_CLOSURE 0 (self)
 10 BUILD_TUPLE  1
 13 LOAD_CONST   1 (code object
lambda at 0x2a984c0530, file super_closure.py, line 8)
 16 MAKE_CLOSURE 0
 19 POP_TOP

  8   0 LOAD_DEREF   0 (self)
  3 RETURN_VALUE



___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread kai zhu

kai zhu [EMAIL PROTECTED] added the comment:

same thing, except w/ closure commented out ( everything is happy)


# super_ok.py
class A(object):
  def foo(self):
return super()
# comment the closure below
#  SystemError goes away
# lambda: self
A().foo()



 s = open(super_ok.py).read()
 c = compile(s, super_ok.py, exec)
 t = py3to2.codetree(t)
 print( t )
codetree(
co_argcount = 0,
co_cellvars = (),
co_code =
b'Gd\x00\x00\x84\x00\x00d\x01\x00e\x00\x00\x83\x03\x00Z\x01\x00e\x01\x00\x83\x00\x00j\x02\x00\x83\x00\x00\x01d\x02\x00S',
co_filename = 'super_closure.py',
co_firstlineno =  3,
co_flags =64,
co_freevars = (),
co_kwonlyargcount =0,
co_lnotab =   b'\x13\x06',
co_name = 'module',
co_names =('object', 'A', 'foo'),
co_nlocals =  0,
co_stacksize =4,
co_varnames = (),
depth =   0,
co_consts = (
 codetree(
 co_argcount = 1,
 co_cellvars = ('__class__',),
 co_code =
b'|\x00\x00Ee\x00\x00Z\x01\x00\x87\x00\x00f\x01\x00d\x00\x00\x86\x00\x00Z\x02\x00\x87\x00\x00S',
 co_filename = 'super_closure.py',
 co_firstlineno =  3,
 co_flags =2,
 co_freevars = (),
 co_kwonlyargcount =0,
 co_lnotab =   b'\n\x01',
 co_name = 'A',
 co_names =('__name__', '__module__', 'foo'),
 co_nlocals =  1,
 co_stacksize =2,
 co_varnames = ('__locals__',),
 depth =   1,
 co_consts = (
  codetree(
  co_argcount = 1,
  co_cellvars = ('self',),
  co_code =
b't\x00\x00\x83\x00\x00S\x87\x00\x00f\x01\x00d\x01\x00\x86\x00\x00\x01',
  co_filename = 'super_closure.py',
  co_firstlineno =  4,
  co_flags =3,
  co_freevars = ('__class__',),
  co_kwonlyargcount =0,
  co_lnotab =   b'\x00\x01\x07\x03',
  co_name = 'foo',
  co_names =('super',),
  co_nlocals =  1,
  co_stacksize =2,
  co_varnames = ('self',),
  depth =   2,
  co_consts = (
   None,
   codetree(
   co_argcount = 0,
   co_cellvars = (),
   co_code = b'\x88\x00\x00S',
   co_filename = 'super_closure.py',
   co_firstlineno =  8,
   co_flags =19,
   co_freevars = ('self',),
   co_kwonlyargcount =0,
   co_lnotab =   b'',
   co_name = 'lambda',
   co_names =(),
   co_nlocals =  0,
   co_stacksize =1,
   co_varnames = (),
   depth =   3,
   co_consts = (
)),
   )),
  )),
 A,
 None,
 ))

 print( t.dis() )
  3   0 LOAD_BUILD_CLASS
  1 LOAD_CONST   0 (code object A at
0x2a987af2b0, file super_closure.py, line 3)
  4 MAKE_FUNCTION0
  7 LOAD_CONST   1 ('A')
 10 LOAD_NAME0 (object)
 13 CALL_FUNCTION3
 16 STORE_NAME   1 (A)

  9  19 LOAD_NAME1 (A)
 22 CALL_FUNCTION0
 25 LOAD_ATTR2 (foo)
 28 CALL_FUNCTION0
 31 POP_TOP
 32 LOAD_CONST   2 (None)
 35 RETURN_VALUE

  3   0 LOAD_FAST0 (__locals__)
  3 STORE_LOCALS
  4 LOAD_NAME0 (__name__)
  7 STORE_NAME   1 (__module__)

  4  10 LOAD_CLOSURE 0 (__class__)
 13 BUILD_TUPLE  1
 16 LOAD_CONST   0 (code object foo at
0x2a987af4b0, file super_closure.py, line 4)
 19 MAKE_CLOSURE 0
 22 STORE_NAME   2 (foo)
 25 LOAD_CLOSURE 0 (__class__)
 28 RETURN_VALUE

  5   0 LOAD_GLOBAL  0 (super)
  3 CALL_FUNCTION0
  6 RETURN_VALUE

  8   7 LOAD_CLOSURE 0 (self)
 10 BUILD_TUPLE  1
 13 LOAD_CONST   1 (code object
lambda at 0x2a987af5b0, file super_closure.py, line 8)
 16 MAKE_CLOSURE 0
 19 POP_TOP

  8   0 LOAD_DEREF   0 (self)
  3 RETURN_VALUE



___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread kai zhu

kai zhu [EMAIL PROTECTED] added the comment:

oops, sorry reprinted the same code ^^;;; ignore previous post,  use
this: (sorry again for mucking up this page)


# super_ok.py
class A(object):
  def foo(self):
return super()
# comment the closure below
#  SystemError goes away
# lambda: self
A().foo()


 s = open(super_ok.py).read(); c = compile(s, super_ok.py,
exec); t = py3to2.codetree(c)
 print( t )
codetree(
co_argcount = 0,
co_cellvars = (),
co_code =
b'Gd\x00\x00\x84\x00\x00d\x01\x00e\x00\x00\x83\x03\x00Z\x01\x00e\x01\x00\x83\x00\x00j\x02\x00\x83\x00\x00\x01d\x02\x00S',
co_filename = 'super_ok.py',
co_firstlineno =  3,
co_flags =64,
co_freevars = (),
co_kwonlyargcount =0,
co_lnotab =   b'\x13\x06',
co_name = 'module',
co_names =('object', 'A', 'foo'),
co_nlocals =  0,
co_stacksize =4,
co_varnames = (),
depth =   0,
co_consts = (
 codetree(
 co_argcount = 1,
 co_cellvars = ('__class__',),
 co_code =
b'|\x00\x00Ee\x00\x00Z\x01\x00\x87\x00\x00f\x01\x00d\x00\x00\x86\x00\x00Z\x02\x00\x87\x00\x00S',
 co_filename = 'super_ok.py',
 co_firstlineno =  3,
 co_flags =2,
 co_freevars = (),
 co_kwonlyargcount =0,
 co_lnotab =   b'\n\x01',
 co_name = 'A',
 co_names =('__name__', '__module__', 'foo'),
 co_nlocals =  1,
 co_stacksize =2,
 co_varnames = ('__locals__',),
 depth =   1,
 co_consts = (
  codetree(
  co_argcount = 1,
  co_cellvars = (),
  co_code = b't\x00\x00\x83\x00\x00S',
  co_filename = 'super_ok.py',
  co_firstlineno =  4,
  co_flags =3,
  co_freevars = ('__class__',),
  co_kwonlyargcount =0,
  co_lnotab =   b'\x00\x01',
  co_name = 'foo',
  co_names =('super',),
  co_nlocals =  1,
  co_stacksize =1,
  co_varnames = ('self',),
  depth =   2,
  co_consts = (
   None,
   )),
  )),
 A,
 None,
 ))
 print( t.dis() )
  3   0 LOAD_BUILD_CLASS
  1 LOAD_CONST   0 (code object A at
0x2a987afd30, file super_ok.py, line 3)
  4 MAKE_FUNCTION0
  7 LOAD_CONST   1 ('A')
 10 LOAD_NAME0 (object)
 13 CALL_FUNCTION3
 16 STORE_NAME   1 (A)

  9  19 LOAD_NAME1 (A)
 22 CALL_FUNCTION0
 25 LOAD_ATTR2 (foo)
 28 CALL_FUNCTION0
 31 POP_TOP
 32 LOAD_CONST   2 (None)
 35 RETURN_VALUE

  3   0 LOAD_FAST0 (__locals__)
  3 STORE_LOCALS
  4 LOAD_NAME0 (__name__)
  7 STORE_NAME   1 (__module__)

  4  10 LOAD_CLOSURE 0 (__class__)
 13 BUILD_TUPLE  1
 16 LOAD_CONST   0 (code object foo at
0x2a984c0530, file super_ok.py, line 4)
 19 MAKE_CLOSURE 0
 22 STORE_NAME   2 (foo)
 25 LOAD_CLOSURE 0 (__class__)
 28 RETURN_VALUE

  5   0 LOAD_GLOBAL  0 (super)
  3 CALL_FUNCTION0
  6 RETURN_VALUE



___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4361] Docstring for Lib/string.py is outdated

2008-11-20 Thread thp

New submission from thp [EMAIL PROTECTED]:

The docstring in Lib/string.py in the source of Python 3.0rc2 is
wrong. It currently says lowercase, uppercase and letters where it
should say ascii_lowercase, ascii_uppercase and ascii_letters.

--
assignee: georg.brandl
components: Documentation
files: Lib_string_py-docstring.patch
keywords: patch
messages: 76097
nosy: georg.brandl, thp
severity: normal
status: open
title: Docstring for Lib/string.py is outdated
versions: Python 3.0
Added file: http://bugs.python.org/file12069/Lib_string_py-docstring.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4361
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4356] Add key argument to bisect module functions

2008-11-20 Thread Raymond Hettinger

Raymond Hettinger [EMAIL PROTECTED] added the comment:

I had said almost always.  Sure, if you don't care about performance
or scalability, a key= argument would be a net win.

We're responsible for creating an API that steers most programmers in
the right direction (Tim sez we read Knuth so you don't have to). 
Algorithmically, the bisect functions are at the wrong level of
granularity for applying a key function.  

For user-defined objects, there is no need for a key-attribute since can
just supply a custom comparison method:

class UserDefined:
  . . .
  def cmp(self, other):
  return cmp(self.key, other.key)

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4356
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4356] Add key argument to bisect module functions

2008-11-20 Thread Raymond Hettinger

Changes by Raymond Hettinger [EMAIL PROTECTED]:


--
resolution:  - duplicate
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4356
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4356] Add key argument to bisect module functions

2008-11-20 Thread Mark Dickinson

Mark Dickinson [EMAIL PROTECTED] added the comment:

One case I've been thinking about is that of maintaining a list of Decimal 
objects that are sorted by absolute value.  For this, having to create a 
list of (abs(x), x) pairs just seems clumsy compared to using a key 
argument to bisect.

Perhaps this is a contrived use case, but it doesn't seem totally 
implausible.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4356
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread David M. Beazley

New submission from David M. Beazley [EMAIL PROTECTED]:

The FileIO object defined in the new io library has name and mode 
properties.  However, attempts to access either value result in an 
AttributeError exception.   The C source code in _fileio.c doesn't even 
implement a name attribute and it uses a different name for mode (mode 
instead of _mode that the property is looking for).

Broken in 2.6 and 3.0rc2.

--
components: Library (Lib)
messages: 76100
nosy: beazley
severity: normal
status: open
title: FileIO object in io module
type: behavior
versions: Python 2.6

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-11-20 Thread David M. Beazley

David M. Beazley [EMAIL PROTECTED] added the comment:

Just a quick comment from the Python training universe--this bug makes it 
impossible to use Python 2.6 in any kind of Python teaching environment 
where IDLE tends to be used a lot.  I'm having to tell students to stick 
with Python-2.5.2.

--
nosy: +beazley

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4017
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

This needs to be verified before the next rc gets out.

--
nosy: +christian.heimes
priority:  - release blocker
stage:  - test needed
versions: +Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

In a running frame, f-f_localplus is a vector composed of:
- the values of the local variables
- the cells containing variables used in a nested closure.
- the values of free variables defined in a outer scope.

super() needs to access the free var containing the enclosing class
object, but forgets to account for the number of cells...

The attached patch corrects the problem.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file12070/super-withcell.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Yet another release blocker for Barry. Good work, Amaury.

--
assignee:  - barry
components:  -Build
nosy: +barry, christian.heimes
priority:  - release blocker
resolution:  - accepted
stage:  - patch review

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4082] python2.6 -m site doesn't run site._script() any more

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

It's still an issue and I like to get it resolved. The site module lets
users access information related to my uesr site package directory. In
2.6 the information isn't accessible: 

$ python3.0 -m site --user-site
/home/heimes/.local/lib/python3.0/site-packages
$ python2.6 -m site --user-site
$

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4082
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1529142] Allowing multiple instances of IDLE with sub-processes

2008-11-20 Thread Weeble

Changes by Weeble [EMAIL PROTECTED]:


--
nosy: +weeble

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1529142
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4354] distutils.command.register is broken

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

The patch is fine with me.

--
assignee:  - barry
nosy: +barry, christian.heimes
priority:  - release blocker
resolution:  - accepted
stage:  - commit review

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4354
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4363] Make uuid module functions usable without ctypes

2008-11-20 Thread Dmitry Vasiliev

New submission from Dmitry Vasiliev [EMAIL PROTECTED]:

The attached patch removes dependency on ctypes from uuid.uuid1() and
uuid.uuid4() functions.

--
components: Library (Lib)
files: uuid.patch
keywords: patch
messages: 76107
nosy: hdima
severity: normal
status: open
title: Make uuid module functions usable without ctypes
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file12071/uuid.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4363
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4364] error in multiprocessing docs - rawvalue

2008-11-20 Thread Brian D'Urso

New submission from Brian D'Urso [EMAIL PROTECTED]:

There is an error in the multiprocessing package documentation:
In the sentence:

'Note that an array of ctypes.c_char has value and rawvalue attributes
which allow one to use it to store and retrieve strings.'

The error is that 'rawvalue' should be 'raw'.
This sentence actually occurs in two places: under multiprocessing.Array
and just before multiprocessing.sharedctypes.Array. It looks to me like
the second occurrence of the sentence is in the wrong place - I think it
should be in the multiprocessing.sharedctypes.Array section instead of
just before it.


To see that the attribute name is 'raw', just do:

 import ctypes, multiprocessing
 dir(multiprocessing.Array(ctypes.c_char, 1))

== ['__class__', '__delattr__', '__dict__', '__doc__', '__format__',
'__getattribute__', '__getitem__', '__getslice__', '__hash__',
'__init__', '__len__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__setitem__',
'__setslice__', '__sizeof__', '__str__', '__subclasshook__',
'__weakref__', '_lock', '_obj', 'acquire', 'get_lock', 'get_obj', 'raw',
'release', 'value']

--
assignee: georg.brandl
components: Documentation
messages: 76108
nosy: dursobr, georg.brandl
severity: normal
status: open
title: error in multiprocessing docs - rawvalue
versions: Python 2.6, Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4364
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

The attached patch is an attempt to set mode and name attributes to all
three objects in the IO stack.
For example, 
 f = open(foo, U+)
 f.buffer.name, f.buffer.mode
('foo', 'r+')

See also the unit tests.


There is a little inconsistency that I don't know how to resolve: with
my patch, the mode does not round-trip: open(name, mode).mode is not
always equal to mode:
 f = open(foo, rb)
 f.name, f.mode
('t', 'r')
The 'b' was removed because f is already a binary file returning bytes.

But it seems better than attaching the initial mode to the FileIO
object. Currently,
 io.open(foo, Ub+, buffering=0)
_fileio._FileIO(3, 'r+')
 io.open(foo, Ub+, buffering=0).mode
'Ub+'
Which is even more surprising IMO.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file12072/fileio_attributes.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-20 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

Here is a test case (a.py) which produces a FatalError back to Python
2.4 at least)

Added file: http://bugs.python.org/file12073/a.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4365] Add CRT version info in msvcrt module

2008-11-20 Thread Cournapeau David

New submission from Cournapeau David [EMAIL PROTECTED]:

This patch if the first part to follow discussion on python-list
concerning problems when using distutils.config.try_run with mingw and
manifest problems on windows for python 2.6 (or any python built with
recent VS).

It simply adds strings constant got the msvcrt module, so that they can
be queried in distutils to generate manifest on the fly if needed. I
don't know which approach is best to deal with conditional compilation:
for now, I simply do not add the constants if the constants are not
defined at the C level, but this does not strike as a great idea to me.

--
components: Windows
files: msvcrt_version_info.diff
keywords: patch
messages: 76112
nosy: cdavid
severity: normal
status: open
title: Add CRT version info in msvcrt module
versions: Python 2.7
Added file: http://bugs.python.org/file12074/msvcrt_version_info.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4365
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4236] Crash when importing builtin module during interpreter shutdown

2008-11-20 Thread Barry A. Warsaw

Barry A. Warsaw [EMAIL PROTECTED] added the comment:

After consultation with MvL and Crys_ on irc, we've agreed that this
should be fixed someday but it's a pathological case that shouldn't hold
up the release.  I'm lowering to critical because I don't think it
should even hold up the final release.

--
assignee:  - brett.cannon
priority: release blocker - critical

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4306] email package with unicode subject/body

2008-11-20 Thread Barry A. Warsaw

Barry A. Warsaw [EMAIL PROTECTED] added the comment:

I'm rejecting the patch because the old way of making this work still
works in Python 3.0.  Any larger changes to the API need to be made in
the context of redesigning the email package to be byte/str aware.

--
resolution:  - rejected
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4306
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4354] distutils.command.register is broken

2008-11-20 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

Thanks for the patch. Committed as r67298.

For some reason, the saved credentials won't be read back in. Not sure
whether this is specific to 3.0, though, or part of the new PyPIRC handling.

--
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4354
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1083] Confusing error message when dividing timedelta using /

2008-11-20 Thread webograph

Changes by webograph [EMAIL PROTECTED]:


--
nosy: +webograph

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1083
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4366] cannot find -lpython2.5 when buinding Python 2.5.2 on FreeBSD 4.11

2008-11-20 Thread Akira Kitada

New submission from Akira Kitada [EMAIL PROTECTED]:

I get a number of cannot find -lpython2.5 error when building Python
2.5.2 on FreeBSD 2.5.2 with gcc 2.95.4.
This problem is only occured when I build it with --enable-shared
configure option.

This is how you can reproduce this problem.

cd Python-2.5.2
configure --enable-shared
make

and you will get

gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.5/usr/home/build/dev/Python-2.5.2/Modules/_struct.o
-L/usr/local/lib -lpython2.5 -o build/lib.freebsd-4.11-RELEASE-i386-2.5/_
struct.so
/usr/libexec/elf/ld: cannot find -lpython2.5
...
/home/build/dev/Python-2.5.2/Modules/_ctypes/libffi/src/x86/sysv.o
-L/usr/local/lib -lpython2.5 -o
build/lib.freebsd-4.11-RELEASE-i386-2.5/_ctypes.so
/usr/libexec/elf/ld: cannot find -lpython2.5
...
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.5/usr/home/build/dev/Python-2.5.2/Modules/_ctypes/_ctypes_test.o
-L/usr/local/lib -lpython2.5 -o build/lib.freebsd-4.11-RELEA
SE-i386-2.5/_ctypes_test.so
/usr/libexec/elf/ld: cannot find -lpython2.5 
...
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.5/usr/home/build/dev/Python-2.5.2/Modules/_weakref.o
-L/usr/local/lib -lpython2.5 -o build/lib.freebsd-4.11-RELEASE-i386-2.5/
_weakref.so
/usr/libexec/elf/ld: cannot find -lpython2.5
...
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.5/usr/home/build/dev/Python-2.5.2/Modules/arraymodule.o
-L/usr/local/lib -lpython2.5 -o build/lib.freebsd-4.11-RELEASE-i386-2
.5/array.so
/usr/libexec/elf/ld: cannot find -lpython2.5
..


You can workaround this by running  ./configure LDFLAGS=-L.
--enable-shared.

--
components: Build
messages: 76117
nosy: akitada
severity: normal
status: open
title: cannot find -lpython2.5 when buinding Python 2.5.2 on FreeBSD 4.11
type: compile error
versions: Python 2.5

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4366
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4366] cannot find -lpython2.5 when buinding Python 2.5.2 on FreeBSD 4.11

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Please try this patch with a clean source tree. It adds the current
directory to the library search path.

Index: setup.py
===
--- setup.py(revision 67295)
+++ setup.py(working copy)
@@ -245,6 +245,7 @@
 def detect_modules(self):
 # Ensure that /usr/local is always used
 add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+add_dir_to_list(self.compiler.library_dirs, '.')
 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')

 # Add paths specified in the environment variables LDFLAGS and

--
nosy: +christian.heimes

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4366
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Giuseppe Ottaviano

New submission from Giuseppe Ottaviano [EMAIL PROTECTED]:

Hi all,
trying to compile Python 2.6 I got a segmentation fault while
byte-compiling the modules. 

The segmentation fault happened in ast_for_atom, parsing an Unicode
entity. I found out that another problem prevented unicodedata to be
imported, so unicode_decode raised an exception. I think the problem is
in the following lines:

if (PyErr_ExceptionMatches(PyExc_UnicodeError)){
PyObject *type, *value, *tback, *errstr;
PyErr_Fetch(type, value, tback);
errstr = ((PyUnicodeErrorObject *)value)-reason;

I'm not an expert of CPython internals, but the exception is raised with
PyErr_SetString, so value is a PyStringObject, and that cast is invalid.
Changing the last line to 

errstr = value;

everything works. 

The patch is attached.

--
files: ast.patch
keywords: patch
messages: 76119
nosy: ot
severity: normal
status: open
title: Patch for segmentation fault in ast_for_atom
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file12075/ast.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4368] a bug in ncurses.h still exist in

2008-11-20 Thread Akira Kitada

Changes by Akira Kitada [EMAIL PROTECTED]:


--
nosy: akitada
severity: normal
status: open
title: a bug in ncurses.h still exist in

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4368
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4369] Error building to a nonstandard prefix (with patch)

2008-11-20 Thread Giuseppe Ottaviano

New submission from Giuseppe Ottaviano [EMAIL PROTECTED]:

Hi all,
I am trying to compile python 2.6 using a user directory as prefix. In
the the byte-compiling step of install, compileall.py fails to load all
the .so modules (it fails for zlib.so and raises an exception for
unicodedata.so), so the build fails. I think it is because python is
invoked by the makefile with the env variables

PYTHONPATH=$(DESTDIR)$(LIBDEST)

while the .so are in $(LIBDEST)/lib-dynload .

Setting PYTHONHOME instead of PYTHONPATH works for me (but i do not know
if it breaks anything else):

PYTHONHOME=$(exec_prefix)

The patch is attached.

--
components: Build
files: make.patch
keywords: patch
messages: 76120
nosy: ot
severity: normal
status: open
title: Error building to a nonstandard prefix (with patch)
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file12076/make.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4368] A bug in ncurses.h still exists in FreeBSD 4.9 - 4.11

2008-11-20 Thread Akira Kitada

New submission from Akira Kitada [EMAIL PROTECTED]:

Excerpt from configure.in


# On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
# it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
# this is fixed in 10.3, which identifies itself as Darwin/7.*
# This should hopefully be fixed in FreeBSD 4.9
FreeBSD/4.8* | Darwin/6* )


Unfotunately, this bug isn't fixed in FreeBSD 4.9 and even 4.1[01].
Attached patch fixes this.

Note that this fix is already included in trunk, 2.6 and 3k branches.
See also: Issue4204

--
components: +Build
keywords: +patch
title: a bug in ncurses.h still exist in - A bug in ncurses.h still exists in 
FreeBSD 4.9 - 4.11
type:  - compile error
versions: +Python 2.5
Added file: http://bugs.python.org/file12077/configure.in.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4368
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4366] cannot find -lpython2.5 when buinding Python 2.5.2 on FreeBSD 4.11

2008-11-20 Thread Akira Kitada

Akira Kitada [EMAIL PROTECTED] added the comment:

Christian's patch fixed this problem!
(tested on 4.11-RELEASE)

I'm not sure why the other platforms don't suffer this problem.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4366
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4370] warning: unknown conversion type character `z' in format

2008-11-20 Thread Akira Kitada

New submission from Akira Kitada [EMAIL PROTECTED]:

Some compilers don't understand %zd format specifer
and gcc 2.95.4 is one of them.
(You can find more on http://www.and.org/vstr/printf_comparison)

When building Python with such compilers, you will see a lot of
warning: unknown conversion type character `z' in format messages.
This is not a big issue but I think this can be fixed by using autoconf
right way because configure script seems checking availability of zd.

  checking for %zd printf() format support

So I suppose there is a way to eliminate this warning completely.

--
components: Build
messages: 76123
nosy: akitada
severity: normal
status: open
title: warning: unknown conversion type character `z' in format
type: compile error
versions: Python 2.5, Python 2.5.3, Python 2.6, Python 2.7, Python 3.0, Python 
3.1

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Can you provide the code that caused the seg fault?

--
nosy: +benjamin.peterson
priority:  - high

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

I think I got the point: to decode strings like \N{CHARACTER NAME}
PyUnicode_DecodeUnicodeEscape imports the unicodedata module.
If this fails, PyErr_SetString(PyExc_UnicodeError, some message)
is called.

The exception will eventually be caught by ast_for_atom (in
Python/ast.c), but the exception there is not normalized: type is
PyExc_UnicodeError when the value is a string. Hence the invalid cast.
The exception cannot be normalized there: UnicodeError.__init__ needs 5
arguments.

I think the error was to call PyErr_SetString in the first place.
The attached patch replaces it with PyErr_SetObject and a full
UnicodeDecodeError object.

This deserves a unit test, but I wonder how to reliably make the import
fail.

--
keywords: +needs review
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file12078/bad_unicodeerror.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon

Changes by Brett Cannon [EMAIL PROTECTED]:


--
keywords: +needs review
stage:  - commit review

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3799
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1447222] tkinter Dialog fails when more than four buttons are used

2008-11-20 Thread Guilherme Polo

Guilherme Polo [EMAIL PROTECTED] added the comment:

issue4333 fixes this too, btw

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1447222
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

The patch looks good to me.

--
nosy: +brett.cannon

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4360] SystemError when method has both super() closure

2008-11-20 Thread Brett Cannon

Changes by Brett Cannon [EMAIL PROTECTED]:


--
keywords:  -needs review
stage: patch review - commit review

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4360
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Giuseppe Ottaviano

Giuseppe Ottaviano [EMAIL PROTECTED] added the comment:

@amaury: Yes, this is exactly what I noticed. I didn't know how to create 
an instance of a PyUnicodeErrorObject. BTW, isn't PyErr_SetString used 
throughout the code? Should all those calls replaced with PyErr_SetObject?

@benjamin: The bug can be easily reproduced:
brian:tmp ot$ echo 'raise Exception()'  unicodedata.py
brian:tmp ot$ python2.6 -c print u'\N{SOFT HYPHEN}'
Segmentation fault

I don't know if this can be used as an unit test.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-20 Thread Gregor Lingl

Gregor Lingl [EMAIL PROTECTED] added the comment:

Here the patch, updated

Added file: http://bugs.python.org/file12080/setup_patch.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4117
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Barry A. Warsaw

Barry A. Warsaw [EMAIL PROTECTED] added the comment:

I'm okay with the roundtrip not being supported.  One thing I don't
quite understand is in the third test, where you're using w+ mode and
testing f.buffer.mode and f.buffer.raw.mode is r+.  Why is that?

--
nosy: +barry

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4117] missing update() in _Screen.setup() of Lib/turtle.py

2008-11-20 Thread Gregor Lingl

Gregor Lingl [EMAIL PROTECTED] added the comment:

Sorry, but there is a remain from testing different versions of the
turtle module in the demo file's import statement.

Should read (of course):

from turtle import Screen, Turtle, mainloop

A corrected version is attached

Sorry, again, for the inconvenience
Gregor

Added file: http://bugs.python.org/file12081/setup_bug_demo.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4117
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Barry A. Warsaw

Barry A. Warsaw [EMAIL PROTECTED] added the comment:

r67300 (with after the fact whitespace normalization of
Lib/tests/test_io.py)

--
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4368] A bug in ncurses.h still exists in FreeBSD 4.9 - 4.11

2008-11-20 Thread Roumen Petrov

Roumen Petrov [EMAIL PROTECTED] added the comment:

You patch is out of date. The current case is for FreeBSD/4.* .

--
nosy: +rpetrov

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4368
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4368] A bug in ncurses.h still exists in FreeBSD 4.9 - 4.11

2008-11-20 Thread Roumen Petrov

Roumen Petrov [EMAIL PROTECTED] added the comment:

missed target version sorry

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4368
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4371] coerce gone---but not from docs

2008-11-20 Thread David W. Lambert

New submission from David W. Lambert [EMAIL PROTECTED]:

http://docs.python.org/dev/3.0/glossary.html

Scanning the glossary reveals...


coercion

The glossary needs rewritten to eliminate  coerce builtin.

__future__
   
Uses example import division, I'd replace it but I don't know what 
the future holds.

integer division

obvious.

view

not defined in the glossary.  Please consider adding this concept.

--
messages: 76142
nosy: LambertDW
severity: normal
status: open
title: coerce gone---but not from docs

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc [EMAIL PROTECTED]:


--
resolution:  - fixed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4371] coerce gone---but not from docs

2008-11-20 Thread David W. Lambert

Changes by David W. Lambert [EMAIL PROTECTED]:


--
assignee:  - georg.brandl
components: +Documentation
nosy: +georg.brandl
versions: +Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4306] email package with unicode subject/body

2008-11-20 Thread STINNER Victor

STINNER Victor [EMAIL PROTECTED] added the comment:

 I'm rejecting the patch because the old way of making 
 this work still works in Python 3.0.

I checked the documentation and there is a section about email: 
Internationalized headers. I didn't read this section. I just 
expected that Python uses the right encoding beacuse it was already 
specified in the MIMEText() constructor...

 Any larger changes to the API need to be made in
 the context of redesigning the email package to be byte/str aware.

Right.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4306
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4082] python2.6 -m site doesn't run site._script() any more

2008-11-20 Thread Nick Coghlan

Nick Coghlan [EMAIL PROTECTED] added the comment:

That does remind me of another problem though - __main__.__file__ isn't
currently set correctly when runpy picks up the module to run from
inside a zipfile (zipimporter doesn't support runpy/pkgutil's
non-standard get_filename() extension to the PEP 302 importer API)

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4082
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4306] email package with unicode subject/body

2008-11-20 Thread Barry A. Warsaw

Barry A. Warsaw [EMAIL PROTECTED] added the comment:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Nov 20, 2008, at 5:07 PM, STINNER Victor wrote:

 STINNER Victor [EMAIL PROTECTED] added the comment:

 I'm rejecting the patch because the old way of making
 this work still works in Python 3.0.

 I checked the documentation and there is a section about email:
 Internationalized headers. I didn't read this section. I just
 expected that Python uses the right encoding beacuse it was already
 specified in the MIMEText() constructor...

Yes.  This is a stupid API (tm). :)

- -Barry

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)

iQCVAwUBSSXpJHEjvBPtnXfVAQKfOAP9G2BSPKIPTVTeo5k3rovqGbYSCB23SK+P
+YHInZY2NTikFUgJec4EvWvvuTkW77nb5kxVTb+MlQJMAN//AOy8xvHsFUae4F8Y
P9DsDMb3MhKokr/Y1gZyxlpHhXiK5r6aEh9+cWrujXbf9gwtYWmeiKl6MoZkOWYA
3H9gASFvuUI=
=mapP
-END PGP SIGNATURE-

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4306
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4372] __cmp__ removal not in What's New

2008-11-20 Thread Terry J. Reedy

New submission from Terry J. Reedy [EMAIL PROTECTED]:

What's New in Python 3.0/Common stumbling blocks
has this builtin.sorted() and list.sort() no longer accept the cmp
argument providing a comparison function. Use the key argument instead.

Please add The __cmp__ special method is no longer used for
comparisons. Use __lt__ for sorting, __eq__ with __hash__, and other
rich comparisons as needed.

People are already stumbling on this.

--
assignee: georg.brandl
components: Documentation
messages: 76147
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: __cmp__ removal not in What's New
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4372
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Reopening, since this causes failure in socket.makefile()

--
resolution: fixed - 
status: closed - open

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

This patch addresses the makefile() function and the SocketIO class.

Added file: http://bugs.python.org/file12082/socketio_attributes.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4338] TypeError (bytes/str) in distutils command upload

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Martin, do you still have remarks about this patch?
Can we apply it?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4338
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw [EMAIL PROTECTED]:


--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4233] open(0, closefd=False) prints 3 warnings

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Backported to trunk in r67307.

But -- do we really want to backport to 2.6? This changes the semantics 
of closefd, adds a new closefd attribute...
Did the rules change for 2.6.1?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4233
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw [EMAIL PROTECTED]:


--
status: closed - open

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4338] TypeError (bytes/str) in distutils command upload

2008-11-20 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

The patch is fine, please apply.

--
keywords:  -needs review
resolution:  - accepted

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4338
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Here's a patch that makes FileIO accept and return 'b' in its mode string.

--
nosy: +benjamin.peterson
Added file: http://bugs.python.org/file12083/fileio_always_binary.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4338] TypeError (bytes/str) in distutils command upload

2008-11-20 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:

Fixed in r67308.

--
resolution: accepted - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4338
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4362] FileIO object in io module

2008-11-20 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Since, we don't really care about round-tripping, test_gzip was fixed in
r67309.

--
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

r67310 has the fix.

--
resolution:  - accepted
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3799
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

I am re-opening this as a deferred blocker with a patch to document that
dbm implementations write out and return bytes, but that strings are
accepted and implicitly converted.

--
priority: release blocker - deferred blocker
status: closed - open
Added file: http://bugs.python.org/file12084/doc_dbm_strings.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3799
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3799] Byte/string inconsistencies between different dbm modules

2008-11-20 Thread Brett Cannon

Brett Cannon [EMAIL PROTECTED] added the comment:

Have another patch that fixes all open() calls to specify the file
encoding in dbm.dumb. Also caught one spot in _addkey() where
decode(Latin-1) was not being called.

Added file: http://bugs.python.org/file12085/specify_open_encoding.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3799
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4373] Reference leaks in Python 3.0rc3

2008-11-20 Thread Christian Heimes

New submission from Christian Heimes [EMAIL PROTECTED]:

A refleak test of r67311 py3k shows several leaks:

test_distutils leaked [142, 142, 142, 142] references, sum=568
test_httpservers leaked [0, 0, 0, 217] references, sum=217
test_multiprocessing leaked [0, 0, 24, 0] references, sum=24
test_pickle leaked [1, 1, 1, 1] references, sum=4
test_pickletools leaked [1, 1, 1, 1] references, sum=4
test_telnetlib leaked [-84, 84, 0, 0] references, sum=0
test_threadedtempfile leaked [94, -94, 0, 0] references, sum=0

--
messages: 76158
nosy: christian.heimes
priority: deferred blocker
severity: normal
stage: test needed
status: open
title: Reference leaks in Python 3.0rc3
type: resource usage
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4373] Reference leaks in Python 3.0rc3

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

Only distutils and pickle seem to have real leaks.

$ ./python Lib/test/regrtest.py -R:15: test_multiprocessing
test_multiprocessing
beginning 20 repetitions
12345678901234567890

1 test OK.
[124096 refs]

$ ./python Lib/test/regrtest.py -R:15: test_distutils
test_distutils
beginning 20 repetitions
12345678901234567890

test_distutils leaked [144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144] references, sum=2160
1 test OK.
[123507 refs]

$ ./python Lib/test/regrtest.py -R:15: test_httpservers
[...]
test_httpservers leaked [-217, 0, 198, 19, -35, 20, -202, 217, -217,
217, 0, 0, 0, 0, -33] references, sum=-33
1 test OK.
[96060 refs]

$ ./python Lib/test/regrtest.py -R:15: test_pickle
test_pickle
beginning 20 repetitions
12345678901234567890

test_pickle leaked [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
references, sum=15
1 test OK.
[96783 refs]

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4374] Pickle tests fail w/o _pickle extension

2008-11-20 Thread Christian Heimes

New submission from Christian Heimes [EMAIL PROTECTED]:

$ rm build/lib.linux-x86_64-3.0-pydebug/_pickle.so
$ ./python Lib/test/regrtest.py -R:: test_pickle
test_pickle
test test_pickle failed -- Traceback (most recent call last):
  File /home/heimes/dev/python/py3k/Lib/test/pickletester.py, line
1032, in test_bad_init
self.assertRaises(pickle.PicklingError, BadPickler().dump, 0)
  File /home/heimes/dev/python/py3k/Lib/unittest.py, line 311, in
failUnlessRaises
callableObj(*args, **kwargs)
  File /home/heimes/dev/python/py3k/Lib/pickle.py, line 225, in dump
if self.proto = 2:
AttributeError: 'BadPickler' object has no attribute 'proto'

1 test failed:
test_pickle
[59279 refs]

--
components: Extension Modules, Tests
messages: 76160
nosy: christian.heimes
priority: high
severity: normal
stage: needs patch
status: open
title: Pickle tests fail w/o _pickle extension
type: behavior
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4373] Reference leaks in Python 3.0rc3

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

distutils.tests.test_build_ext leaks the references. I think it's
related to the xx module and totally harmless.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4373] Reference leaks in Python 3.0rc3

2008-11-20 Thread Christian Heimes

Christian Heimes [EMAIL PROTECTED] added the comment:

This simple patch doesn't load the 'xx' module more than once in ref
leak tests.

The problem may also be caused by the xxmodule itself. Somebody should
give it a proper review :)

--
keywords: +patch
Added file: http://bugs.python.org/file12086/issue4373_build_ext.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] Patch for segmentation fault in ast_for_atom

2008-11-20 Thread Benjamin Peterson

Benjamin Peterson [EMAIL PROTECTED] added the comment:

Here's an alternative patch which simply calls PyObject_Str on the value
of the exception. It also has a test.

Added file: http://bugs.python.org/file12087/use_PyObject_Str_and_test.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4367] segmentation fault in ast_for_atom

2008-11-20 Thread Benjamin Peterson

Changes by Benjamin Peterson [EMAIL PROTECTED]:


--
title: Patch for segmentation fault in ast_for_atom - segmentation fault in 
ast_for_atom
Added file: http://bugs.python.org/file12088/use_PyObject_Str_and_test2.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com