[issue17170] string method lookup is too slow

2013-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

To answer Guido's question about clinic, see http://bugs.python.org/issue16612

Mostly positive feedback, but several of us would like a PEP to make sure we're 
happy with the resolution of the limited negative feedback.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

+1 for documenting the clinic DSL as a PEP. It's a bit too hard to find the 
rationale for toolchain changes like this when they're hidden away in tracker 
issues.

It doesn't need to be an extended essay like most of the PEPs I write, it can 
be relatively short and sweet (consider the PEP that approved the addition of 
unittest.mock: http://www.python.org/dev/peps/pep-0417/)

As Greg suggested, taking the current clinic.txt and publishing it as a "DSL 
for C API argument processing" PEP would get you most of the way there.

--
nosy: +ncoghlan

___
Python tracker 

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



Re: [issue16996] Reuse shutil.which() in webbrowser module

2013-02-12 Thread Senthil Kumaran
Serhiy: The patch LGTM.
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-02-12 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks Thomas! It's a promising start - a few more detailed comments in the 
patch review.

I like the idea of creating the initial version as an object-oriented wrapper 
around the existing APIs, rather than completely refactoring the module to make 
everything else a functional wrapper around an underlying object-oriented 
implementation.

--

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-12 Thread Senthil Kumaran

Senthil Kumaran added the comment:

@gps: looks like it is. For changeset:   78129:de229dde486b for Issue #14635

--

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-12 Thread Gregory P. Smith

Gregory P. Smith added the comment:

this bug was likely introduced when i applied the telnetlib patches to use poll 
to not hit the select fd limit.  doh.  nice catch!

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-12 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the bug report, Reuben. I verified that this is indeed a bug and 
should be fixed in all versions. Thanks for the patch too, would you like to 
enhance it with tests? GeneralTests in test_telnetlib.py support timeout and 
you could that exercise timeout value in secs.

--
nosy: +orsenthil
stage:  -> test needed
versions: +Python 2.7, Python 3.2, Python 3.4

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-12 Thread Reuben D'Netto

Reuben D'Netto added the comment:

Updated patch to fix expect() as well.

--
Added file: http://bugs.python.org/file29056/telnetlib.py.patch

___
Python tracker 

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



[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-12 Thread Reuben D'Netto

New submission from Reuben D'Netto:

read_until() takes a value for timeout in seconds, but passes it to poll(), 
which takes a value in milliseconds.

--
files: telnetlib.py.patch
keywords: patch
messages: 181993
nosy: Reuben.D'Netto
priority: normal
severity: normal
status: open
title: telnetlib.read_until() timeout uses the wrong units
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file29055/telnetlib.py.patch

___
Python tracker 

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



[issue17199] Slightly wrong behavior of logging.StrFormatStyle.usesTime

2013-02-12 Thread Enrique A Tobis

Changes by Enrique A Tobis :


--
keywords: +patch
Added file: http://bugs.python.org/file29054/mywork.patch

___
Python tracker 

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



[issue17199] Slightly wrong behavior of logging.StrFormatStyle.usesTime

2013-02-12 Thread Enrique A Tobis

New submission from Enrique A Tobis:

import logging

f = logging.StrFormatStyle('{asctimer}')
print(f.usesTime())
f = logging.PercentStyle('%(astimer)s')
print(f.usesTime())

prints

True
False

and I think it should print

False
False

--
components: Library (Lib)
messages: 181992
nosy: etobis
priority: normal
severity: normal
status: open
title: Slightly wrong behavior of logging.StrFormatStyle.usesTime
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



[issue16278] os.rename documentation slightly inaccurate

2013-02-12 Thread Todd Rovito

Todd Rovito added the comment:

This is a gentle ping of this issue.  Can somebody please review and let me 
know what needs to be done to get this committed?  I did test the patch on 
2/12/2013 and it seems to work from the latest 3.4.  Thanks!

--

___
Python tracker 

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



[issue17198] dbm.whichdbm references non-existent 'ndbm'

2013-02-12 Thread Philip Jenvey

New submission from Philip Jenvey:

There are a couple references to an 'ndbm' variable/module in this function on 
Python 3.2 and above (and just one reference on default). It appears to be 
leftover from the 3.x reworking of this module

--
components: Library (Lib)
messages: 181990
nosy: georg.brandl, pjenvey
priority: normal
severity: normal
stage: needs patch
status: open
title: dbm.whichdbm references non-existent 'ndbm'
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread Ned Deily

Ned Deily added the comment:

If moving .idlerc fixed the problem, undoubtedly one of the IDLE config files 
had a corrupted value.  There have been some fixes since 3.3.0 to make that 
part of IDLE more robust.  If you want to pursue the issue, you can reopen this 
issue and upload the files from the broken .idlerc.

--

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread Michael Foord

Changes by Michael Foord :


--
resolution:  -> works for me
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



[issue17196] crash

2013-02-12 Thread jake

jake added the comment:

It is working correctly now.  Thank you for the help!

--

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread Ned Deily

Ned Deily added the comment:

"But even though python is now open, the icon on the dock is different and none 
of my previous python files will open.  When i try to open them, the IDLE icon 
im used to seeing bounces a few times and then disappears while the other 
python IDLE icon that started up after entering the second command line you 
gave me is up the whole time."

>From that I take it that you are trying to open the python files by double 
>clicking on them?  If so, try launching idle from the command line again and, 
>from its menu bar (which will be labeled as "Python" instead of "IDLE", try 
>opening your python files with the File -> Open menu and see if that brings up 
>an IDLE edit window that you can use.

Also, after quitting the command line IDLE, try the following in the terminal:

grep TK_PATCH_LEVEL /Library/Frameworks/Tk.framework/tkConfig.sh
# report what this says
cd ~
mv .idlerc .idlerc-DISABLED

That will restore all of IDLE's defaults.  Then, try double-clicking on IDLE 
again.  If it still fails to launch, check the system.log for relevant error 
messages.  You can use the Console app (in /Applications/Utilities/) for that.

--

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread jake

jake added the comment:

Ned,
   I was starting python from the applications menu and selecting IDLE.  I 
tried both of those commands.  Both worked, the first started python in 
terminal and displayed this message:
"Last login: Tue Feb 12 16:32:21 on ttys000
localhost:~ jakeflynn$ /usr/local/bin/python3.3
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "

, the second started up a python shell.  But even though python is now open, 
the icon on the dock is different and none of my previous python files will 
open.  When i try to open them, the IDLE icon im used to seeing bounces a few 
times and then disappears while the other python IDLE icon that started up 
after entering the second command line you gave me is up the whole time.

--

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread Ned Deily

Ned Deily added the comment:

How exactly are you invoking Python?  From a terminal command line?  What 
messages do you see when you type:

/usr/local/bin/python3.3

Or from IDLE?  If so, try invoking IDLE from a terminal:

/usr/local/bin/idle3.3

--
nosy: +ned.deily

___
Python tracker 

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



[issue16743] mmap on Windows can mishandle files larger than sys.maxsize

2013-02-12 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue16743] mmap on Windows can mishandle files larger than sys.maxsize

2013-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

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



[issue16996] Reuse shutil.which() in webbrowser module

2013-02-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue5308] cannot marshal objects with more than 2**31 elements

2013-02-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue11311] StringIO.readline(0) returns incorrect results

2013-02-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for explanation, Antoine.

Thank you for your contribution, Amir.

--
assignee:  -> serhiy.storchaka
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



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a43f67e95ef0 by Serhiy Storchaka in branch '2.7':
Fix for issue #16800: Use buffered write to handle EINTR.
http://hg.python.org/cpython/rev/a43f67e95ef0

New changeset 4622206db91b by Serhiy Storchaka in branch '3.2':
Fix for issue #16800: Use buffered write to handle EINTR.
http://hg.python.org/cpython/rev/4622206db91b

New changeset 2fb03fe354e3 by Serhiy Storchaka in branch '3.3':
Fix for issue #16800: Use buffered write to handle EINTR.
http://hg.python.org/cpython/rev/2fb03fe354e3

New changeset fec33725f319 by Serhiy Storchaka in branch 'default':
Fix for issue #16800: Use buffered write to handle EINTR.
http://hg.python.org/cpython/rev/fec33725f319

--

___
Python tracker 

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



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b368fc93dca8 by Serhiy Storchaka in branch '2.7':
Issue #16800: tempfile.gettempdir() no longer left temporary files when
http://hg.python.org/cpython/rev/b368fc93dca8

New changeset 377123f10820 by Serhiy Storchaka in branch '3.2':
Issue #16800: tempfile.gettempdir() no longer left temporary files when
http://hg.python.org/cpython/rev/377123f10820

New changeset 6f432bb11b28 by Serhiy Storchaka in branch '3.3':
Issue #16800: tempfile.gettempdir() no longer left temporary files when
http://hg.python.org/cpython/rev/6f432bb11b28

New changeset b66a5b41d82f by Serhiy Storchaka in branch 'default':
Issue #16800: tempfile.gettempdir() no longer left temporary files when
http://hg.python.org/cpython/rev/b66a5b41d82f

--
nosy: +python-dev

___
Python tracker 

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



[issue17197] c/profile refactoring

2013-02-12 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
components: +Library (Lib)
keywords: +easy -patch
versions: +Python 3.4

___
Python tracker 

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



[issue17197] c/profile refactoring

2013-02-12 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola':

profile and cProfile modules define the same utility functions (run() and 
runctx()) which use the same code except the profiler class.
Considering that we're going to add 2 new utility functions (runcall() and 
runblock(), see issue9285 and issue17130) I think we should refactor the code 
in order to avoid this code duplication.
Patch in attachment does that.
The approach I came up with looks a bit hackish though so I'd like to get some 
feedback. Is it acceptable?

--
files: profile-refactoring.diff
keywords: patch
messages: 181980
nosy: georg.brandl, giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: c/profile refactoring
Added file: http://bugs.python.org/file29053/profile-refactoring.diff

___
Python tracker 

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



[issue17194] operator.attrgetter is slower than a lambda

2013-02-12 Thread Florent Xicluna

Florent Xicluna added the comment:

You're right. I've misinterpreted the figures.

Only 2.6 and 2.7 are affected --> closing the issue.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue17194] operator.attrgetter is slower than a lambda

2013-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Are you sure? 0.275 < 0.347

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread Mauro Cicognini

Mauro Cicognini added the comment:

David, that is exactly what I meant: functionality for Python 3 is less than 
the functionality available for Python 2, and behavior is completely out of 
sync with the documentation.

Bug or not, and independent of the root cause (I don't know if anyone will ever 
come up with more or better tests), I agree that this behavior for Python 3 has 
been around for a long time. I don't think it will break any significant code, 
but that's just my personal opinion; the main point is that re-introducing 
quoting functionality in imaplib would be a significant effort, also because 
reading the other relevant threads it is apparent that correct implementation 
is not there in Python 2 either.

I think that we have an easy way: 1) fix the documentation for Python 3 so that 
it reflects behavior and 2) expose the _quote() private method with a new 
static function that the user will be able to call when they deem it necessary.
They get to come up with a good regex or other ways to detect strings that need 
quoting, but still it's better than relying (like I did) on the advertised 
functionality and having to dig into the bowels of the module to understand the 
source of some bizarre bugs...

--

___
Python tracker 

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



[issue17196] crash

2013-02-12 Thread jake

New submission from jake:

I have had python 3.3.0 on my mac and have been successfully using it for the 
past few weeks.  Today in my class I had the program open and it was running 
fine.  Then suddenly it quit working and shut itself down.  I have restarted my 
machine multiple times and reinstalled the program over 5 times and it still 
will not open at all now.  Does anyone know why this might be?  I am currently 
running OSX 10.8.2 and trying to get the python version 3.3.0 to run.  I am 
puzzled as to why it would work fine for so long and then suddenly decide to 
stop and even not open after reinstallation.  I would appreciate it if someone 
could help me troubleshoot how to get it up and running again.

--
assignee: ronaldoussoren
components: Macintosh
messages: 181976
nosy: flynn11, ronaldoussoren
priority: normal
severity: normal
status: open
title: crash
type: crash
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



[issue17193] Use binary prefixes

2013-02-12 Thread Brett Cannon

Brett Cannon added the comment:

LGTM

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



[issue17193] Use binary prefixes

2013-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes I have seen these tips and they look complicated enough. Here is an updated 
patch with spaces between numbers and units.

--
Added file: http://bugs.python.org/file29052/binary_prefixes_2.patch

___
Python tracker 

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



[issue13555] cPickle MemoryError when loading large file (while pickle works)

2013-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 680959a3ae2e by Serhiy Storchaka in branch '2.7':
Issue #13555: cPickle now supports files larger than 2 GiB.
http://hg.python.org/cpython/rev/680959a3ae2e

--
nosy: +python-dev

___
Python tracker 

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



[issue17195] Reading source code from file on exception

2013-02-12 Thread Florent Xicluna

Florent Xicluna added the comment:

Duplicate of #8087

--
nosy: +flox
resolution:  -> duplicate
status: open -> closed
superseder:  -> Unupdated source file in traceback

___
Python tracker 

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



[issue17195] Reading source code from file on exception

2013-02-12 Thread Julian

New submission from Julian:

When an exception occurs and a traceback is printed, the source code is read 
from the file which leads to confusion when the file has been modified, but the 
code that produced the exception still had the old code in memory.

--
components: Interpreter Core
messages: 181971
nosy: Mezgrman
priority: normal
severity: normal
status: open
title: Reading source code from file on exception
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-02-12 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I've updated Nick's patch so that test_dis and test_peephole pass again, and 
added a prototype ByteCode class (without any docs or tests for now, to allow 
for API discussion).

The prototype ByteCode is instantiated with any of the objects that 
get_instructions already accepts (functions, methods, code strings & code 
objects). Iterating over it yields Instruction objects. It has info(), 
show_info() and display_code() methods, which correspond to the code_info(), 
show_code() and disassemble() functions.

I've tried to go for names that make sense, rather than names that fit the 
existing pattern, because the existing pattern feels a bit messy. E.g. the 
show_code() function doesn't actually show the code, so I've called its method 
equivalent show_info().

--
nosy: +takluyver
Added file: http://bugs.python.org/file29051/dis_api.diff

___
Python tracker 

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



[issue17170] string method lookup is too slow

2013-02-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I left some comments on Rietveld.
> 
> I wonder if PyArg_ParseTupleAndKeywords can be replaced by something
> that would compute and cache the set of keywords; a bit like
> _Py_IDENTIFIER.

It would make sense indeed.

--

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-12 Thread Brett Cannon

Brett Cannon added the comment:

It might be ugly but it's also incorrect formatting to leave the space out. =) 
And I think it makes it harder to actually read the number.

If you really want to avoid the breaking you can use the tip at 
http://stackoverflow.com/questions/11830242/non-breaking-space or the Unicode 
\xa0 literal.

--

___
Python tracker 

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



[issue17194] operator.attrgetter is slow

2013-02-12 Thread Florent Xicluna

New submission from Florent Xicluna:

When two implementations give the same result, I use to run micro benchmarks to 
give me an hint.

I just noticed that attrgetter is slower than a lambda here:

$ python3.3 -m timeit -s 'from operator import attrgetter; n1 = 
attrgetter("__name__"); n2 = lambda s: s.__name__' 'rv = n1(int)'
100 loops, best of 3: 0.275 usec per loop
$ python3.3 -m timeit -s 'from operator import attrgetter; n1 = 
attrgetter("__name__"); n2 = lambda s: s.__name__' 'rv = n2(int)'
100 loops, best of 3: 0.347 usec per loop

(verified with 2.6, 2.7 and 3.3. But for 2.5 attrgetter is faster)


The function operator.itemgetter does not have same issue.
$ python3.3 -m timeit -s 'from operator import itemgetter; n1 = 
itemgetter("foot"); n2 = lambda s: s["foot"]; d = {"foot": 42}' 'rv = n1(d)'
1000 loops, best of 3: 0.122 usec per loop
$ python3.3 -m timeit -s 'from operator import itemgetter; n1 = 
itemgetter("foot"); n2 = lambda s: s["foot"]; d = {"foot": 42}' 'rv = n2(d)'
1000 loops, best of 3: 0.176 usec per loop

--
messages: 181967
nosy: flox
priority: low
severity: normal
status: open
title: operator.attrgetter is slow
type: performance

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, there is a little reason. It looks ugly if a line broken between number 
and unit (this is possible if we use space). A non-breakable space is better, 
but it seems that there is no easy way to specify it in ReST. I will be glad to 
be wrong.

--

___
Python tracker 

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



[issue17194] operator.attrgetter is slower than a lambda

2013-02-12 Thread Florent Xicluna

Changes by Florent Xicluna :


--
title: operator.attrgetter is slow -> operator.attrgetter is slower than a 
lambda

___
Python tracker 

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



[issue17170] string method lookup is too slow

2013-02-12 Thread Guido van Rossum

Guido van Rossum added the comment:

What's the status of Argument Clinic? Won't that make this obsolete?

--Guido van Rossum (sent from Android phone)

--

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-12 Thread Brett Cannon

Brett Cannon added the comment:

Patch looks good except for the consistent lack of space between number and 
unit, e.g. "5MiB" instead of "5 MiB". Is there a reason for this?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue17187] Python segfaults from improperly formed and called function

2013-02-12 Thread Benjamin Peterson

Benjamin Peterson added the comment:

In general, you can generate whatever junky bytecode you want, and the eval 
loop will happy crash itself. Your on your own when screwing with 
types.CodeType.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue9285] Add a profile decorator to profile and cProfile

2013-02-12 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

A preliminary patch for cProfile.py is in attachment. Will make changes to 
profile.py later.

--
Added file: http://bugs.python.org/file29050/profile.patch

___
Python tracker 

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



[issue17193] Use binary prefixes

2013-02-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Starting around 1998, a number of standards and trade organizations approved 
standards and recommendations for a new set of binary prefixes that would refer 
unambiguously to powers of 1024. According to these, the SI prefixes would only 
be used in the decimal sense, even when referring to data storage capacities: 
kilobyte and megabyte would denote one thousand bytes and one million bytes 
respectively (consistent with SI), while new terms such as kibibyte, mebibyte 
and gibibyte, abbreviated KiB, MiB, and GiB, would denote 1024 bytes, 1048576 
bytes, and 1073741824 bytes respectively.[1]

The proposed patch replaces old terms such as kB or KBytes by new terms such as 
KiB.

[1] http://en.wikipedia.org/wiki/Binary_prefix

--
assignee: docs@python
components: Documentation
files: binary_prefixes.patch
keywords: easy, patch
messages: 181961
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use binary prefixes
type: enhancement
Added file: http://bugs.python.org/file29049/binary_prefixes.patch

___
Python tracker 

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



[issue17192] libffi-3.0.12 import

2013-02-12 Thread Ronald Oussoren

Ronald Oussoren added the comment:

libffi_osx is not a copy of the regular libffi, but a (fairly old) fork. I 
don't know how far the two "branches" have diverged.  

An important feature  of liffi_osx is that is compiles cleanly when all intel 
and ppc related sources are compiled with '-arch ppc -arch i386 -arch x86_64' 
(that is, the relevant sources contain preprocessor guards to ensure the code 
in those files is only compiled for the right archictures). This greatly 
simplifies the build process because it is not necessary to build libffi a 
couple of times and then merge the resulting binaries.

I'm -0 at this point w.r.t. trying to remove libffi_osx, that tree works and 
I'll work on it anyway (it is also used in PyObjC).

--

___
Python tracker 

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



[issue17192] libffi-3.0.12 import

2013-02-12 Thread Matthias Klose

Changes by Matthias Klose :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue17136] ctypes tests fail with clang on non-OS X

2013-02-12 Thread Matthias Klose

Matthias Klose added the comment:

libffi-3.0.12 is now imported, tracked in issue #17192.

--

___
Python tracker 

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



[issue17192] libffi-3.0.12 import

2013-02-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7727be7613f9 by doko in branch 'default':
- Issue #17192: Import libffi-3.0.12.
http://hg.python.org/cpython/rev/7727be7613f9

--
nosy: +python-dev

___
Python tracker 

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



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread R. David Murray

R. David Murray added the comment:

I don't understand what you mean by removing dead code leading to loss of 
functionality, unless you mean that the removal of the call to the quoting code 
in Python3 led to a loss of functionality relative to Python2, in which case I 
agree.  It also led to the behavior being out of sync with the documentation.

Reviewing the history of the changes (see issue 1210), it appears to me that 
the removal of the call to _checkquote was in fact unintentional and is a bug 
(it existed in the port-to-python3 patch submitted by Victor, but was commented 
out, which probably means he had it commented out for testing and did not 
notice he had not restored it).  This makes the later removal of _checkquote 
incorrect as well.

This error is primarily a consequence of imaplib having very few tests.

This module needs a lot of love in Python3 from someone, and it is not an easy 
topic to wrap ones head around.  It's on my list of things to look at, but 
there are a bunch of things ahead of it.

For the immediate issue, it is working as documented in Python2.7, so there is 
nothing to do there.  For Python3 we haven't had the quoting since the start, 
so we have the opportunity to consider changing the quoting rules if we 
wish...and we may have have no choice, since the new behavior has been in 
released versions for several Python3 versions now and starting to quote like 
Python2.7 did might break otherwise working code.  I don't have an opinion on 
how to fix this this yet, since while I know more about the IMAP protocol than 
I did a year ago, I still don't know enough to even write the tests

--
components: +email
nosy: +barry

___
Python tracker 

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



[issue17192] libffi-3.0.12 import

2013-02-12 Thread Matthias Klose

New submission from Matthias Klose:

issue for tracking the libffi-3.0.12 import. checked that builds on 
x86_64-linux-gnu and arm-linux-gnueabihf do work.

still needs updating/checking the extra copies of:

 - libffi_arm_wince
 - libffi_msvc
 - libffi_osx

--
components: Extension Modules
messages: 181956
nosy: doko
priority: normal
severity: normal
status: open
title: libffi-3.0.12 import
versions: Python 3.4

___
Python tracker 

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



[issue17172] Add turtledemo to IDLE menu

2013-02-12 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Should this be added to Lib/idlelib/NEWS.txt ?

--

___
Python tracker 

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



[issue17172] Add turtledemo to IDLE menu

2013-02-12 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
keywords: +patch
Added file: http://bugs.python.org/file29048/issue.patch

___
Python tracker 

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



[issue17172] Add turtledemo to IDLE menu

2013-02-12 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Attached is a patch. I hope the File menu is the right place for this. I had to 
move the code in Lib/turtledemo.py after "if __name__ ==..." into main().

--

___
Python tracker 

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



[issue17189] Add zip64 support to shutil

2013-02-12 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> patch review
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue17187] Python segfaults from improperly formed and called function

2013-02-12 Thread Ramchandra Apte

Ramchandra Apte added the comment:

> Perhaps types.CodeType should refuse to generate the malformed code object in 
> the first place?
Yup.

--
nosy: +ramchandra.apte

___
Python tracker 

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



[issue17130] Add runcall() function to profile.py and cProfile.py

2013-02-12 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue9285] Add a profile decorator to profile and cProfile

2013-02-12 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue17170] string method lookup is too slow

2013-02-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I left some comments on Rietveld.

I wonder if PyArg_ParseTupleAndKeywords can be replaced by something that would 
compute and cache the set of keywords; a bit like _Py_IDENTIFIER.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue17191] pdb list shows unexpected code when stack frame includes a try / finally block

2013-02-12 Thread Abram Clark

New submission from Abram Clark:

The list command in pdb shows an unexpected portion of code after an up command 
enters a try / finally block in the call stack.

To reproduce:

pdb pdb_list_bug_reproduce.py
c
up
list

Expected behavior: Show 11 lines around line 8, "throw_something()", which was 
the entry point to the lower stack frame.

Actual behavior: Shows code centered around line 10, in the finally block, 
which is likely cleanup code that has nothing to do with the exception thrown.

--
files: pdb_list_bug_reproduce.py
messages: 181951
nosy: Abram.Clark
priority: normal
severity: normal
status: open
title: pdb list shows unexpected code when stack frame includes a try / finally 
block
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file29047/pdb_list_bug_reproduce.py

___
Python tracker 

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



[issue917120] imaplib: incorrect quoting in commands

2013-02-12 Thread Mauro Cicognini

Mauro Cicognini added the comment:

The removal of the dead code causes imaplib under py3k to lose the quoting 
functionality that is described in documentation (except for passwords, that do 
get always quoted as stated).

I submit that we give at least a temporary warning in the docs, and that the 
_quote() function is exposed to let the programmer do their own quoting when 
they feel it necessary.

--
nosy: +Mauro.Cicognini
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2013-02-12 Thread Torsten Bronger

Changes by Torsten Bronger :


--
nosy: +bronger

___
Python tracker 

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



[issue17136] ctypes tests fail with clang on non-OS X

2013-02-12 Thread Dirkjan Ochtman

Dirkjan Ochtman added the comment:

libffi-3.0.12 has been released with that fix. Perhaps that should be included 
in future Python releases?

--
nosy: +benjamin.peterson, georg.brandl, larry
priority: normal -> release blocker

___
Python tracker 

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



[issue12077] Harmonizing descriptor protocol documentation

2013-02-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue17190] _FAST opcodes do no range checking

2013-02-12 Thread Larry Hastings

Larry Hastings added the comment:

I'm not surprised it was discussed to death long ago.  And I can get behind 
wontfix.  But let me just say that

a) I think an uncrashable Python interpreter is a laudable goal, and steps we 
can take towards that should not be dismissed out of hand.

b) I doubt a range check would "kill" the performance of the _FAST operands.  
It'd be one lookup/compare/branch each, and the branch predictor would always 
guess correctly.  But I admit I have not tested it.

c) Anyway we needn't do it at runtime.  We could just as easily scan over the 
opcodes in the code object constructor and do the range checking there.  If we 
only did the check when the constructor was called directly from Python, it 
should have no measurable performance impact, only a maintenance cost.

d) I expect all these points were brought up in the original discussion.  I'd 
like to read that--but I can't find it.  Any pointers would be appreciated.

--

___
Python tracker 

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