[issue14565] is_cgi doesn't function as documented for cgi_directories

2012-05-08 Thread Pierre Quentel

Pierre Quentel pierre.quen...@gmail.com added the comment:

Hi Glenn,

My proposal was not about optimization, I just thought that if x==y is 
simpler than if len(x)==len(y) and x==y. Since we don't expect that there 
will be many directories in the list, I don't think optimizing is so important. 
But it doesn't matter to me really, the most important is to have the bug fixed

Can you propose a diff file so that the committers can review it ?

--

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



[issue14748] spwd.getspall() is returning LDAP (non local) users too

2012-05-08 Thread halfie

New submission from halfie assie...@gmail.com:

spwd.getspall() is returning LDAP (non local) users too. 

On RHEL 6.2 machine with LDAP authentication configured, spwd.getspall() 
is returning LDAP (non local) users too. On a similarly configured CentOS 6.2 
machine, spwd.getspall() is returning only local users.

Is spwd.getspall() supposed to return LDAP users? (If yes, this should to 
documented). Why is spwd.getspall() behavior different on different Linux OSes?

--
components: Library (Lib)
messages: 160188
nosy: halfie
priority: normal
severity: normal
status: open
title: spwd.getspall() is returning LDAP (non local) users too
type: behavior
versions: Python 2.6

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

_PyUnicodeWriter in long_to_decimal_string() for example.

 long_to_decimal_string() is already creates a string of known size. How
 _PyUnicodeWriter can help here?

x={}.format(123) uses a temporary buffer for 123. Using
_PyUnicodeWriter even to format 123 would avoid a malloc() and a copy of
the characters.

--

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-08 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 Issue3451 looks much more promising for int formatting. But it will take
 a lot of time to carefully check this.

I disagree:  Issue 3451 is about *asymptotically* fast base conversion, and the 
changes proposed there are only going to kick in for numbers with hundreds of 
digits;  it's not going to affect the common case at all.

--
nosy: +mark.dickinson

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Larry Hastings

New submission from Larry Hastings la...@hastings.org:

skipitem() (in Python/getargs.c) has to be taught about all the format units 
understood by PyArg_Parse.  There's a note at the top of the 
format-unit-understanding code saying

  When you add new format codes,
  please don't forget poor skipitem() below.

Well, someone forgot poor skipitem() when they added 'Z'.

Since this is a bugfix, I assert it should go into 3.2, then get forward-ported 
into trunk.  So, step 1: check the attached one-line patch to 3.2.

Georg: sound good?

--
assignee: larry
components: Interpreter Core
files: larry.skipitem.Z.1.diff
keywords: patch
messages: 160191
nosy: georg.brandl, larry
priority: low
severity: normal
stage: patch review
status: open
title: Add 'Z' to skipitem() in Python/getargs.c
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file25492/larry.skipitem.Z.1.diff

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



[issue14732] PEP 3121 Refactoring applied to _csv module

2012-05-08 Thread Skip Montanaro

Changes by Skip Montanaro s...@pobox.com:


--
nosy:  -skip.montanaro

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



[issue14732] PEP 3121 Refactoring applied to _csv module

2012-05-08 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

 Changes by Éric Araujo mer...@netwok.org:


 --
 nosy: +skip.montanaro

Thanks, but I'm out of the Python development business, except as it
pertains to my day job...

Skip

--
nosy: +skip.montanaro

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Sound good.

--

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-08 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 x={}.format(123) uses a temporary buffer for 123.

This, apparently, is inevitable. I doubt that it is able to considerably
optimize, not worsened str(int) (which is optimal for current
algorithm). Note that the more complex formatting (with width) will
still require the temporary buffer.

Be very careful not to cause regress.

  Using
 _PyUnicodeWriter even to format 123 would avoid a malloc() and a copy of
 the characters.

Fill the ascii buffer and then copying can be cheaper than using
_PyUnicodeWriter with general non-ascii string.

--

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 91612618985b by Larry Hastings in branch '3.2':
Issue #14749: Add support for 'Z' to skipitem() in Python/getargs.c.
http://hg.python.org/cpython/rev/91612618985b

--
nosy: +python-dev

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b32baa5b7626 by Larry Hastings in branch 'default':
Merge from 3.2.  Issue #14749: Add support for 'Z' to skipitem().
http://hg.python.org/cpython/rev/b32baa5b7626

--

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Larry Hastings

Changes by Larry Hastings la...@hastings.org:


--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue14743] on terminating, Pdb debugs itself

2012-05-08 Thread Xavier de Gaye

Xavier de Gaye xdeg...@gmail.com added the comment:

Uploaded a new patch, pdb_botframe_default_2.patch (that applies to
the current tip of the default branch) with:

* a correction to the initial change made to fix sigint_handler()

* the two test cases

--
Added file: http://bugs.python.org/file25493/pdb_botframe_default_2.patch

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Vinay Sajip

New submission from Vinay Sajip vinay_sa...@yahoo.co.uk:

I'm now getting failures to import tkinter on Windows:

C:\Users\Vinay\Projects\scratch..\cpython\PCbuild\python tkhello.py
Traceback (most recent call last):
  File tkhello.py, line 1, in module
from tkinter import *
  File frozen importlib._bootstrap, line 977, in _find_and_load
  File frozen importlib._bootstrap, line 596, in load_module
  File frozen importlib._bootstrap, line 262, in module_for_loader_wrapper
  File frozen importlib._bootstrap, line 484, in _load_module
  File C:\Users\Vinay\Projects\cpython\lib\tkinter\__init__.py, line 36, in 
module
from tkinter import _fix
ImportError: cannot import name _fix

I'm not sure if this is an importlib issue or a tkinter one, but with a recent 
build (30 April) this worked OK. The tkhello.py script is just

from tkinter import *
root = Tk()
w = Label(root, text=Hello, world!)
w.pack()
root.mainloop()

--
components: Library (Lib), Windows
messages: 160198
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
status: open
title: importlib fails with tkinter application on Windows
type: behavior
versions: Python 3.3

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



[issue14749] Add 'Z' to skipitem() in Python/getargs.c

2012-05-08 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

No test?

--
nosy: +benjamin.peterson

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



[issue14732] PEP 3121 Refactoring applied to _csv module

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

PyModule_AddObject steals the value's reference, so you need to INCREF it 
before. Besides that, I don't see any obvious bug, but perhaps Martin wants to 
take a look.

--
nosy: +pitrou
priority: normal - low
stage:  - patch review

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

For the record, the script works fine under Linux.
Vinay, can you bisect and find out which revision introduced the issue?

--
nosy: +brian.curtin, pitrou

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



[issue14748] spwd.getspall() is returning LDAP (non local) users too

2012-05-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +dmalcolm

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



[issue14751] Pdb does not stop at a breakpoint

2012-05-08 Thread Xavier de Gaye

New submission from Xavier de Gaye xdeg...@gmail.com:

When a breakpoint is set in one of the frames of the frame stack, Pdb
may not stop at that breakpoint when the frame does not have a trace
function. This problem is closely related to issue 13183 and issue
14728. The following scenario demonstrates this problem.


   main.py   
import bar

def foo():
bar.bar()
x = 1

foo()
   bar.py  ==
def bar():
pass
=
$ python3 -m pdb main.py 
 /path_to/main.py(1)module()
- import bar
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55) 
[GCC 4.3.2]
(Pdb) break bar.bar
Breakpoint 1 at /path_to/bar.py:1
(Pdb) continue
 /path_to/bar.py(2)bar()
- pass
(Pdb) break main.py:5
Breakpoint 2 at /path_to/main.py:5
(Pdb) continue
The program finished and will be restarted
 /path_to/main.py(1)module()
- import bar
(Pdb) quit
=


The attached patch fixes this problem. A test case is included in the
patch. The patch is made against the proposed fix of issue 14728 (i.e.
assumes this patch is applied), the reason being that self._curframe
must be correctly set. Actually this issue and issue 14728 should
probably be merged.

Note that the trace function does not need anymore to be set in all
the frames of the frame stack in set_trace(), so setting the trace
function has been removed from the while loop.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160202
nosy: xdegaye
priority: normal
severity: normal
status: open
title: Pdb does not stop at a breakpoint
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25494/pdb_default.patch

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



[issue14752] Memleak in typeobject add_methods()

2012-05-08 Thread Damien Cassou

New submission from Damien Cassou damien.cas...@gmail.com:

In add_methods() function from typeobject.c, it looks like Py_DECREF is not 
called where it should be. Please find attached a patch that fixes the leak. 
The patch is also in commit #85a01718b3e3 of my hg repository under the branch 
fix_add_methods_leak.

This bug has been found using Coccinelle (http://coccinelle.lip6.fr/) and a 
dedicated semantic patch (https://gist.github.com/2634899).

--
components: Interpreter Core
files: fix_add_methods_leak.patch
hgrepos: 122
keywords: patch
messages: 160203
nosy: cassou, lemburg, tim_one
priority: normal
severity: normal
status: open
title: Memleak in typeobject add_methods()
type: resource usage
versions: Python 3.4
Added file: http://bugs.python.org/file25495/fix_add_methods_leak.patch

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



[issue9260] A finer grained import lock

2012-05-08 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue14752] Memleak in typeobject add_methods()

2012-05-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset d937b527b76e by Benjamin Peterson in branch '3.2':
fix possible refleak (closes #14752)
http://hg.python.org/cpython/rev/d937b527b76e

New changeset 5319a4bf72e7 by Benjamin Peterson in branch '2.7':
fix possible refleak (closes #14752)
http://hg.python.org/cpython/rev/5319a4bf72e7

New changeset 07b04373aef8 by Benjamin Peterson in branch 'default':
merge 3.2 (#14752)
http://hg.python.org/cpython/rev/07b04373aef8

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

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



[issue9260] A finer grained import lock

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Updated patch against tip. I also changed the internal API of module locks a 
bit (acquire() raises _DeadlockError instead of returning False, and deadlock 
detection is not optional anymore).

--
Added file: http://bugs.python.org/file25496/module_locks8.patch

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



[issue14753] multiprocessing treats negative timeouts differently from before

2012-05-08 Thread Richard Oudkerk

New submission from Richard Oudkerk shibt...@gmail.com:

In version 3.2 and earlier, Process.join() and Connection.poll() treat negative 
timeouts as zero timeouts.  (Thread.join() does the same.)

In the current 3.3 version, they treat negative timeouts as infinite timeouts.  
Also multiprocessing.connection.wait() (new in 3.3) currently treats them as 
infinite on Unix and zero on Windows.

The attached patch fixes the regression with Process.join() and 
Connection.poll().  It also makes wait() treat negative timeouts as zero on 
both Windows and Unix.


It is worth noting that there is a fair amount of inconsistency in the handling 
of negative timeouts in the stdlib in 3.2:

Treat negative as infinite:
select.select
select.*.poll
threading.*.acquire   (new in 3.2)
multiprocessing.dummy.*.acquire   (new in 3.2)

Treat negative as zero:
threading.Thread.join
threading.(Condition|Event).wait
multiprocessing.Process.join
multiprocessing.*.acquire
multiprocessing.(Condition|Event).wait
multiprocessing.Connection.poll
multiprocessing.Queue.(get|put)
concurrent.futures.Future.result
concurrent.futures.wait

Treat negative as error:
queue.Queue.(get|put)
socket.socket.settimeout

--
components: Library (Lib)
files: neg-timeout.patch
keywords: patch
messages: 160206
nosy: pitrou, sbt
priority: normal
severity: normal
stage: patch review
status: open
title: multiprocessing treats negative timeouts differently from before
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file25497/neg-timeout.patch

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Reproduced here as well.

--

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



[issue14754] Emacs configuration to enforce PEP7

2012-05-08 Thread Damien Cassou

New submission from Damien Cassou damien.cas...@gmail.com:

Please find attached a patch that adds an emacs configuration file to enforce 
PEP7. The patch is also in commit #518f2af0a687 of my hg repository under the 
branch emacs-configuration.

--
components: Demos and Tools
files: emacs-configuration-pep7.patch
hgrepos: 123
keywords: patch
messages: 160208
nosy: cassou
priority: normal
severity: normal
status: open
title: Emacs configuration to enforce PEP7
versions: Python 3.4
Added file: http://bugs.python.org/file25498/emacs-configuration-pep7.patch

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



[issue14754] Emacs configuration to enforce PEP7

2012-05-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +georg.brandl

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



[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 I've recently started seeing this failure repeatably on Linux (Ubuntu 
 Jaunty):

The test is newly enabled.  Does repeatably mean you always get the failure?

I have not seen any failures on the Linux buildbots.

--

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



[issue14748] spwd.getspall() is returning LDAP (non local) users too

2012-05-08 Thread Dave Malcolm

Dave Malcolm dmalc...@redhat.com added the comment:

Like passwd and group information, the shadow password entries are pulled 
through libc's Name Service Switch and modules for it, depending on 
configuration.

See man nsswitch.conf.

Hence this is likely to be a configuration difference between the two boxes.  
Some notes from one of my Red Hat colleagues:
* Is a module listed in /etc/nsswitch.conf so that it'll be used to look
  up shadow information?
* Does the module support looking up shadow information?
  The libnss_ldap.so.2 stub from nss-pam-ldapd does; SSSD (at least
  version 1.8.3) doesn't.
* Are there shadowAccount entries in the directory server?
  An IPA server won't have them, because IPA makes use of the directory
  server's built-in password policy functionality to avoid depending on
  clients to enforce aging policies.
* Is the client performing the lookup authorized to read the shadow data
  from the directory server?
* Does the client perform any additional access control?
  The daemon in nss-pam-ldapd only exposes shadow information to
  processes running as UID 0.
etc

Hope this is helpful

--

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



[issue14755] Distutils2 doesn't have a Python 3 version on PyPI

2012-05-08 Thread Nick Wilson

New submission from Nick Wilson n...@njwilson.net:

PyPI only has a version of distutils2 for Python 2, not for Python 3. There is 
an ImportError: No module named ConfigParser when trying to pip install 
distutils2 from Python 3.

--
assignee: eric.araujo
components: Distutils2
messages: 160211
nosy: alexis, eric.araujo, njwilson, tarek
priority: normal
severity: normal
status: open
title: Distutils2 doesn't have a Python 3 version on PyPI

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



[issue14725] test_multiprocessing failure under Windows

2012-05-08 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Matthew Walker

New submission from Matthew Walker matto...@gmail.com:

When initializing a class with an empty dict() object as a default initializer, 
if it is not overridden, multiple instances of the class will share the 
dictionary. IE:

class test(object):
  def __init__(self, obj=dict()):
self.obj = obj

a = test()
b = test()

Then id(a.obj) points to the same location as id(b.obj). The behaviour I would 
expect would be that a.obj and b.obj would be unique instances.

--
components: Interpreter Core
messages: 160212
nosy: Matthew.Walker
priority: normal
severity: normal
status: open
title: Empty Dict in Initializer is Shared Betwean Objects
versions: Python 2.7

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



[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Matthew Walker

Changes by Matthew Walker matto...@gmail.com:


--
type:  - behavior

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



[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This is not a bug, see 
http://docs.python.org/dev/faq/design.html#why-are-default-values-shared-between-objects

--
nosy: +pitrou
resolution:  - invalid
stage:  - committed/rejected

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



[issue14756] Empty Dict in Initializer is Shared Betwean Objects

2012-05-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
status: open - closed

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



[issue14755] Distutils2 doesn't have a Python 3 version on PyPI

2012-05-08 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

This comes from the fact that d2 is developed with two Mercurial branches, not 
build-time 2to3 conversion (which I dislike as ugly and not fully correct) nor 
single-source (which I dislike as ugly and hard to maintain :). PyPI does not 
work well with that workflow; see how unittest2 had to use a unittest2py3k 
project name. I think pip does the right thing if you upload 
project-X.Y-py3.tar.gz, I need to check that and if it works do a manual upload 
of 1.0a4-py3.

--
versions: +3rd party

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



[issue10765] Build regression from automation changes on windows

2012-05-08 Thread Martin

Martin gzl...@googlemail.com added the comment:

Yes, this is still reproducible. For instance, by:

 hg clone -b default 3.3 feature branch
 cd feature branch/PCbuild
 call build_env.bat
 call build.bat

It seems python33.dll now does get created so it's less severe, but the 
python3dll still fails due to the makefile OutDir not being quoted:

NMAKE : fatal error U1073: don't know how to make 'branch\PCbuild\'

--
versions: +Python 3.3

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread stefan brunthaler

New submission from stefan brunthaler s.bruntha...@uci.edu:

The attached patch adds quickening based inline caching (INCA) to the CPython 
3.3 interpreter. It uses a code generator to generate instruction derivatives 
using the mako template engine, and a set of utility functions to enable 
automatic and safe quickening.

The code generator itself resides in cgen and the generated files reside in 
Python/opt/gen. Auxiliary files resides in Python/opt and only minor 
changes are necessary in ceval.c and places where type feedback is possible 
(mostly in abstract.c and object.c)

Details of the technique have been published (see my home page: 
http://www.ics.uci.edu/~sbruntha/.) 

On my machine (i7-920 with Intel Turbo Boost disabled) this results in average 
arithmetic speedups of 1.47 over the vanilla interpreter without threaded 
code/computed gotos, and 1.13 over an interpreter with threaded code/computed 
gotos enabled. (Maximal speedups are 1.61 over the vanilla interpreter and 1.17 
over the threaded code interpreter.) The optimized interpreter uses 206 
instructions which currently only cover the standard library, i.e., there is 
still ample space left for optimized instruction derivatives for popular 
applications/libraries, such as NumPy or Django.

Furthermore, based on the purely interpretative nature of the technique, there 
are no compatibility implications (modulo libraries/modules relying on concrete 
opcode values---I would guess that such code is rather unlikely, but one never 
knows...) Additional memory overhead is minimal, too, since the technique only 
requires space for the new derivatives and is something along the lines of 
80-100 KiB.

--
components: Interpreter Core
files: 20120508-inca.patch
hgrepos: 124
keywords: patch
messages: 160216
nosy: sbrunthaler
priority: normal
severity: normal
status: open
title: INCA: Inline Caching meets Quickening in Python 3.3
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25499/20120508-inca.patch

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I think it would have been better to keep the ExFileObject class, and base it 
on io.BufferedReader:

class ExFileObject(io.BufferedReader):
def __init__(self, tarfile, tarinfo):
raw = _FileInFile(tarfile.fileobj,
  tarinfo.offset_data,
  tarinfo.size,
  tarinfo.sparse)
io.BufferedReader.__init__(self, raw)

The result is the same of course, but there is no need to special-case the 
pre-3.3 API.
In addition, _FileInFile could probably inherit from io.RawIOBase.

--
nosy: +amaury.forgeotdarc

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

I went back a fair way, and the failure still keeps happening. So now I'm 
wondering - is a Tk app *supposed* to work from a source build?

I've verified that the test script works OK when run from an installed Python.

So, this issue may be invalid, if we don't care about running Tk apps from a 
source build (if so, sorry for the noise) - or if we do care, then it's not an 
importlib issue, but Tk-related (I'm not a Tk expert by any means, so I'm not 
sure what needs to be done to make a Tk app work from a source build).

--

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I went back a fair way, and the failure still keeps happening. So now
 I'm wondering - is a Tk app *supposed* to work from a source build?

Does it work with 3.2?
Did you try debugging at the prompt? e.g. looking what tkinter.__file__
is, etc.

--

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



[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Does repeatably mean you always get the failure?

Yes, every time. The first symptom is always a ConnectionRefusedError.

 I have not seen any failures on the Linux buildbots.

I'm running a fairly old version of Ubuntu, which might be relevant, or it may 
be that the connection is being refused because it's clashing with something 
else just on the test machine. In general this machine is just used for Python 
builds and tests, but I do run some services (e.g. Jenkins). Or it might be a 
race condition - the test machine is a VM and does have somewhat different 
timing characteristics from those of real hardware.

--

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



[issue14754] Emacs configuration to enforce PEP7

2012-05-08 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

As much as I like Emacs, I don't think it is special enough to warrant a 
special file in the root directory.

Editor-specific directories in Misc/ are fine, and you can put instructions 
there how to add your own .dir-locals.el, and we can even add this to .hgignore 
if requested, but not more.

--
resolution:  - rejected
status: open - closed

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread Dave Malcolm

Changes by Dave Malcolm dmalc...@redhat.com:


--
nosy: +dmalcolm

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

This looks quite impressive, so sorry for immediately jumping in with
criticism. -- I've benchmarked the things I worked on, and I can't see
any speedups but some significant slowdowns. This is on 64-bit Linux
with a Core 2 Duo, both versions compiled with just `./configure  make`:


Modules/_decimal/tests/bench.py:


Not much change for floats and decimal.py, 8-10% slowdown for _decimal!


Telco benchmark [1]:


4% slowdown.


Memoryview:
---

./python -m timeit -n 1000 -s x = memoryview(bytearray(b'x'*1)) 
x[:100]

17% (!) slowdown.


Did I perhaps miss some option to turn on the optimizations?



[1] http://www.bytereef.org/mpdecimal/quickstart.html#telco-benchmark

--
nosy: +skrah

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



[issue14750] importlib fails with tkinter application on Windows

2012-05-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

 Does it work with 3.2?

I'm not able to build 3.2 - make_buildinfo fails, seemingly because it can't 
find some Subversion-related files. I'll keep looking into it.

--

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread stefan brunthaler

stefan brunthaler s.bruntha...@uci.edu added the comment:

 This looks quite impressive, so sorry for immediately jumping in with
 criticism. -- I've benchmarked the things I worked on, and I can't see
 any speedups but some significant slowdowns. This is on 64-bit Linux
 with a Core 2 Duo, both versions compiled with just `./configure  make`:

Well, no problem -- I don't actually consider it criticism at all.
Build is correct, you could verify the interpreter working adequatly
by running the test suite and seeing some tests depending on specific
bytecodes fail (test_dis, and test_importlib, AFAIR).

I don't have a Core 2 Duo available for testing, though.

 Modules/_decimal/tests/bench.py:
 

 Not much change for floats and decimal.py, 8-10% slowdown for _decimal!

This result is not unexpected, as I have no inline cached versions of
functions using this module. The derivatives I generate work for Long,
Float and Complex numbers (plus Unicode strings and some others.) If
there is a clear need, of course I can look into that and add these
derivatives (as I said, there are still some 40+ opcodes unused.)

 Memoryview:
 ---

 ./python -m timeit -n 1000 -s x = memoryview(bytearray(b'x'*1)) 
 x[:100]

 17% (!) slowdown.

Hm, the 17% slowdown seems strange to me. However, I don't expect to
see any speedups in this case, as there is no repeated execution
within the benchmark code that could leverage type feedback via inline
caching.

You should see most speedups when dealing with for-loops (as FOR_ITER
has optimized derivatives), if-statements (COMPARE_OP has optimized
derivatives), and mathematical code. In addition there are some
optimizations for frequently executed function calls, unpacked
sequences, etc. Note: frequent as in how I encountered them, probably
this needs adjustments for different use cases.

 Did I perhaps miss some option to turn on the optimizations?

Does not seem to be the case, but if you could verify running the
regression tests we could easily eliminate this scenario. You could
verifiy speedups, too, on computer language benchmark game benchmarks,
primarily binarytrees, mandelbrot, nbody and spectralnorm, just to see
how much you *should* gain on your machine. Testing methodology could
also make a difference. I use the following:
- Linux 3.0.0-17 (Ubuntu)
- gcc version 4.6.1
- nice -n -20 to minimize scheduler interference
- 30 repetitions per benchmark

I hope that helps/explains,
regards,
--stefan

--

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-08 Thread Ivan Sergeev

New submission from Ivan Sergeev vserg...@gmail.com:

The SMTPServer class of the smtpd module creates a server socket with the IPv4 
socket.AF_INET address family hardcoded, and this prevents it from later 
binding to an IPv6 local address.

This occurs on line 282 of smtpd.py for the Python 2.7 branch:
http://hg.python.org/cpython/file/5319a4bf72e7/Lib/smtpd.py#l282

And on line 435 of smtpd for the Python 3.2 branch ( Lib/smtpd.py:435 ):
http://hg.python.org/cpython/file/d937b527b76e/Lib/smtpd.py#l435

One IPv4/IPv6 agnostic solution is to look up provided local address with 
getaddrinfo(), and use one of the result's address family, socket type and 
address tuple for create_socket() and bind() at those lines:

...
try:
gai_results = socket.getaddrinfo(localaddr[0], localaddr[1])
self.create_socket(gai_results[0][0], gai_results[0][1])
# try to re-use a server port if possible
self.set_reuse_addr()
self.bind(gai_results[0][4])
self.listen(5)
...

--
components: Library (Lib)
messages: 160226
nosy: vsergeev
priority: normal
severity: normal
status: open
title: SMTPServer of smptd does not support binding to an IPv6 address
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 3d900c9641c9 by Richard Oudkerk in branch 'default':
Issue #14727: Fix race in test_multiprocessing
http://hg.python.org/cpython/rev/3d900c9641c9

--
nosy: +python-dev

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



[issue5945] PyMapping_Check returns 1 for lists

2012-05-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - needs patch

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



[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

I found a race where a connection attempt could happen before the listening 
socket's listen() method was called.

Vinay, could you update and try again please.

--

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



[issue14757] INCA: Inline Caching meets Quickening in Python 3.3

2012-05-08 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

  Modules/_decimal/tests/bench.py:
  
 
  Not much change for floats and decimal.py, 8-10% slowdown for _decimal!
 
 This result is not unexpected, as I have no inline cached versions of
 functions using this module. The derivatives I generate work for Long,
 Float and Complex numbers (plus Unicode strings and some others.)

But I couldn't detect a speedup for either float or int in bench.py. Also,
in perf.py I'm consistently getting slower results for float with the patch.

 there is a clear need, of course I can look into that and add these
 derivatives (as I said, there are still some 40+ opcodes unused.)

I'd say that the minimum requirement for a performance enhancement
patch is that there aren't any slowdowns. :)

I'm getting a 9% speedup for mandelbrot and an 18% speedup for spectralnorm.
That's nice, but many benchmarks that Antoine and I have posted show
slowdowns of 15-18%.

--

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



[issue14750] Tkinter application doesn't run from source build on Windows

2012-05-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

The test script works if tcl85.dll and tk85.dll are copied into the build 
directory. This can be done using a small batch file and the XML

Tool
Name=VCPostBuildEventTool
CommandLine=copy_tcl $(tcltkDir)\bin
/

added to each build configuration in PCbuild\_tkinter.vcproj (can be added 
through the UI, of course).

--
components: +Tkinter
keywords: +needs review, patch
nosy: +gpolo -brett.cannon
stage:  - patch review
title: importlib fails with tkinter application on Windows - Tkinter 
application doesn't run from source build on Windows
Added file: http://bugs.python.org/file25500/copy_tcl.bat

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



[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

test_multiprocessing now passes. Thanks for the quick turnaround.

--
assignee:  - sbt
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-08 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +giampaolo.rodola, r.david.murray
stage:  - needs patch
type: behavior - enhancement
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.4

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



[issue14735] Version 3.2.3 IDLE CTRL-Z plus Carriage Return to end does not work

2012-05-08 Thread Roger Serwy

Changes by Roger Serwy roger.se...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file25501/ctrl_z_doc.patch

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-08 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Agreed. The only problem I see is that unit tests rely on a mock socket object 
and should be rewritten by using an actual socket.

--

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



[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Indeed, even though it is not a documented API, our backward compatibility 
policy pretty much requires that something named ExFileObject still exist, just 
in case.  And in this case it probably should still be the thing returned.

--
nosy: +r.david.murray
status: closed - open

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



[issue14758] SMTPServer of smptd does not support binding to an IPv6 address

2012-05-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I don't think it is necessary to rewrite the existing tests, just add some that 
test the socket functionality.

--

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-08 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

 Fill the ascii buffer and then copying can be cheaper than using
 _PyUnicodeWriter with general non-ascii string.

Here is a new patch using _PyUnicodeWriter directly in longobject.c.

According to my benchmark (see below), formating a small number (5 decimal 
digits) is 17% faster with my patch version 2 compared to tip, and 38% faster 
compared to Python 3.3 before my optimizations on str%tuples or str.format(). 
Creating a temporary PyUnicode is not cheap, at least for short strings.

str%tuple and str.format() allocates len(format_string)+100 ASCII characters at 
the beginning, which is enough for x={}.format(12345) for example. So only a 
resize is needed, and it looks like resizing is cheap.

I'm not completly satisfied of the usage of Py_LOCAL_INLINE in unicodeobject.c 
for _PyUnicodeWriter methods. The same hacks (?) should be used in 
formatter_unicode.c.

Shell script (bench.sh) used to benchmark:

echo -n {0}.{1}.{2}: ; ./python -m timeit -r 10 -s 'fmt={0}.{1}.{2}' 
'fmt.format(http, client, HTTPConnection)'
echo -n  [line {0:2d}] : ; ./python -m timeit -r 10 -s 'fmt= [line {0:2d}] 
' 'fmt.format(5)'
echo -n str: ; ./python -m timeit -r 10 -s 'fmt={0}*100' 
'fmt.format(ABCDEF)'
echo -n str conv: ; ./python -m timeit -r 10 -s 'fmt={0:s}*100' 
'fmt.format(ABCDEF)'
echo -n long x 3: ; ./python -m timeit -r 10 -s 'fmt=x={0} x={0} x={0}' 
'fmt.format(12345)'
echo -n float x 3: ; ./python -m timeit -r 10 -s 'fmt=x={0} x={0} x={0}' 
'fmt.format(12.345)'
echo -n complex x 3: ; ./python -m timeit -r 10 -s 'fmt=x={0} x={0} x={0}' 
'fmt.format(12.345+2j)'
echo -n long, float, complex: ; ./python -m timeit -r 10 -s 'fmt=x={} y={} 
z={}' 'fmt.format(12345, 12.345, 12.345+2j)'
echo -n huge long: ; ./python -m timeit -r 10 -s 'import math; 
huge=math.factorial(2000); fmt=x={}' 'fmt.format(huge)'


Results:

3.3:

{0}.{1}.{2}: 100 loops, best of 10: 0.394 usec per loop
 [line {0:2d}] : 100 loops, best of 10: 0.519 usec per loop
str: 10 loops, best of 10: 7.01 usec per loop
str conv: 10 loops, best of 10: 13.3 usec per loop
long x 3: 100 loops, best of 10: 0.569 usec per loop
float x 3: 100 loops, best of 10: 1.62 usec per loop
complex x 3: 10 loops, best of 10: 3.34 usec per loop
long, float, complex: 10 loops, best of 10: 2.08 usec per loop
huge long: 1000 loops, best of 10: 666 usec per loop

3.3 + format_writer.patch :

{0}.{1}.{2}: 100 loops, best of 10: 0.412 usec per loop (+5%)
 [line {0:2d}] : 100 loops, best of 10: 0.461 usec per loop (-11%)
str: 10 loops, best of 10: 6.85 usec per loop (-2%)
str conv: 10 loops, best of 10: 11.1 usec per loop (-17%)
long x 3: 100 loops, best of 10: 0.605 usec per loop (+6%)
float x 3: 100 loops, best of 10: 1.57 usec per loop (-3%)
complex x 3: 10 loops, best of 10: 3.54 usec per loop (+6%)
long, float, complex: 10 loops, best of 10: 2.19 usec per loop (+5%)
huge long: 1000 loops, best of 10: 665 usec per loop (0%)

3.3 + format_writer-2.patch :

{0}.{1}.{2}: 100 loops, best of 10: 0.378 usec per loop (-4%)
 [line {0:2d}] : 100 loops, best of 10: 0.454 usec per loop (-13%)
str: 10 loops, best of 10: 6.18 usec per loop (-12%)
str conv: 10 loops, best of 10: 10.9 usec per loop (-18%)
long x 3: 100 loops, best of 10: 0.471 usec per loop (-17%)
float x 3: 100 loops, best of 10: 1.37 usec per loop (-15%)
complex x 3: 10 loops, best of 10: 3.4 usec per loop (+2%)
long, float, complex: 100 loops, best of 10: 1.93 usec per loop (-7%)
huge long: 1000 loops, best of 10: 665 usec per loop (0%)


--
Added file: http://bugs.python.org/file25502/format_writer-2.patch

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



[issue10765] Build regression from automation changes on windows

2012-05-08 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

As there is an easy work-around (just don't use spaces in directory names), I 
still consider this issue as irrelevant as two years ago.

--

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



[issue14759] Berkeley DB License conditions are onerous (and poorly documented)

2012-05-08 Thread Jeff Laing

New submission from Jeff Laing jeffla...@gmail.com:

As part of an audit of license compliance, I was looking at the terms in the 
LICENSE.txt that describe the Berkeley DB product.  I had thought this would be 
under the standard Berkeley license, but Oracle have added their own zinger.

* 3. Redistributions in any form must be accompanied by information on
*how to obtain complete source code for the DB software and any
*accompanying software that uses the DB software.  The source code
*must either be included in the distribution or be available for no
*more than the cost of distribution plus a nominal fee, and must be
*freely redistributable under reasonable conditions.  

So, my application, which embeds Python (rather than running it as python.exe) 
and includes the standard runtime library, must distribute my source code.

This page:

http://mail.python.org/pipermail/python-dev/2008-September/082316.html

suggests that this is not the case for regular Python, but it makes no 
statement about embedding.  Sadly the Oracle page it links to suggesting this 
is not an issue, does not exist.

The general License page on the Python websites makes no reference whatsoever 
to Berkeley DB license obligations.

I note that there are other modules mentioned on the Licenses webpage that are 
not in the LICENSES.txt file, and vice versa.  I have no idea whether this is 
deliberate, or an oversight.

--
assignee: docs@python
components: Documentation
messages: 160238
nosy: Jeff.Laing, docs@python
priority: normal
severity: normal
status: open
title: Berkeley DB License conditions are onerous (and poorly documented)
type: enhancement
versions: Python 2.7

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



[issue14759] Berkeley DB License conditions are onerous (and poorly documented)

2012-05-08 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Berkeley DB is no longer part of Python3, so I'm doubtful that this is going to 
be addressed.  If it is addressed, it would have to be by the PSF rather than 
the developers, since the PSF is responsible for licensing issues.  If you wish 
to pursue this I suggest emailing p...@python.org.

I'm going to close this ticket since there is nothing the developers can do 
about it.

--
nosy: +r.david.murray
stage:  - committed/rejected
status: open - closed

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



[issue14759] Berkeley DB License conditions are onerous (and poorly documented)

2012-05-08 Thread Jeff Laing

Jeff Laing jeffla...@gmail.com added the comment:

With all due respect, I think that the 2.7.3 License Page is still being 
actively used by people as a reference, and it should be accurate. I agree that 
the code developers can't do anything, but the documentation for all releases, 
particularly in such a sensitive area as licensing, should be as up to date as 
possible.

Similarly, the 3.0 License page talks about a _random module which presumably 
is going ahead.  It has a license agreement displayed on the web page but I did 
not see that text copied into the regular LICENSE.txt that is part of the 
Python3 distribution, and that I assume meets the supporting documentation 
clause that all the module licenses seem to demand.

Ditto socket.
Ditto asyncore and asynchat.
Ditto Cookie.
Ditto trace.
Ditto xmlrpclib.
etcetera.

I agree this is all a documentation exercise - perhaps there is another bug 
tracker I should be reporting it in?

--

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



[issue13210] Support Visual Studio 2010

2012-05-08 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

The tip of the vs2010 branch now works just as well as default does. There are 
no outstanding test failures that aren't seen on default -- test_email still 
fails for some line ending stuff, but that's not relevant here.

Attached is a patch showing just the code changes, including Kristjan's SXS 
patch, support in Tools\msi\msi.py for VS2010, and a few small distutils and 
packaging version adjustments to work with VS2010.

--
keywords: +needs review
stage:  - patch review
Added file: http://bugs.python.org/file25503/code_changes2.diff

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



[issue13210] Support Visual Studio 2010

2012-05-08 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Attached is full_vs2010_port.diff. It's 13000 lines, mostly taken up by the 
conversion of project, filter, and solution files - tons of XML.

--
Added file: http://bugs.python.org/file25504/full_vs2010_port.diff

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



[issue13210] Support Visual Studio 2010

2012-05-08 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Strange that you had to edit packaging.compiler.msvc9compiler but not the same 
module in distutils.

--

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



[issue14744] Use _PyUnicodeWriter API in str.format() internals

2012-05-08 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 According to my benchmark (see below), formating a small number (5
 decimal digits) is 17% faster with my patch version 2 compared to tip,
 and 38% faster compared to Python 3.3 before my optimizations on str%
 tuples or str.format(). Creating a temporary PyUnicode is not cheap,
 at least for short strings.

A 17% improvement on a micro-benchmark is not much. There will probably
be no visible difference in real-world code.

Also, if creating temporary PyUnicodes is not cheap, perhaps we could
have a freelist for them?

--

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