[issue9120] Reduce pickle size for an empty set

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

Martin v. Löwis  added the comment:

Ok, so I'm closing it.

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue14366] Supporting lzma compression in zip files

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fccdcd83708a by Martin v. Löwis in branch 'default':
Issue #14366: Support lzma compression in zip files.
http://hg.python.org/cpython/rev/fccdcd83708a

--
nosy: +python-dev

___
Python tracker 

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



[issue14366] Supporting lzma compression in zip files

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

Martin v. Löwis  added the comment:

Thanks for the patch!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue14793] broken grammar in Built-in Types doc

2012-05-13 Thread Roundup Robot

New submission from Roundup Robot :

New changeset e0dcd732055f by Sandro Tosi in branch '3.2':
Issue #14793: fix grammar in bytes object paragraph; patch by Tshepang 
Lekhonkhobe
http://hg.python.org/cpython/rev/e0dcd732055f

--
nosy: +python-dev

___
Python tracker 

___
___
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-13 Thread Sandro Tosi

Sandro Tosi  added the comment:

Committed, thanks for the patch. For next times, please invest even a small 
amount of time describing why you opened the issue and what the patch fixes: 
it's definitely nicer not having to infer it from the diff.

--
nosy: +sandro.tosi
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



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

2012-05-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

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

Well, please post a benchmark for long strings, then :-)
I think 10% on a micro-benchmark is not worth the complication. This
code is already complicated enough.

--

___
Python tracker 

___
___
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-13 Thread Robin Schreiber

Changes by Robin Schreiber :


Added file: http://bugs.python.org/file25559/csv_pep3121_fix1.patch

___
Python tracker 

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



[issue14366] Supporting lzma compression in zip files

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you, Martin. Both of these patches basically your merit.

Maybe take a look also at the small patches to issue14315 and
issue10376?

--

___
Python tracker 

___
___
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-13 Thread Charles-François Natali

Charles-François Natali  added the comment:

> 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? ;)

Indeed, my bad :-)

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

Looks good to me.

--
stage: patch review -> commit review

___
Python tracker 

___
___
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-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 90cf321615e5 by Antoine Pitrou in branch 'default':
Remove Skip from the csv experts (see issue #14732).
http://hg.python.org/devguide/rev/90cf321615e5

--
nosy: +python-dev

___
Python tracker 

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



[issue14795] Pdb incorrectly handles a method breakpoint when module not imported

2012-05-13 Thread Xavier de Gaye

New submission from Xavier de Gaye :

In the following test, breakpoint 2 is set incorrectly at line 1 and
pdb does not know how to set a breakpoint on method C.c_foo. However
setting those two breakpoints on both methods is ok after the class
definition has been executed.


===   main.py   =
def foo():
pass

class C:
def c_foo(self):
pass
def foo(self):
pass

foo()
=
$ python3.1 -m pdb main.py
> /path_to/main.py(1)()
-> def foo():
(Pdb) import sys; print(sys.version)
3.1.2 (r312:79147, Apr  4 2010, 17:46:48) 
[GCC 4.3.2]
(Pdb) break foo
Breakpoint 1 at /path_to/main.py:1
(Pdb) break C.foo
Breakpoint 2 at /path_to/main.py:1
(Pdb) break C.c_foo
*** The specified object 'C.c_foo' is not a function
or was not found along sys.path.
(Pdb) break 10
Breakpoint 3 at /path_to/main.py:10
(Pdb) continue
> /path_to/main.py(10)()
-> foo()
(Pdb) break C.foo
Breakpoint 4 at /path_to/main.py:7
(Pdb) break C.c_foo
Breakpoint 5 at /path_to/main.py:5
(Pdb) quit
=

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

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160517
nosy: xdegaye
priority: normal
severity: normal
status: open
title: Pdb incorrectly handles a method breakpoint when module not imported
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25560/pdb_default.patch

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Éric Araujo

Changes by Éric Araujo :


--
stage:  -> test needed

___
Python tracker 

___
___
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-13 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Uploaded pdb_default_2.patch that corrects the initial patch: the
trace function must be set in all frames whose co_filename is the
breakpoint file name and not just the first frame of this set.

--
Added file: http://bugs.python.org/file25561/pdb_default_2.patch

___
Python tracker 

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



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Oleg Plakhotnyuk

New submission from Oleg Plakhotnyuk :

I've improved calendar.py test coverage a bit.

Before:
  41071%   calendar   (.../Lib/calendar.py)
After:
  41077%   calendar   (.../Lib/calendar.py)

--
components: Tests
files: test_calendar.patch
keywords: patch
messages: 160519
nosy: Oleg.Plakhotnyuk, giampaolo.rodola, ncoghlan, rhettinger
priority: normal
severity: normal
status: open
title: Calendar module test coverage improved
versions: Python 3.3
Added file: http://bugs.python.org/file25562/test_calendar.patch

___
Python tracker 

___
___
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-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 38d7d944370e by Brian Curtin in branch 'default':
Fix #13210. Port the Windows build from VS2008 to VS2010.
http://hg.python.org/cpython/rev/38d7d944370e

--
nosy: +python-dev

___
Python tracker 

___
___
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-13 Thread Brian Curtin

Brian Curtin  added the comment:

What I just pushed has functioning debug and release builds for both 32 and 64 
bit, and the tests introduce no new failures.

As noted on python-dev, we may not have build slaves setup for this change yet, 
so the Windows builds may appear broken.

I'll leave this open a bit until the infrastructure has caught up, and until 
any documentation is completed, which I may open a separate issue for.

--
resolution:  -> fixed
stage: patch review -> commit review

___
Python tracker 

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



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Brett Cannon

Changes by Brett Cannon :


--
stage:  -> patch review

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Brett Cannon

New submission from Brett Cannon :

With importlib.find_loader() now implemented, imp.find_module() (and its 
companion, imp.load_module()) can go away and stop inflicting their bad API 
upon the world.

The trick, though, is fixing code that uses the API. That means pkgutil, 
multiprocessing.forking, modulefinder, and idlelib.EditorWindow all need to be 
patched to stop using imp.find_module()/load_module().

--
components: Library (Lib)
messages: 160522
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Deprecate imp.find_module()/load_module()
type: enhancement
versions: Python 3.3

___
Python tracker 

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



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

2012-05-13 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies: +Deprecate imp.find_module()/load_module()

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue14798] pyclbr raises KeyError when the prefix of a dotted name is not a package

2012-05-13 Thread Xavier de Gaye

New submission from Xavier de Gaye :

pyclbr must raise ImportError instead of KeyError.
The attached patch fixes the problem. A test case is included.

--
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160523
nosy: xdegaye
priority: normal
severity: normal
status: open
title: pyclbr raises KeyError when the prefix of a dotted name is not a package
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25563/pdb_default.patch

___
Python tracker 

___
___
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-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 59870239813c by Brett Cannon in branch 'default':
Issue #13959: Document imp.find_module/load_module as deprecated.
http://hg.python.org/cpython/rev/59870239813c

--

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Brett Cannon

Brett Cannon  added the comment:

http://hg.python.org/lookup/59870239813c documents imp.find_module/load_module 
as deprecated w/o actually raising the deprecation. The code works fine, but 
the API is just crap. So in the name of ease of transition (and my own personal 
sanity), I didn't go full-blown deprecation. The remaining code that uses 
imp.find_module() in the stdlib uses the API's unique properties (e.g. 
executing under a different name in multiprocessing) or directly exposes the 
API (e.g. pkgutil and modulefinder). As for idle, I don't run the tool so I 
don't feel like editing the code and getting it wrong.

--
priority: normal -> low

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Brett Cannon

Brett Cannon  added the comment:

BTW, I'm leaving this issue open in case someone wants to take a stab and 
removing the uses of imp.find_module()/load_module() from the stdlb.

--

___
Python tracker 

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



[issue14796] Calendar module test coverage improved

2012-05-13 Thread R. David Murray

R. David Murray  added the comment:

Thanks for the patch.

There are a couple of things I'd change, which I or someone could do while 
committing if you prefer, but if you'd like to tune up the patch yourself that 
would be great.

The first is that I'd break up the tests that run more than one test into 
separate test methods (test_formatweekheader, test_formatmonthname, 
test_output_htmlcalendar).  The second is that the exception tests can be 
written more compactly (and IMO more legibly) like this:

def test_illegal_month_reported(self):
with self.assertRaisesRegex(calendar.IllegalMonthError, '65'):
calendar.monthrange(2004, 65)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue14770] Minor documentation fixes

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9d2a1f35421d by Ezio Melotti in branch '2.7':
#14770: improve the library FAQ.
http://hg.python.org/cpython/rev/9d2a1f35421d

New changeset 7a046f1ddd07 by Ezio Melotti in branch '3.2':
#14770: improve the library FAQ.
http://hg.python.org/cpython/rev/7a046f1ddd07

New changeset 59fd56c1be0d by Ezio Melotti in branch 'default':
#14770: merge with 3.2.
http://hg.python.org/cpython/rev/59fd56c1be0d

--
nosy: +python-dev

___
Python tracker 

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



[issue14770] Minor documentation fixes

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bf3cb58dcfe7 by Ezio Melotti in branch '2.7':
#14770: backport a couple of changes from 3.x.
http://hg.python.org/cpython/rev/bf3cb58dcfe7

--

___
Python tracker 

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



[issue14770] Minor documentation fixes

2012-05-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

I addressed Éric comments and committed the patch.

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

___
Python tracker 

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



[issue14794] slice.indices raises OverflowError

2012-05-13 Thread Paul Upchurch

Paul Upchurch  added the comment:

That's true; it doesn't work with today's downloads from python.org. The 
version I tested was win32 but I don't think that should matter. Python has 
always supported large numbers on 32-bit OSs.

My observations:

[1] Debian Wheezy, python3.2, 3.2.3~rc2-1: Fail
[2] Debian Wheezy, python2.7, 2.7.3~rc2-2.1: Fail
[3] python.org, python3.3, 3.3.0a3: Fail
[4] python.org, python3.2, 3.2.3: Fail

I'll compile 64-bit linux from source and try that.

[1] Python 3.2.3rc2 (default, Mar 21 2012, 06:59:51) [GCC 4.6.3] on linux2
[2] Python 2.7.3rc2 (default, Apr 22 2012, 22:35:38) [GCC 4.6.3] on linux2
[3] Python 3.3.0a3 (default, May  1 2012, 16:25:20) [MSC v.1500 32 bit (Intel)] 
on win32
[4] Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] 
on win32

--

___
Python tracker 

___
___
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-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

All the old .vcproj files are still there.  Probably not useful since the .sln 
file has been upgraded to VisualStudio 2010.

--

___
Python tracker 

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



[issue6818] remove/delete method for zipfile/tarfile objects

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

Martin v. Löwis  added the comment:

Yuval, can you please submit a contributor agreement? See

http://www.python.org/psf/contrib/

--

___
Python tracker 

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



[issue6818] remove/delete method for zipfile/tarfile objects

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

Martin v. Löwis  added the comment:

As for adding yourself to the CC list: notice the string "ubershmekel" 
appearing in the "CC" field of http://bugs.python.org/review/6818/show. It 
means that you are already on the CC list.

--

___
Python tracker 

___
___
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-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 924c178c0d1d by Brian Curtin in branch 'default':
Move out VS9 project files to PC\VS9.0 folder. Fixes #13210
http://hg.python.org/cpython/rev/924c178c0d1d

--

___
Python tracker 

___
___
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-13 Thread Brian Curtin

Brian Curtin  added the comment:

Thanks for noticing. I moved them out to PC\VS9.0 rather than outright deleting.

--

___
Python tracker 

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



[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ddcc8ee680d7 by Charles-François Natali in branch 'default':
Issue #14532: Add a secure_compare() helper to the hmac module, to mitigate
http://hg.python.org/cpython/rev/ddcc8ee680d7

--
nosy: +python-dev

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file25564/zipfile_extra_test.patch

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

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

Martin v. Löwis  added the comment:

Serhiy: can you please provide a unit test? The OP's test case is unsuitable 
because of both size and copyright.

As for the actual issue: the extra data (type 0xcafe) is apparently added by 
jar tools to make the jar file executable:

http://www.androidadb.com/source/commons-compress-1.1-src/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java.html

ISTM that the extra 0 byte is in clear violation of the ZIP specification, 
which says that there always be type+length headers, followed by length data. 
So if the length is 0, there ought not to be any data. I don't buy the 
"padding" argument, since a) the spec is silent on any padding, and b) for 
alignment reasons, it's not plausible to add any padding, since it is aligned 
fine without this padding, and unaligned with the padding.

I can sympathize with the desire to accept the zipfile, anyway (i.e. despite it 
being broken). At the same time, I also think that Python should not let errors 
pass silently.

So as a way out, I propose that the ZipFile class gains a "strict" attribute, 
indicating whether "acceptable" violations of the spec are ignored or reported 
as exceptions.

So -1 on the patch as it stands (but thanks for the analysis).

--
nosy: +loewis

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Serhiy: can you please provide a unit test? The OP's test case is unsuitable 
> because of both size and copyright.

I provided the test several minutes ago.

--

___
Python tracker 

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



[issue14796] Calendar module test coverage improved

2012-05-13 Thread Oleg Plakhotnyuk

Oleg Plakhotnyuk  added the comment:

Thanks for the review.

I'll happily tune the patch myself. Just when I have some spare time again.

--

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> I can sympathize with the desire to accept the zipfile, anyway (i.e. despite 
> it being broken). At the same time, I also think that Python should not let 
> errors pass silently.

I do not know other implementation of ZIP, which output an error or a
warning on such files. The fact is that such files exist in the wild
world.

> So as a way out, I propose that the ZipFile class gains a "strict" attribute, 
> indicating whether "acceptable" violations of the spec are ignored or 
> reported as exceptions.

It is a not easy task (and unnecessary, I suppose). Now zipfile ignores
many errors (for example, it completely ignores local file headers).

--

___
Python tracker 

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



[issue10376] ZipFile unzip is unbuffered

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

Changes by Martin v. Löwis :


Added file: http://bugs.python.org/file25565/zipfile_optimize_read.patch

___
Python tracker 

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



[issue10376] ZipFile unzip is unbuffered

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you, Martin, now I understood why not work Rietveld review.

--

___
Python tracker 

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



[issue14417] dict RuntimeError workaround

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 93748e2d64e3 by Antoine Pitrou in branch 'default':
Issue #14417: Mutating a dict during lookup now restarts the lookup instead of 
raising a RuntimeError (undoes issue #14205).
http://hg.python.org/cpython/rev/93748e2d64e3

--
nosy: +python-dev

___
Python tracker 

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



[issue14205] Raise an error if a dict is modified during a lookup

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 93748e2d64e3 by Antoine Pitrou in branch 'default':
Issue #14417: Mutating a dict during lookup now restarts the lookup instead of 
raising a RuntimeError (undoes issue #14205).
http://hg.python.org/cpython/rev/93748e2d64e3

--

___
Python tracker 

___
___
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-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Patch looks good for me, works fine.
I think it can be applied to 2.7 as well.
There are only problem: I don't know how to make test for it without using 
external tools like xclip or ctypes bindings for X so library.

--

___
Python tracker 

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



[issue14417] dict RuntimeError workaround

2012-05-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I have committed an updated patch, with a fix to Victor's test. I don't think 
anything else remains to be done.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue14799] Tkinter ttk tests hang on linux

2012-05-13 Thread Andrew Svetlov

New submission from Andrew Svetlov :

By default python doesn't run full test suite, but regrtest accepts -u 
parameter. The simplest way to reproduce is:

$ ./python -m test.regrtest -u gui test_ttk_guionly

--
components: Tkinter
messages: 160547
nosy: asvetlov
priority: critical
severity: normal
status: open
title: Tkinter ttk tests hang on linux
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

Indeed, and there don't seem to be any other tests for the clipboard 
functionality.

--

___
Python tracker 

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



[issue14667] No IDLE

2012-05-13 Thread James Lu

James Lu  added the comment:

thanks!
james

On Thu, Apr 26, 2012 at 1:02 AM, Brian Curtin wrote:

>
> Brian Curtin  added the comment:
>
> James, since you attached a Windows executable I'll assume that's the
> platform you're on.
>
> Try the following:
>
> 1. Open the Start menu
> 2. Choose "All Programs" (or "Programs" on XP, I think)
> 3. Scroll to where you see "Python x.y", where you'll see one or more
> entries depending on how many versions you have installed.
> 4. Choose the version you want to open, e.g., Python 2.7
> 5. You should see "IDLE (Python GUI)" in the menu. Run it, that's IDLE.
>
> Is there an issue with any of those steps?
>
> --
> nosy: +brian.curtin
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

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

Martin v. Löwis  added the comment:

>> So as a way out, I propose that the ZipFile class gains a "strict"
>> attribute, indicating whether "acceptable" violations of the spec
>> are ignored or reported as exceptions.
>
> It is a not easy task (and unnecessary, I suppose). Now zipfile
> ignores many errors (for example, it completely ignores local file
> headers).

Why do you consider this difficult? Just add a "strict" flag, make
it false by default, and raise an error if there is any unparsable
extra data.

I'm not asking that you implement a complete validity check for all
aspects of the zip spec - just that there is a mode where it continues
to raise an exception as it currently does (but with a better
exception).

--

___
Python tracker 

___
___
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-13 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

You are right: there are no tests as well as for the most part of tkinter.
Why don't make it if possible?

--

___
Python tracker 

___
___
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-13 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I'm skeptical about the patch. In both 2.7 and 3.x, clipboard_get returns a 
Unicode string, yet it fails to decode it properly. So I think this is the bug 
that ought to be fixed (using the proper encoding).

Defaulting to UTF8_STRING is a new feature, IMO, and shouldn't be done for 2.7 
(or 3.2).

--

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Just add a "strict" flag, make
> it false by default, and raise an error if there is any unparsable
> extra data.

If the module does not actually checks the correctness of all
(including local file headers, which now it ignores), it will be a false
promise. And I don't understand who these checks are needed at all.

Note that the parameter "strict" in htmlparser is considered to be
obsolete.

--

___
Python tracker 

___
___
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-13 Thread Ned Deily

Ned Deily  added the comment:

Martin, is that a way for _tkinter to know whether the result returned from 
Tcl/Tk is an encoded string or not in this case?

With regard to the patch, it would be better to cache the results of the 
first-time call to get the windowingsystem value so that we don't have to make 
two calls down into Tcl for each clipboard_get.

--

___
Python tracker 

___
___
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-13 Thread Ned Deily

Changes by Ned Deily :


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

___
Python tracker 

___
___
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-13 Thread Ned Deily

Ned Deily  added the comment:

Martin, is there a way for _tkinter to know whether the result returned from 
Tcl/Tk is an encoded string or not in this case?

With regard to the patch, it would be better to cache the results of the 
first-time call to get the windowingsystem value so that we don't have to make 
two calls down into Tcl for each clipboard_get.

--

___
Python tracker 

___
___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

У пт, 2012-05-11 у 21:25 +, Thomas Kluyver пише:
> So far, I've not found any case on X where STRING works but UTF8_STRING 
> doesn't.

Perhaps there will be problems with the old (very old) closed source
software.

A few years ago (in Debian Sarge) even xsel did not work with the
non-ascii strings.

--

___
Python tracker 

___
___
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-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

But the encoding used seemingly depends on the source application - Geany (GTK 
2, I think) seemingly sends UTF8 text anyway, whereas Firefox escapes the 
unicode character. So I don't think we can correctly decode the STRING value in 
all cases.

The Tk documentation describes UTF8_STRING as being the "most useful" type on 
modern X11.

--

___
Python tracker 

___
___
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-13 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

I did a little compiling party with official releases and all permutations of 
Linux, OS X x 3.2.2, 3.2.3 worked. Both ran on 64bit (Linux in a VirtualBox).

Python 3.2.2 (default, May 13 2012, 21:24:38) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0,9,None).indices(126)
(0, 9, 1)

Python 3.2.2 (default, May 13 2012, 21:33:57) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0,9,None).indices(126)
(0, 9, 1)

Can we narrow it down to 32bit hosts/OS?

--

___
Python tracker 

___
___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> But the encoding used seemingly depends on the source application - Geany 
> (GTK 2, I think) seemingly sends UTF8 text anyway, whereas Firefox escapes 
> the unicode character. So I don't think we can correctly decode the STRING 
> value in all cases.

Agree. Opera sends 'abc?' literally.

--

___
Python tracker 

___
___
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-13 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Martin, is that a way for _tkinter to know whether the result
> returned from Tcl/Tk is an encoded string or not in this case?

Off-hand, I don't know. I suppose there is a way to do this correctly,
but one might have to dig through many layers of software to find out
what that way is.

> With regard to the patch, it would be better to cache the results of
> the first-time call to get the windowingsystem value so that we don't
> have to make two calls down into Tcl for each clipboard_get.

That also.

--

___
Python tracker 

___
___
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-13 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> But the encoding used seemingly depends on the source application -
> Geany (GTK 2, I think) seemingly sends UTF8 text anyway, whereas
> Firefox escapes the unicode character. So I don't think we can
> correctly decode the STRING value in all cases.

Ah, ok. IIUC, support for UTF8_STRING would also be in the realm of
the source application, right? If so, I think we should use something
more involved where we try UTF8_STRING first, and fall back to STRING
if the application doesn't support that.

This I could also accept for 2.7, since it "shouldn't" have a potential
for breakage.

--

___
Python tracker 

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



[issue14797] Deprecate imp.find_module()/load_module()

2012-05-13 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

___
___
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-13 Thread Ned Deily

Ned Deily  added the comment:

+1 to Martin's proposal

--

___
Python tracker 

___
___
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-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

OK, I'll produce an updated patch.

--

___
Python tracker 

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



[issue12098] Child process running as debug on Windows

2012-05-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +sbt

___
Python tracker 

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



[issue14245] float rounding examples in FAQ are outdated

2012-05-13 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2b2a7861255d by Mark Dickinson in branch '3.2':
Issue #14245: Improve floating-point entry in FAQ.  Thanks Zbyszek 
Jędrzejewski-Szmek for some of the wording.
http://hg.python.org/cpython/rev/2b2a7861255d

New changeset a79b07e05d0d by Mark Dickinson in branch 'default':
Issue #14245: Merge changes from 3.2.
http://hg.python.org/cpython/rev/a79b07e05d0d

--
nosy: +python-dev

___
Python tracker 

___
___
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-13 Thread STINNER Victor

STINNER Victor  added the comment:

>> 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).
> Well, please post a benchmark for long strings, then :-)

Ok, here you have. I don't understand why results are so random. There
is no performance regression, but there are interesting speed up.

Original:

200 ns: L=10 ** 3; fmt="%s"; args="a" * L; fmt % args
370 ns: L=10 ** 4; fmt="%s"; args="a" * L; fmt % args
3.85 ms: L=10 ** 5; fmt="%s"; args="a" * L; fmt % args
334 ms: L=10 ** 6; fmt="%s"; args="a" * L; fmt % args
2.87 ms: L=10 ** 7; fmt="%s"; args="a" * L; fmt % args
23.9 ms: L=10 ** 8; fmt="%s"; args="a" * L; fmt % args

Patched:

120 ns (-40%): L=10 ** 3; fmt="%s"; args="a" * L; fmt % args
276 ns (-25%): L=10 ** 4; fmt="%s"; args="a" * L; fmt % args
3.7 ms (-4%): L=10 ** 5; fmt="%s"; args="a" * L; fmt % args
67.6 ms (-80%): L=10 ** 6; fmt="%s"; args="a" * L; fmt % args
1.38 ms (-51%): L=10 ** 7; fmt="%s"; args="a" * L; fmt % args
23.5 ms (-2%): L=10 ** 8; fmt="%s"; args="a" * L; fmt % args

--

___
Python tracker 

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



[issue14245] float rounding examples in FAQ are outdated

2012-05-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks for all the feedback.  I made another round of minor edits to the latest 
version and committed the result.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



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

2012-05-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Not quite honest contrexample:

./python -m timeit -s "f='[{}]'.format;s='A'*100" "f(s)"

Python 3.3: 100 loops, best of 3: 1.67 usec per loop
Python 3.3 + dont_overallocate.patch: 10 loops, best of 3: 2.01 usec per 
loop

--

___
Python tracker 

___
___
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-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> >> 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).
> > Well, please post a benchmark for long strings, then :-)
> 
> Ok, here you have. I don't understand why results are so random. There
> is no performance regression, but there are interesting speed up.

Do you have anything more interesting than fmt="%s" ?

--

___
Python tracker 

___
___
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-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

As requested, the second version of the patch (x11-clipboard-try-utf8):

- Caches the windowing system per object. The tk call to find the windowing 
system is made the first time clipboard_get or selection_get are called without 
specifying `type=`.
- If using UTF8_STRING throws an error, it falls back to the default call with 
no type specified (i.e. STRING).

--
Added file: http://bugs.python.org/file25566/x11-clipboard-try-utf8.patch

___
Python tracker 

___
___
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-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Does anyone else want to review this patch?

--

___
Python tracker 

___
___
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-13 Thread Ned Deily

Ned Deily  added the comment:

Not to bikeshed here but I think it would be better to cache the 
windowingsystem value at the module level since I assume an application could 
be calling clipboard_get on different tkinter objects and I don't there is any 
possibility that the windowingsystem value could vary within one interpreter 
invocation.

--

___
Python tracker 

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



[issue14624] Faster utf-16 decoder

2012-05-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

New performance figures under 64 bit Linux, Intel Core i5-2500K @ 3.30GHz:

  vanilla 3.3   patched

utf-16le  'A'*1   1411 (+290%)  5504
utf-16le  'A'*+'\x80' 1368 (+263%)  4970
utf-16le  'A'*+'\u0100'   1145 (+151%)  2871
utf-16le  'A'*+'\u8000'   1144 (+151%)  2870
utf-16le  'A'*+'\U0001'   1164 (+154%)  2957
utf-16le  '\x80'*11403 (+271%)  5209
utf-16le'\x80'+'A'*   1406 (+272%)  5235
utf-16le  '\x80'*+'\u0100'1138 (+138%)  2713
utf-16le  '\x80'*+'\u8000'1138 (+139%)  2716
utf-16le  '\x80'*+'\U0001'1155 (+151%)  2897
utf-16le  '\u0100'*1  1477 (+243%)  5062
utf-16le'\u0100'+'A'* 1478 (+243%)  5072
utf-16le'\u0100'+'\x80'*  1477 (+243%)  5062
utf-16le  '\u0100'*+'\u8000'  1478 (+242%)  5055
utf-16le  '\u0100'*+'\U0001'  1201 (+131%)  2776
utf-16le  '\u8000'*1  246 (+347%)   1100
utf-16le'\u8000'+'A'* 1475 (+244%)  5069
utf-16le'\u8000'+'\x80'*  1474 (+243%)  5062
utf-16le'\u8000'+'\u0100'*1473 (+243%)  5057
utf-16le  '\u8000'*+'\U0001'  236 (+295%)   932
utf-16le  '\U0001'*1  393 (+164%)   1039
utf-16le'\U0001'+'A'* 1325 (+134%)  3106
utf-16le'\U0001'+'\x80'*  1326 (+134%)  3103
utf-16le'\U0001'+'\u0100'*1326 (+134%)  3104
utf-16le'\U0001'+'\u8000'*253 (+331%)   1091

utf-16be  'A'*1   1341 (+298%)  5342
utf-16be  'A'*+'\x80' 1305 (+275%)  4888
utf-16be  'A'*+'\u0100'   1101 (+157%)  2834
utf-16be  'A'*+'\u8000'   1102 (+157%)  2831
utf-16be  'A'*+'\U0001'   1115 (+162%)  2917
utf-16be  '\x80'*11326 (+296%)  5253
utf-16be'\x80'+'A'*   1322 (+298%)  5258
utf-16be  '\x80'*+'\u0100'1088 (+156%)  2781
utf-16be  '\x80'*+'\u8000'1088 (+155%)  2770
utf-16be  '\x80'*+'\U0001'1103 (+159%)  2854
utf-16be  '\u0100'*1  1344 (+221%)  4308
utf-16be'\u0100'+'A'* 1342 (+223%)  4330
utf-16be'\u0100'+'\x80'*  1343 (+221%)  4307
utf-16be  '\u0100'*+'\u8000'  1343 (+221%)  4306
utf-16be  '\u0100'*+'\U0001'  1109 (+128%)  2529
utf-16be  '\u8000'*1  248 (+341%)   1094
utf-16be'\u8000'+'A'* 1340 (+223%)  4331
utf-16be'\u8000'+'\x80'*  1341 (+221%)  4307
utf-16be'\u8000'+'\u0100'*1341 (+221%)  4309
utf-16be  '\u8000'*+'\U0001'  239 (+290%)   931
utf-16be  '\U0001'*1  399 (+160%)   1037
utf-16be'\U0001'+'A'* 1230 (+152%)  3101
utf-16be'\U0001'+'\x80'*  1218 (+154%)  3095
utf-16be'\U0001'+'\u0100'*1220 (+154%)  3095
utf-16be'\U0001'+'\u8000'*257 (+318%)   1074

--

___
Python tracker 

___
___
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-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

I'm happy to put the cache at the module level, but I'll give other people a 
chance to express their views before I dive into the code again.

I imagine most applications would only call clipboard_get() on one item, so it 
wouldn't matter. However, my own interest in this is from IPython, where we 
create a Tk object just to call clipboard_get() once, so a module level cache 
would be quicker, albeit only a tiny bit.

--

___
Python tracker 

___
___
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-13 Thread STINNER Victor

STINNER Victor  added the comment:

> Not quite honest contrexample

I agree, this example is not honest :-) It's because of the magical value 100 
used as initial size of the buffer. The speed is the same for shorter or longer 
strings.

--

___
Python tracker 

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



[issue14417] dict RuntimeError workaround

2012-05-13 Thread Guido van Rossum

Guido van Rossum  added the comment:

Thanks Antoine!

--

___
Python tracker 

___
___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Not to bikeshed here but I think it would be better to cache the 
> windowingsystem value at the module level since I assume an application could 
> be calling clipboard_get on different tkinter objects and I don't there is 
> any possibility that the windowingsystem value could vary within one 
> interpreter invocation.

Why Misc.tk is not a module level variable?

--

___
Python tracker 

___
___
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-13 Thread Brett Cannon

Brett Cannon  added the comment:

I don't feel the need to, but I can in a few days if you want me to (just let 
me know if you do).

--

___
Python tracker 

___
___
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-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It seems to me that the proposed changes are too tricky and too dirty for such 
a modest gain. It seems to me, this effect can be achieved easier 
(special-casing "%s" and "{}" to return str(arg)?).

If you want to get really impressive results, try to compile a pattern into an 
optimized internal representation and cache it (as in the struct module). This 
completely different approach may work.

--

___
Python tracker 

___
___
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-13 Thread STINNER Victor

STINNER Victor  added the comment:

> Do you have anything more interesting than fmt="%s" ?
and
> It seems to me that the proposed changes are too tricky and too dirty for 
> such a modest gain.

To be honest, I didn't write dont_overallocate.patch to speed up formatting 
strings, but it's a patch to prepare another change on str.format. The patch 
limits the overhead of _PyUnicodeWriter for str.format.

I proposed the change as a separated patch because I prefer simple patches: 
they are easier to review and to benchmark. But I agree the speed up is less 
impressive :-) I also prefer small patches for practical reasons. It's not easy 
to exchange huge patches on the tracker and to manipulate them. I always 
hesitate to start a new HG repository for a specific issue.

I will rewrite my format_writer-2.patch based on dont_overallocate.patch. It 
looks like you are waiting for the full patch.

--

___
Python tracker 

___
___
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-13 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

The 3rd revision of the patch has the cache at the module level. It's a bit 
awkward, because there's no module level function to call to retrieve it (as 
far as I know), so it's exposed by objects which can call Tk.

Also, serhiy pointed out a mistake in the 2nd revision, which is fixed 
('selection' instead of 'clipboard').

--
Added file: http://bugs.python.org/file25567/x11-clipboard-try-utf8-3.patch

___
Python tracker 

___
___
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-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I will rewrite my format_writer-2.patch based on
> dont_overallocate.patch. It looks like you are waiting for the full
> patch.

Well, there's no point in committing the first patch if the second one
doesn't give an interesting speedup.

--

___
Python tracker 

___
___
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-13 Thread Chris Rebert

Chris Rebert  added the comment:

Right, I can see how the 3rd paragraph has become tangential given the refined 
scope of the entry.

What do people think about a separate entry:

"annotation"
Can refer to either a `function annotation` or some uses of 
`decorator`s.

?

--

___
Python tracker 

___
___
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-13 Thread Chris Rebert

Changes by Chris Rebert :


Added file: http://bugs.python.org/file25568/function_annotation_v2.patch

___
Python tracker 

___
___
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-13 Thread Paul Upchurch

Paul Upchurch  added the comment:

The pre-built 64-bit Windows binaries from python.org works.

Python 3.3.0a3 (default, May  1 2012, 16:46:00) [MSC v.1500 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0,9,None).indices(126)
(0, 9, 1)

Python 3.2.3 (default, Apr 11 2012, 07:12:16) [MSC v.1500 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0,9,None).indices(126)
(0, 9, 1)

I think this issue is settled. There are several possible actions for people 
that find this discussion through a web search.

1. Use Ubuntu 12.04 LTS
2. Compile a fresh copy of 3.2 or 3.3 from python.org.
3. Use a pre-built 3.2 or 3.3 64-bit Windows binary from python.org.
4. Wait for your Linux distribution to catch up.

Hynek, Éric: Thanks for your help.

--

___
Python tracker 

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



[issue14800] stat.py constant comments + docstrings

2012-05-13 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

As per:
http://mail.python.org/pipermail/python-ideas/2012-May/015112.html

--
files: stat-comments.patch
keywords: patch
messages: 160584
nosy: giampaolo.rodola, terry.reedy
priority: normal
severity: normal
status: open
title: stat.py constant comments + docstrings
Added file: http://bugs.python.org/file25569/stat-comments.patch

___
Python tracker 

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



[issue14801] ssize_t where size_t expected

2012-05-13 Thread Peter Marheine

New submission from Peter Marheine :

Cross-compiling the interpreter for a system without a definition for ssize_t 
fails in PyType_FromSpec (Object/typeobject.c:2380 in the 3.2.3 release, line 
2409 in hg 6b8f34a1cb22).

It appears the type of len should be corrected to size_t to match the 
signatures of strlen and memcpy.  This fixes the compilation error.

--
components: Interpreter Core
messages: 160585
nosy: tari
priority: normal
severity: normal
status: open
title: ssize_t where size_t expected
type: compile error
versions: Python 3.2

___
Python tracker 

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



[issue14616] subprocess docs should mention pipes.quote/shlex.quote

2012-05-13 Thread Chris Rebert

Chris Rebert  added the comment:

Patch to mention shlex.quote() in the `subprocess` module's "Frequently Used 
Arguments" Warning box. Could perhaps be a separate Note, but that could be 
clutter-y.

--
keywords: +patch
Added file: http://bugs.python.org/file25570/subprocess_shlex_quote.patch

___
Python tracker 

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



[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-05-13 Thread Chris Rebert

Chris Rebert  added the comment:

Re: Nick's comments:

Besides `close_fds`, what other Popen parameters currently have suboptimal 
defaults?

--

___
Python tracker 

___
___
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-13 Thread Ned Deily

Ned Deily  added the comment:

Serhiy, I don't know why Misc.Tk is not module level but it isn't so caching 
global attributes there isn't effective.  However, upon further consideration, 
I take back my original suggestion of caching at the module level primarily 
because I can think of future scenarios where it might be possible that there 
are different windowing systems supported in the same Python instance.  I now 
think the best solution is to cache at the Tk root object level; that appears 
to be a simple change to Thomas's 2nd revision.  Sorry about that!  Here is a 
fourth version (one for 3.x and one for 2.7) based on the second which includes 
the fix from the 3rd.

I started to write a simple test for the clipboard functions but then realized 
that there doesn't seem to be a practical way to effectively test in a 
machine-independent way without destroying the contents of the Tk clipboard and 
hence the user's desktop clipboard, not a friendly thing to do.  For example, 
the clipboard might contain a data type not supported by the platform's Tk, 
like pict data on OS X.  So I'm not including the test here but it did verify 
that the attribute was being properly cached across multiple tkinter objects.

Thanks to Thomas for the patch and to Serhiy for reviewing.  By the way, 
Thomas, for your patch to be included, you should submit a PSF contributor 
agreement as described here:  http://www.python.org/psf/contrib/.  Once that is 
in place and if the patch looks good to everyone, I'll apply it.

--
stage:  -> patch review
Added file: http://bugs.python.org/file25571/x11-clipboard-try-utf8-4.patch

___
Python tracker 

___
___
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-13 Thread Ned Deily

Changes by Ned Deily :


Added file: http://bugs.python.org/file25572/x11-clipboard-try-utf8-4_27.patch

___
Python tracker 

___
___
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-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This looks fine.  Éric, please apply the v2 patch when you get a chance.

--
assignee: rhettinger -> eric.araujo
priority: normal -> low

___
Python tracker 

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Meador Inge

Meador Inge  added the comment:

This is definitely *not* a padding issue.
The problem is that one of the records has an extra field of length 1:

$ zipinfo -v bla.apk

...

Central directory entry #3:
---

  There are an extra 16 bytes preceding this file.

  res/raw/ice.png

  offset of local header from start of archive: 1190 (04A6h) bytes
  file system or operating system of origin:MS-DOS, OS/2 or NT FAT
  version of encoding software: 1.0
  minimum file system compatibility required:   MS-DOS, OS/2 or NT FAT
  minimum software version required to extract: 1.0
  compression method:   none (stored)
  file security status: not encrypted
  extended local header:no
  file last modified on (DOS date/time):2012 Jan 13 15:30:08
  32-bit CRC value (hex):   f969abab
  compressed size:  26250 bytes
  uncompressed size:26250 bytes
  length of filename:   15 characters
  length of extra field:1 bytes
  length of file comment:   0 characters
  disk number on which file begins: disk 1
  apparent file type:   binary
  non-MSDOS external file attributes:   00 hex
  MS-DOS file attributes (00 hex):  none

  The central-directory extra field contains:

  There is no file comment.


Our implementation can't deal with that because of the line that Terry 
pointed out:

tp, ln = unpack('

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



[issue14315] zipfile.ZipFile() unable to open zip File

2012-05-13 Thread Meador Inge

Meador Inge  added the comment:

FWIW, I think it will OK to just ignore extra fields that we can't 
interpret as according to the standard.  The only one we currently
care about is the "Zip64 extended information extra field".  Also,
other programs (including the Info-Zip tools) seem to mostly ignore
these fields.

--

___
Python tracker 

___
___
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-13 Thread Yugang LIU

Yugang LIU  added the comment:

By HTML standard, it is not a bug.
I will verify my code. Thanks for your reply.

On 2012-05-13 0:51, Ezio Melotti wrote:
> Ezio Melotti  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 
> 
> ___
>

--

___
Python tracker 

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



[issue14802] Python 3.2 fail to compile with VC11 ARM configuration

2012-05-13 Thread Minmin Gong

New submission from Minmin Gong :

Windows ARM doesn't support full win32 api, e.g. no registry and winsock. So 
the python fail to compile with VC11 beta in ARM configuration.

--
components: Interpreter Core
messages: 160593
nosy: Minmin.Gong
priority: normal
severity: normal
status: open
title: Python 3.2 fail to compile with VC11 ARM configuration
type: compile error
versions: Python 3.2

___
Python tracker 

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



  1   2   >