[issue14738] Amazingly faster UTF-8 decoding

2012-05-12 Thread STINNER Victor

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

If the commit makes Python 3.3 faster than Python 3.2, it is an
optimisation that should be documented in the What's New in Python 3.3
document.

--

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



[issue14786] htmlparser with tag br

2012-05-12 Thread Yugang LIU

New submission from Yugang LIU liu...@yahoo.cn:

Hi,

I parse html source with htmlparser. I catch a tag, br, issue. 

my code :
div
br
/div
parse result:
begin tag: div
begin tag: br
end tag: div

So I can't find end tag of 'br'. I know it is invalid text, 'br', it set 
htmlparser parameter, strict, to 'False', it can't help me also. 

Please help fix it. Thanks.

--
components: None
messages: 160463
nosy: liuyug
priority: normal
severity: normal
status: open
title: htmlparser with tag br
versions: Python 3.2

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



[issue14787] pkgutil.walk_packages returns extra modules

2012-05-12 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

pkgutil.walk_packages(paths) seems to return incorrect results when the name of 
a subpackage of a path in paths matches the name of a package in the standard 
library.  It both excludes modules it should include, and includes modules it 
should exclude.  Here is an example:

 mkdir temp
 touch temp/__init__.py
 touch temp/foo.py
 mkdir temp/logging
 touch temp/logging/__init__.py
 touch temp/logging/bar.py
 python
Python 3.2.3 (default, Apr 29 2012, 01:19:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.

 from pkgutil import walk_packages
 for info in walk_packages(['temp']):
...   print(info[1], info[0].path)
... 
foo temp
logging temp
logging.config 
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/logging
logging.handlers 
/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/logging
 

Observe that logging.bar is absent from the list, and logging.config and  
logging.handlers are included.

--
components: Library (Lib)
messages: 160464
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: pkgutil.walk_packages returns extra modules
type: behavior
versions: Python 2.7, Python 3.2

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



[issue7317] Display full tracebacks when an error occurs asynchronously

2012-05-12 Thread alon horev

alon horev alo...@gmail.com added the comment:

how does one get his patch reviewed? (it's been 6 months)

--

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



[issue14588] PEP 3115 compliant dynamic class creation

2012-05-12 Thread Daniel Urban

Daniel Urban urban.dani...@gmail.com added the comment:

Here is my first attempt at creating a pure Python version of the 
operator.build_class function (in my previous patch) as types.new_class.

The three added functions (two private and one public) correspond to the 
following functions in my previous patch:
types.new_class - operator.build_class
types._prepare_ns - prepare_namespace in typeobject.c
types._calculate_mcls - calculate_metaclass in typeobject.c (currently 
_PyType_CalculateMetaclass)
(In Python these functions are quite short, so they may be merged. But this 
separation may be better for documentation purposes...)

The tests are mostly the same as in my previous patch.

--
components: +Library (Lib)
Added file: http://bugs.python.org/file25546/types_new_class.patch

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



[issue14788] Pdb debugs itself after ^C and a breakpoint is set anywhere

2012-05-12 Thread Xavier de Gaye

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

When a breakpoint is set anywhere (in which case the global system's
trace function is set), interrupting the debuggee causes Pdb to stop
into its own code. See the following pdb session run with python on
the current head of the default branch from the repo.

===   main.py   =
import time
def bar():
i = 1
while i:
time.sleep(.100)

bar()
=
$ python -m pdb main.py
 /path_to/main.py(1)module()
- import time
(Pdb) import sys; print(sys.version)
3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15) 
[GCC 4.3.2]
(Pdb) break bar
Breakpoint 1 at /path_to/main.py:2
(Pdb) continue
 /path_to/main.py(3)bar()
- i = 1
(Pdb) continue
^C
Program interrupted. (Use 'cont' to resume).
--Call--
 /home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(212)set_trace()
- def set_trace(self, frame=None):
(Pdb) where
  /home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(405)run()
- exec(cmd, globals, locals)
  string(1)module()
  /path_to/main.py(7)module()
- bar()
  /path_to/main.py(5)bar()
- time.sleep(.100)
  /home/xavier/src/cpython/cpython-hg-default/Lib/pdb.py(196)sigint_handler()
- self.set_trace(frame)
 /home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(212)set_trace()
- def set_trace(self, frame=None):
(Pdb) quit
=


The attached patch fixes the problem and includes a test case. This
fix is the same as the one proposed at issue 14743 to fix another
problem, except that the set_step call is moved at the end of the
sigint_handler method for the sake of robustness.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160467
nosy: xdegaye
priority: normal
severity: normal
status: open
title: Pdb debugs itself after ^C and a breakpoint is set anywhere
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file25547/pdb_default.patch

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



[issue12029] Catching virtual subclasses in except clauses

2012-05-12 Thread George-Cristian Bîrzan

George-Cristian Bîrzan gcbir...@gmail.com added the comment:

As promissed the patch. It doesn't break any tests, and it passes the ones I 
added. I have a pybench one as well, which even though trivial, does point to 
the fact that there is a degradation in performance, but not sure it's worth 
posting here.

--
keywords: +patch
Added file: http://bugs.python.org/file25548/issue12029.patch

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



[issue14787] pkgutil.walk_packages returns extra modules

2012-05-12 Thread Gennadiy Zlobin

Gennadiy Zlobin gennad.zlo...@gmail.com added the comment:

I confirm this behavior in 2.7 and 3.2 versions. In my 3.3.0a3+ it actually 
outputs nothing.
Also note that if you rename logging to logging2, you actually get

foo temp
logging2 temp

--
nosy: +gennad
versions: +Python 3.3

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



[issue14789] after continue, Pdb stops at a line without a breakpoint

2012-05-12 Thread Xavier de Gaye

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

In the following test run with python on the current head of the
default branch, Pdb stops at line 3 where there is no breakpoint after
two breakpoints have been set on the same function (setting two bps on
the same location is useful, for example one bp to print a value without
stopping and the other one with an ignore count).

===   main.py   =
def bar():
x = 1
x = 2

bar()
=
$ python -m pdb main.py 
 /path_to/main.py(1)module()
- def bar():
(Pdb) import sys; print(sys.version)
3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15) 
[GCC 4.3.2]
(Pdb) break bar
Breakpoint 1 at /path_to/main.py:1
(Pdb) break bar
Breakpoint 2 at /path_to/main.py:1
(Pdb) continue
 /path_to/main.py(2)bar()
- x = 1
(Pdb) continue
 /path_to/main.py(3)bar()
- x = 2
(Pdb) quit
=

The attached patch fixes the problem. This patch also fixes the
following problems that are caused by the same bug:

* when more than one breakpoint is set on the same line, only the
  command of the first effective breakpoint is run, and only the
  hit count and the ignore count of the first effective breakpoint
  are updated

The patch includes a test case for all those problems.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160470
nosy: xdegaye
priority: normal
severity: normal
status: open
title: after continue, Pdb stops at a line without a breakpoint
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25549/pdb_default.patch

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



[issue14187] add function annotation entry to Glossary

2012-05-12 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

I agree with Raymond that last paragraph should be removed; +1 for the 
remaining part

--
nosy: +sandro.tosi

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



[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-05-12 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

 It would be nice if the documentation of fwalk() explained why you would
 want to use it over walk().

How does the attached patch look?

--
Added file: http://bugs.python.org/file25550/fwalk-doc.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13734
___diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2356,6 +2356,9 @@
*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output,
and *dirfd* is a file descriptor referring to the directory *dirpath*.
 
+   It can be used, for example, to walk a directory tree in a way that is
+   immune to symlink attacks.
+
.. note::
 
   Since :func:`fwalk` yields file descriptors, those are only valid until
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1635217] Add example of distutils setup() with requires argument

2012-05-12 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

I still need requires example - here. 
http://docs.python.org/distutils/setupscript.html#relationships-between-distributions-and-packages
 - after Dependencies.. paragraph. =)

setup(...,
  requires=[somepackage (1.0, !=1.5)],
  provides=[mypkg (1.1)]
  )

--
status: closed - open

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-12 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

I'm not sure we really need to check for a dangling symlink in case of 
FileNotFoundError: whether it's a dangling symlink, or the file disappeared 
in-between-, skipping it is OK.

--

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



[issue14790] use packaging in setup.py

2012-05-12 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

setup.py should use packaging, not distutils.

--
components: Build
messages: 160475
nosy: eric.araujo, pitrou, tarek
priority: normal
severity: normal
status: open
title: use packaging in setup.py
type: enhancement
versions: Python 3.3

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



[issue14790] use packaging in setup.py

2012-05-12 Thread Éric Araujo

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

I’d rather wait for a more stable version, so 3.4.

--
versions: +Python 3.4 -Python 3.3

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



[issue14790] use packaging in setup.py

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

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

I'd rather not wait. If packaging is not able to reliably build Python itself, 
we shouldn't release Python 3.3 until it is (or withdraw packaging from the 
standard library altogether).

--
nosy: +loewis

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



[issue14790] use packaging in setup.py

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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
versions: +Python 3.3 -Python 3.4

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



[issue14790] use packaging in setup.py

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

Changes by Martin v. Löwis mar...@v.loewis.de:


--
priority: normal - release blocker

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



[issue14791] setup.py only adds /prefix/lib, not /prefix/lib64

2012-05-12 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

setup.py adds prefix/lib to the list of directories where libraries are 
looked for, but not prefix/lib64. Patch attached.

--
components: Build
files: setup_lib64.patch
keywords: patch
messages: 160478
nosy: dmalcolm, pitrou
priority: low
severity: normal
stage: patch review
status: open
title: setup.py only adds /prefix/lib, not /prefix/lib64
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25551/setup_lib64.patch

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



[issue14790] use packaging in setup.py

2012-05-12 Thread Antoine Pitrou

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

 I'd rather not wait. If packaging is not able to reliably build Python
 itself, we shouldn't release Python 3.3 until it is (or withdraw
 packaging from the standard library altogether).

Indeed, this is exactly the reason I entered this enhancement request.
Eating our own dogfood is a good way of detecting issues :)

--

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



[issue14785] Add sys._debugmallocstats()

2012-05-12 Thread Antoine Pitrou

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

Nice idea. I don't see any obvious problem with the patch, except that the test 
should reuse test.script_helper.assert_python_ok().

--
nosy: +pitrou

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



[issue14786] htmlparser with tag br

2012-05-12 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

The HTML you pasted looks valid to me -- the br element doesn't have an end tag 
and the HTML 4.01 standard explicitly says Start tag: required, End tag: 
forbidden [0].
Why do you think this is a problem?

[0]: http://www.w3.org/TR/html401/struct/text.html#edef-BR

--
assignee:  - ezio.melotti
components: +Library (Lib) -None
nosy: +ezio.melotti
resolution:  - invalid

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



[issue14790] use packaging in setup.py

2012-05-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue1294959] Problems with /usr/lib64 builds.

2012-05-12 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

I currently think that sys.libdir should be only basename of libdir (e.g. lib 
or lib64) to allow to easily use it with something else than sys.prefix.

--

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



[issue14791] setup.py only adds /prefix/lib, not /prefix/lib64

2012-05-12 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

It would be better to fix issue #1294959 and use os.path.join(sys.prefix, 
sys.libdir).
IIRC some mips architectures need /usr/lib32, while x32 architecture needs 
/usr/libx32.

--
nosy: +Arfrever

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



[issue14082] shutil doesn't copy extended attributes

2012-05-12 Thread Roundup Robot

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

New changeset 85824b819bcb by Antoine Pitrou in branch 'default':
Issue #14082: shutil.copy2() now copies extended attributes, if possible.
http://hg.python.org/cpython/rev/85824b819bcb

--
nosy: +python-dev

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



[issue14082] shutil doesn't copy extended attributes

2012-05-12 Thread Antoine Pitrou

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

Pushed now. Hopefully the buildbots won't moan.

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

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



[issue14784] Re-importing _warnings changes warnings.filters

2012-05-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-12 Thread Thomas Kluyver

Thomas Kluyver tak...@gmail.com added the comment:

Here's a patch that makes UTF8_STRING the default type for clipboard_get and 
selection_get when running in X11.

--
keywords: +patch
Added file: http://bugs.python.org/file25552/x11-clipboard-utf8.patch

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



[issue14082] shutil doesn't copy extended attributes

2012-05-12 Thread Antoine Pitrou

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

Looks like we have our first buildbot failure:


==
FAIL: test_copyxattr (test.test_shutil.TestShutil)
--
Traceback (most recent call last):
  File 
/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/test/test_shutil.py, line 
346, in test_copyxattr
self.assertEqual(['user.bar'], os.listxattr(dst))
AssertionError: Lists differ: ['user.bar'] != ['security.selinux', 'user.bar...

First differing element 0:
user.bar
security.selinux

Second list contains 1 additional elements.
First extra element 1:
user.bar

- ['user.bar']
+ ['security.selinux', 'user.bar']

--
status: closed - open

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-12 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

But if it is a dangling symlink, you want to add it to nondirs while missing 
files could be skipped, no? You can't skip dangling symlinks if you want to 
implement rmtree. The normal walk() doesn't too.

--

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



[issue14792] setting a bp on current function, Pdb stops at next line although no bp

2012-05-12 Thread Xavier de Gaye

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

Setting a breakpoint on a function from within that functions makes
pdb to stop at the following line (where no breakpoint is set) after a
continue command. In the following test pdb stops at line 3 where
there is no breakpoint.


===   main.py   =
def foo():
x = 1
x = 2

foo()
=
$ python -m pdb main.py
 /path_to/main.py(1)module()
- def foo():
(Pdb) import sys; print(sys.version)
3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15) 
[GCC 4.3.2]
(Pdb) break 2
Breakpoint 1 at /path_to/main.py:2
(Pdb) continue
 /path_to/main.py(2)foo()
- x = 1
(Pdb) break foo
Breakpoint 2 at /path_to/main.py:1
(Pdb) continue
 /path_to/main.py(3)foo()
- x = 2
(Pdb) where
  /home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(405)run()
- exec(cmd, globals, locals)
  string(1)module()
  /path_to/main.py(5)module()
- foo()
 /path_to/main.py(3)foo()
- x = 2
(Pdb) quit
=

The attached patch fixes the problem. The patch includes a test case.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160489
nosy: xdegaye
priority: normal
severity: normal
status: open
title: setting a bp on current function, Pdb stops at next line although no bp
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25553/pdb_default.patch

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



[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-05-12 Thread Benjamin Peterson

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

2012/5/12 Charles-François Natali rep...@bugs.python.org:

 Charles-François Natali neolo...@free.fr added the comment:

 It would be nice if the documentation of fwalk() explained why you would
 want to use it over walk().

 How does the attached patch look?

Okay, but explain what a symlink attack is.

--

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



[issue14672] Windows installer: add desktop shortcut(s)

2012-05-12 Thread Daniel Swanson

Daniel Swanson popcorn.tomato.d...@gmail.com added the comment:

What's the start menu?
hahaha
I think that this issue is pointless, it takes 3 clicks to make a desktop 
shortcut (if have a lot of programs on your computer, maybe 4) any Windows user 
should know how to do it.

--

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



[issue14779] test_buffer fails on OS X universal 64-/32-bit builds

2012-05-12 Thread Roundup Robot

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

New changeset 8f22e5be18c8 by Stefan Krah in branch 'default':
Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bit
http://hg.python.org/cpython/rev/8f22e5be18c8

--
nosy: +python-dev

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



[issue13959] Re-implement parts of imp in pure Python

2012-05-12 Thread Roundup Robot

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

New changeset 7bf8ac742d2f by Brett Cannon in branch 'default':
Issue #13959: Introduce importlib.find_loader().
http://hg.python.org/cpython/rev/7bf8ac742d2f

--

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



[issue14779] test_buffer fails on OS X universal 64-/32-bit builds

2012-05-12 Thread Stefan Krah

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

Apparently the AS/400 had 128 bit pointers and IBM's System i still has them:

http://comments.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/651
http://www-01.ibm.com/support/docview.wss?uid=swg27019425


So I'll leave the SIZEOF_VOID_P test as the preferred method. Perhaps
the best way to sidestep all these issues would be to write a small
C module for getting type sizes.

--

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



[issue13959] Re-implement parts of imp in pure Python

2012-05-12 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

I have importlib.find_loader() coded up, but getting rid of find_module() is 
going to be a pain thanks to pkgutil, multiprocessing.forking, modulefinder, 
and idlelib.EditorWindow.

--

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



[issue14793] broken grammar in Built-in Types doc

2012-05-12 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
assignee: docs@python
components: Documentation
files: grammar.diff
keywords: patch
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: broken grammar in Built-in Types doc
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25554/grammar.diff

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



[issue13903] New shared-keys dictionary implementation

2012-05-12 Thread Roundup Robot

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

New changeset 10e8b97d0fd7 by Antoine Pitrou in branch 'default':
Make the reference counting of dictkeys objects participate in refleak hunting
http://hg.python.org/cpython/rev/10e8b97d0fd7

--

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



[issue14082] shutil doesn't copy extended attributes

2012-05-12 Thread Antoine Pitrou

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

Hynek's patch (communicated over IRC, committed in 8d85f9920878) seems to have 
fixed the failure.

--
status: open - closed

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



[issue6696] Profile objects should be documented

2012-05-12 Thread Tom Pinckney

Tom Pinckney thomaspinckn...@gmail.com added the comment:

I took a stab at updating the docs based on the current profiler source. See 
attached patch for a first draft. 

This is my first doc patch so would appreciate any feedback on style and 
substance of my changes.

I tried to document more of the modules (for example the internal Profile 
object), logically arrange things a better better IMHO, and generally be more 
precise about what is happening.

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

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



[issue14779] test_buffer fails on OS X universal 64-/32-bit builds

2012-05-12 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


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

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-12 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

So I've changed the patch to ignore everything missing except for dangling 
links (which throw unfortunately the same exception).

Just to stress it once more: a fwalk that _ignores_ dangling symlinks is 
worthless for rmtree. And wasn't rmtree the initial reason to implement fwalk 
in the first place? ;)

--
Added file: http://bugs.python.org/file25556/fwalk-ignore-missing-files.diff

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



[issue14794] slice.indices raises OverflowError

2012-05-12 Thread Paul Upchurch

New submission from Paul Upchurch pau...@gmail.com:

To reproduce the error:

Python 3.2.2 (default, Sep  5 2011, 22:09:30) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 slice(0,9,None).indices(126)
Traceback (most recent call last):
  File stdin, line 1, in module
OverflowError: cannot fit 'int' into an index-sized integer
 

The correct behaviour is to return (0, 9, 1).

 slice(0,9,None).indices(6)
(0, 9, 1)

This is related to http://bugs.python.org/issue1456470.

--
components: Interpreter Core
messages: 160500
nosy: Paul.Upchurch
priority: normal
severity: normal
status: open
title: slice.indices raises OverflowError
type: behavior
versions: Python 3.2

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



[issue14794] slice.indices raises OverflowError

2012-05-12 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

This seems to have been fixed as of 3.2.3 (as shipped with Ubuntu Precise):

Python 3.2.3 (default, Apr 12 2012, 19:08:59) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 slice(0,9,None).indices(126)
(0, 9, 1)

Current tip works fine too:

Python 3.3.0a3+ (default:b32baa5b7626+, May 10 2012, 14:56:20) 
[GCC 4.6.3] on linux
Type help, copyright, credits or license for more information.
 slice(0,9,None).indices(126)
(0, 9, 1)


I'd close this bug unless I'm missing something?

--
nosy: +hynek

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



[issue14794] slice.indices raises OverflowError

2012-05-12 Thread Paul Upchurch

Paul Upchurch pau...@gmail.com added the comment:

Sorry. I didn't realize there was a 3.2.3 out. I'll close it as fixed.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14794
___
___
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-12 Thread STINNER Victor

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

To prepare a deeper change, here is a first simple patch. Change how the size 
of the _PyUnicodeWriter buffer is handled:

 * overallocate by 100% (instead of 25%) and allocate at least 100 characters
 * don't overallocate when possible

It is possible to not overallocate when the format string has no prefix nor 
suffix and when there is only one argument. For example, %s % abc does 
directly allocate the exact buffer size and so don't need to call realloc() at 
the end.

The patch does also micro-optimize (cleanup?) _PyUnicodeWriter_Finish.

When it's possible to not overallocate, the speed up is around 10% for short 
strings (I suppose that it's much better to longer strings).

--

Output of the attached benchmark.py script:

Linux-3.3.2-1.fc16.x86_64-x86_64-with-fedora-16-Verne
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz

=== 3.3 ===

16 ms: N=200; fmt={0}-*N; arg=abc; fmt.format(arg)
5.77 ms: N=200; L=3; fmt=%s*N; args=(a*L,)*N; fmt % args
648 ns: s=The {k1} is {k2} the {k3}.; args={k1: x, k2: y, k3: z}; 
s.format(**args)
427 ns: s=The %(k1)s is %(k2)s the %(k3)s.; 
args={k1:x,k2:y,k3:z,}; s%args
531 ns: s=x={}, y={}, z={}; args=(123, 456, 789); s.format(*args)
453 ns: s=x=%s, y=%u, z=%x; args=(123, 456, 789); s%args
180 ns: fmt={}; arg=abc; fmt.format(arg)
228 ns: fmt={}; arg=123; fmt.format(arg)
196 ns: fmt=x={}; arg=abc; fmt.format(arg)
244 ns: fmt=x={}; arg=123; fmt.format(arg)
175 ns: str(12345)
233 ns: '{}'.format(12345)
243 ns: 'A{}'.format(12345)
276 ns: '\x80{}'.format(12345)
292 ns: '\u0100{}'.format(12345)
285 ns: '\U0001{}'.format(12345)
417 ns: '{:-10}'.format(12345)
425 ns: 'A{:-10}'.format(12345)
461 ns: '\x80{:-10}'.format(12345)
488 ns: '\u0100{:-10}'.format(12345)
461 ns: '\U0001{:-10}'.format(12345)
403 ns: '{:,}'.format(12345)
416 ns: 'A{:,}'.format(12345)
455 ns: '\x80{:,}'.format(12345)
469 ns: '\u0100{:,}'.format(12345)
448 ns: '\U0001{:,}'.format(12345)
108 ns: fmt=%s; arg=abc; fmt % arg
163 ns: fmt=%s; arg=123; fmt % arg
121 ns: fmt=%s:; arg=abc; fmt % arg

=== 3.3 + dont_overallocate.patch ===

15.5 ms: N=200; fmt={0}-*N; arg=abc; fmt.format(arg)
 6 ms: N=200; L=3; fmt=%s*N; args=(a*L,)*N; fmt % args
599 ns: s=The {k1} is {k2} the {k3}.; args={k1: x, k2: y, k3: z}; 
s.format(**args)
424 ns: s=The %(k1)s is %(k2)s the %(k3)s.; 
args={k1:x,k2:y,k3:z,}; s%args
531 ns: s=x={}, y={}, z={}; args=(123, 456, 789); s.format(*args)
441 ns: s=x=%s, y=%u, z=%x; args=(123, 456, 789); s%args
155 ns: fmt={}; arg=abc; fmt.format(arg)
206 ns: fmt={}; arg=123; fmt.format(arg)
204 ns: fmt=x={}; arg=abc; fmt.format(arg)
247 ns: fmt=x={}; arg=123; fmt.format(arg)
172 ns: str(12345)
209 ns: '{}'.format(12345)
248 ns: 'A{}'.format(12345)
257 ns: '\x80{}'.format(12345)
265 ns: '\u0100{}'.format(12345)
263 ns: '\U0001{}'.format(12345)
354 ns: '{:-10}'.format(12345)
404 ns: 'A{:-10}'.format(12345)
415 ns: '\x80{:-10}'.format(12345)
457 ns: '\u0100{:-10}'.format(12345)
430 ns: '\U0001{:-10}'.format(12345)
369 ns: '{:,}'.format(12345)
418 ns: 'A{:,}'.format(12345)
437 ns: '\x80{:,}'.format(12345)
459 ns: '\u0100{:,}'.format(12345)
448 ns: '\U0001{:,}'.format(12345)
76 ns: fmt=%s; arg=abc; fmt % arg
133 ns: fmt=%s; arg=123; fmt % arg
118 ns: fmt=%s:; arg=abc; fmt % arg

--
Added file: http://bugs.python.org/file25557/dont_overallocate.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



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

2012-05-12 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


Added file: http://bugs.python.org/file25558/benchmark.py

___
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



[issue13400] packaging: build command should have options to control byte-compilation

2012-05-12 Thread Julien Courteau

Julien Courteau courteaujul...@gmail.com added the comment:

Here is the last proposition of Eric done at the last Montreal Sprint (May 12):

--no-byte-compile- No *.pyc and *.pyo
--byte-compile=b - Only *.pyc
--byte-compile=b,o   - *.pyc and *.pyo (with docstrings)
--byte-compile=b,oo  - *.pyc and *.pyo (without docstrings)
--byte-compile=o - Only *.pyo (with docstrings)
--byte-compile=oo- Only *.pyo (without docstrings)
--byte-compile=o,oo  - Error

The parameters are symetric with the -B, -o and -oo of the python command.

--
nosy: +Julien.Courteau

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



[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-05-12 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

I'd like to see this enhancement as well.  It seems that not even a TextWrapper 
is capable of a simple indent (because TextWrapper methods operate on 
paragraphs rather than lines).

--
nosy: +cjerdonek

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



[issue14794] slice.indices raises OverflowError

2012-05-12 Thread Éric Araujo

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

 This seems to have been fixed as of 3.2.3 (as shipped with Ubuntu Precise)

Just a note: you can’t really trust the behavior of Python shipped by Debian or 
derivative systems because doko (the Debian Python maintainer) backports 
changes to released versions, which means that Debian’s 3.2.3 may not always 
behave as python.org’s 3.2.3.

--
nosy: +eric.araujo
resolution: fixed - out of date
stage:  - committed/rejected

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



[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()

2012-05-12 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Should the function work for strings with non-Unix line endings?

http://docs.python.org/dev/py3k/reference/lexical_analysis.html#physical-lines

For example, should indent(abc\r\n, ) return the same string, and should 
\r\n get indented by default?

--

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