[issue16032] IDLE 3.2 is crashing multiple times

2012-09-24 Thread Ned Deily

Ned Deily added the comment:

Odd, it works for me. Check to make sure it really got installed:

$ cd /Library/Frameworks/Tk.framework/
$ grep PATCH tkConfig.sh 
TK_PATCH_LEVEL='.11'

You could manually delete the frameworks and try installing again:

$ cd /Library/Frameworks
$ sudo rm -r ./Tcl.framework
$ sudo rm -r ./Tk.framework

--

___
Python tracker 

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



[issue16032] IDLE 3.2 is crashing multiple times

2012-09-24 Thread Omanand Jha Vatsa

Omanand Jha Vatsa added the comment:

I have tried re-installing to 8.5.11.1. Still same issue. I am on Mac OSX 
10.7.4 version.

--
status: pending -> open

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Victor Hooi

Victor Hooi added the comment:

Hi,

Aha, whoops, sorry Serhiy, didn't see your second message - I think you and I 
posted our last messages at nearly the same time...

Cool, looking forward to your patch =).

Also, is there any chance you could provide a more detailed explanation of 
what's going on? This is just me being curious about how it all works under the 
hood...

Cheers,
Victor

--

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Victor Hooi

Victor Hooi added the comment:

Hi,

I didn't have any buffering size set before, so I believe it defaults to 0 (no 
buffering), right? Wouldn't this be the behaviour on both 2.x and 3.x?

I'm using a 1.5 Mb bzip2 file - I just tried setting buffering to 1000 and 
100, and it didn't seem to make any noticeable difference to the speed of 
reading in the file. E.g.:

f = bz2.BZ2File(filename, 'rb', buffering=100)

What sort of values did you use in relation to your compressed file size to get 
the improvements?

Cheers,
Victor

--

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, I was able to restore performance (using same code as in zipfile). The 
patch will be later.

--

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks as bz2 in Python 3.3 has bad buffering. Reading by larger chunks shows 
the same speed in 2.7 and 3.3.

--
components: +Library (Lib) -None
nosy: +storchaka

___
Python tracker 

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



[issue15869] IDLE: Include .desktop file and icon

2012-09-24 Thread Roger Serwy

Roger Serwy added the comment:

I tried the provided .desktop files and they work with Gnome 3.4.

--
keywords: +easy
nosy: +serwy
title: Include .desktop file and icon -> IDLE: Include .desktop file and icon

___
Python tracker 

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



[issue16031] relative import headaches

2012-09-24 Thread Nick Coghlan

Nick Coghlan added the comment:

There is no magic bullet, but there are a whole mess of backwards compatibility 
constraints.

Closing this as a duplicate, because there's no clear resolvable RFE here 
beyond the known issues with circular imports and the differences between lazy 
and eager imports (already well documented in #992389, although potentially 
easier to resolve in 3.4 now that we have migrated to importlib).

Much of the rest of the complaint looks like a bug in pydev, as it appears to 
be running from a string *without creating an appropriate entry in sys.modules* 
first. Thus it *is* running through test_a twice due to the self import.

Many of these apparent import problems stem from poor reimplementations of 
import mechanics in tools like pydev and nose violating import system 
invariants. With importlib being used as the reference import implementation 
and the language reference finally including formally documented import 
semantics in 3.3+, this problem should hopefully reduce over time, as these ad 
hoc reimplementations are replaced by appropriate usage of importlib and runpy.

(Of course, the import system initialisation process is not without problems of 
its own, as PEP 395 describes)

--
nosy: +ncoghlan
resolution:  -> duplicate
status: open -> closed
superseder:  -> attribute error due to circular import
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue11103] Python 3.2 installer doesn't register file extensions on Windows 7

2012-09-24 Thread Roger Serwy

Roger Serwy added the comment:

The latest 3.2.3 release for Win7-64 registers the .py extensions properly, 
with "Open" and "Edit with IDLE". I'm closing this issue as out of date.

--
nosy: +serwy
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue16033] IDLE crashes when debugging and saving

2012-09-24 Thread Roger Serwy

Roger Serwy added the comment:

This was fixed in issue9803, but after the 3.2.3 release. I'm closing this 
issue as a duplicate.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> IDLE closes with save while breakpoint open

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +nadeem.vawda

___
Python tracker 

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



[issue16033] IDLE crashes when debugging and saving

2012-09-24 Thread Ned Deily

Ned Deily added the comment:

With 3.2.3 (on OS X), if I open a new edit window, enter a few files, save the 
file, set a breakpoint on a line, then save the file again (with or without 
having debug on), the following exception occurs but IDLE keeps running:

Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/tkinter/__init__.py",
 line 1399, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/MultiCall.py",
 line 166, in handler
r = l[i](event)
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/IOBinding.py",
 line 336, in save
self.editwin.store_file_breaks()
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py",
 line 214, in store_file_breaks
self.update_breakpoints()
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py",
 line 244, in update_breakpoints
linenumber_list = self.ranges_to_linenumbers(ranges)
  File 
"/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/idlelib/PyShell.py",
 line 250, in ranges_to_linenumbers
lineno = int(float(ranges[index]))
TypeError: float() argument must be a string or a number

In a quick attempt, I was not able to produce the same exception with 3.3.0rc3.

--
nosy: +serwy

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-09-24 Thread Victor Hooi

New submission from Victor Hooi:

Hi,

I was writing a script to parse BZ2 blogfiles under Python 2.6, and I noticed 
that bz2file (http://pypi.python.org/pypi/bz2file) seemed to perform much 
slower than with bz2 (native):

http://stackoverflow.com/questions/12575930/is-python-bz2file-slower-than-bz2

I wrote a dummy script that basically just reads through the file, one for bz2 
and one for bz2file (attached):

[vichoo@dev_desktop_vm Desktop]$ time /opt/python3.3/bin/python3.3 testbz2.py > 
/dev/null

real0m5.170s
user0m5.009s
sys 0m0.030s
[vichoo@dev_desktop_vm Desktop]$ time /opt/python3.3/bin/python3.3 
testbz2file.py > /dev/null

real0m5.245s
user0m4.979s
sys 0m0.060s
[vichoo@dev_desktop_vm Desktop]$ time /opt/python2.7/bin/python2.7 testbz2.py > 
/dev/null

real0m0.500s
user0m0.410s
sys 0m0.030s
[vichoo@dev_desktop_vm Desktop]$ time /opt/python2.7/bin/python2.7 
testbz2file.py > /dev/null

real0m5.801s
user0m5.529s
sys 0m0.050s

I also executed "echo 3 > /proc/sys/vm/drop_cache" between each run.

>From this, it appears that Python 2.x's bz2 is fast, but bz2file is slow - and 
>that Python 3.x's bz2 is slow.

Obviously, there could be an issue with the methdology above - however, if not, 
do you know if there are any performance regressions in bz2 from Python 2.x to 
3.x?

Thanks,
Victor

--
components: None
files: testbz2file.py
messages: 171216
nosy: victorhooi
priority: normal
severity: normal
status: open
title: bz2 module appears slower in Python 3.x versus Python 2.x
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file27288/testbz2file.py

___
Python tracker 

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



[issue16033] IDLE crashes when debugging and saving

2012-09-24 Thread Ned Deily

Ned Deily added the comment:

What operating system are you using?  Which python 3.2 are you using (i.e. a 
particular installer downloaded from python.org, built from source, etc)?  If 
known, which version of Tcl/Tk are you using?

--
nosy: +ned.deily

___
Python tracker 

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



[issue16033] IDLE crashes when debugging and saving

2012-09-24 Thread jimbo1qaz

New submission from jimbo1qaz:

Have the debugger open, stopped on a breakpoint, and save the open file. The 
whole thing will bomb after the save finishes. Changes are not lost, but I have 
to reopen IDLE and lose history and breakpoints.

--
components: IDLE
messages: 171214
nosy: jimbo1qaz
priority: normal
severity: normal
status: open
title: IDLE crashes when debugging and saving
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



[issue16032] IDLE 3.2 is crashing multiple times

2012-09-24 Thread Ned Deily

Ned Deily added the comment:

This is due to a bug in the current Cocoa Tk as released in ActiveTcl 8.5.12.1 
(and 8.5.12).  Try installing the previous ActiveTcl version, 8.5.11.1, which I 
just discovered is still available here:

http://downloads.activestate.com/ActiveTcl/releases/8.5.11.1/

--
assignee: ronaldoussoren -> ned.deily
nosy: +ned.deily
resolution:  -> duplicate
status: open -> pending
superseder:  -> IDLE crashes selecting Preferences menu with OS X ActiveState 
Tcl/Tk 8.5.12.1

___
Python tracker 

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



[issue16032] IDLE 3.2 is crashing multiple times

2012-09-24 Thread Omanand Jha Vatsa

New submission from Omanand Jha Vatsa:

Crashed multiple times on clicking Preferences in IDLE menu. It is crashing 
while trying to copying things from the IDLE shell.

--
assignee: ronaldoussoren
components: Macintosh
files: Python_2012-09-24-234004_BLMACPRO3137C.crash
messages: 171212
nosy: Omanand.Jha.Vatsa, ronaldoussoren
priority: normal
severity: normal
status: open
title: IDLE 3.2 is crashing multiple times
type: crash
versions: Python 3.2
Added file: 
http://bugs.python.org/file27287/Python_2012-09-24-234004_BLMACPRO3137C.crash

___
Python tracker 

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



[issue16001] small ints: cache string representation

2012-09-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

-1 for this entire effort.

--

___
Python tracker 

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



[issue16015] Incorrect startup header in tutorial

2012-09-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I don't mind fixing the year suggestion (in the interest of "realism" and for 
practice).

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16015] Incorrect startup header in tutorial

2012-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5f4841977bee by Chris Jerdonek in branch '3.2':
Issue #16015: Fix NameError doctest example in tutorial introduction.
http://hg.python.org/cpython/rev/5f4841977bee

New changeset dae33c2e916b by Chris Jerdonek in branch 'default':
Issue #16015: Merge fix from 3.2.
http://hg.python.org/cpython/rev/dae33c2e916b

New changeset 878c33d2f301 by Chris Jerdonek in branch '2.7':
Issue #16015: Fix NameError doctest example in tutorial introduction.
http://hg.python.org/cpython/rev/878c33d2f301

--
nosy: +python-dev

___
Python tracker 

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



[issue16031] relative import headaches

2012-09-24 Thread James Hutchison

New submission from James Hutchison:

This might even be a bug I've stumbled upon but I'm listing it as an 
enhancement for now.

I really feel that relative imports in Python should just work. Regardless of 
the __name__, I should be able to import below me. Likewise, it should work 
even if I've already done an import into the symbol table. It adds additional 
work to us as a developer to have to do some pythonpath or code gymnastics to 
get something rather trivial working. Additionally, the import errors from 
circular imports add another challenge to work around. In C/C++ you can force 
it to import a file once and only once, why can't Python work the same way?

Take the following example set-up:
startPoint.py
subModule1
   /__init__.py
   /a.py
   /b.py
   /tests
  /__init__.py
  /test_a.py

a's code:
print("in a");
from subModule1 import b

b's code:
print("in b");
from subModule1 import a

test_a.py's code:
print("myname:",__name__);
from .. import a

startPoint.py is empty, and the __init__.py files are also empty.

If I run a PyDev unit test on test_a.py this is what I get:

Finding files... done.
Importing test modules ... myname: subModule1.tests.test_a
in a
in b
myname: test_a
Traceback (most recent call last):
  File 
"C:\eclipse\plugins\org.python.pydev_2.6.0.2012062818\pysrc\pydev_runfiles.py", 
line 432, in __get_module_from_str
mod = __import__(modname)
  File "C:\myfolder/relativeImportTest/subModule1/tests\test_a.py", line 6, in 

from .. import a
ValueError: Attempted relative import in non-package

Clearly in this case, the exception given doesn't make any sense. I have 
__init__.py, the error says the relative import line is failing, and the error 
says it's because I'm in a non-package. Except, I'm in a package. It seems to 
go through the a_test.py file twice, even though I never explicitly import it. 
The first time through, I'm clearly in a package. The second time through, my 
name is NOT __main__ but yet I'm apparently no longer a package, which is where 
it fails.

Now if I change:
"from subModule1 import b" to "import subModule1.b"
and
"from subModule1 import a" to "import subModule1.a"

then everything works. But then that means I have to reference everything by 
the full name in my submodules. In this example, there's clearly a circular 
reference between a and b that wouldn't work anyways.

So lets change some things.

Now:
a.py:
import subModule1.b

b.py:
from subModule1 import a

Now the circular reference is gone between a and b. I really don't like having 
to do this as a means to work around a circular reference because it forces me 
to vary the import style of one file to another.

If we try the test code again however, it gets the same problem. If I swap 
which file does the relative import, then it works.

So lets make one last change:

test_a.py:
import subModule1.b # added
from .. import a

This will work, seemingly magically. It only runs the code in test_a.py once. 
Recall that the code in a.py is "import subModule1.b"

So basically this brings up several issues:
1. "import a.b" isn't the same as "from a import b" by more than how you 
reference it in the code
2. submodules are re-imported as non-module without ever importing them if you 
import their parent module relatively. If this is documented I don't know where.
3. import order can matter drastically to if a code runs or not for seemingly 
magical reasons.

And back when I was a beginner Python user, the naming convention of the full 
path really threw a monkey wrench in my code when I would try to move a select 
number of files from one project to another, or would try relative imports. If 
relative imports cause such headaches with circular references then I should 
generally stick to the full module path when referencing things. But if the 
full module path isn't portable then I should use relative imports.

Likewise, if I run as a PyDev unitTest, my module name is NOT __main__, so 
special path checks for __main__ won't work

I think the bottom line is that the import system gave me headaches as a 
beginner user and as an advanced user it still does every now and then so it 
really should be changed to something more intuitive or forgiving. I really 
shouldn't have to sit and think "how do I reference a function in the file just 
one directory level below mine?"

If there is already some magic bullet for this then it should probably be more 
visible.

--
components: Interpreter Core
messages: 171208
nosy: Jimbofbx
priority: normal
severity: normal
status: open
title: relative import headaches
type: enhancement
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



[issue16013] small csv reader bug

2012-09-24 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +needs review
stage:  -> test needed

___
Python tracker 

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



[issue16026] csv.DictReader argument names documented incorrectly

2012-09-24 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +easy
stage:  -> needs patch
versions:  -Python 2.6, Python 3.1, Python 3.4

___
Python tracker 

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



[issue16015] Incorrect startup header in tutorial

2012-09-24 Thread Éric Araujo

Éric Araujo added the comment:

Suggest closing: I think this causes no issue and changing it would have no 
benefit.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15612] Rewrite StringIO to use the _PyUnicodeWriter API

2012-09-24 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



[issue16030] xrange repr broken for large arguments

2012-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue16024] Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc

2012-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue16027] pkgutil doesn't support frozen modules

2012-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2012-09-24 Thread Neal Parikh

Neal Parikh added the comment:

I don't, but thanks for passing that along.

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-09-24 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #15612 for a possible optimization on StringIO (use 
_PyUnicodeWriter).

--

___
Python tracker 

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



[issue16001] small ints: cache string representation

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forgot to attach the new patch: small_ints_cache_str-2.patch optimizes 
also str % args (copy the string when needed if the reference count is not 1).

--
Added file: http://bugs.python.org/file27286/small_ints_cache_str-2.patch

___
Python tracker 

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



[issue16001] small ints: cache string representation

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Here is a micro benchmark:
---
# run it using:
# benchmark.py script bench_int_str.py [--file=output]
# https://bitbucket.org/haypo/misc/src/tip/python/benchmark.py

def run_benchmark(bench):
bench.timeit('S(123)', setup='S=str')
bench.timeit('S(1) == S(2)', setup='S=str')
bench.timeit('S(12345)', setup='S=str')
bench.timeit('{S(x): x for x in data}', setup='data=tuple(range(100)); 
S=str')
bench.timeit('"x=%s" % x', setup='x=123')
bench.timeit('"x=%s" % x', setup='x=12345')
---

Output:
---+-+---
Tests  |   unpatched |
patched
---+-+---
S=str; S(123)  |  158 ns (*) |  112 ns 
(-29%)
S=str; S(1) == S(2)|  329 ns (*) |  248 ns 
(-25%)
S=str; S(12345)|  161 ns (*) | 
161 ns
data=tuple(range(100)); S=str; {S(x): x for x in data} |   23 us (*) | 16.5 us 
(-28%)
x=123; "x=%s" % x  |  145 ns (*) |   133 ns 
(-8%)
x=12345; "x=%s" % x|  149 ns (*) | 
145 ns
---+-+---
Total  | 23.9 us (*) | 17.3 us 
(-27%)
---+-+---

I expected more important speedup.

--
Added file: http://bugs.python.org/file27285/bench_int_str.py

___
Python tracker 

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



[issue16001] small ints: cache string representation

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

My initial idea was to cache str(int) for any integer, but it may waste memory 
for huge numbers.

--

___
Python tracker 

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



[issue16009] Json error messages could provide more information about the error

2012-09-24 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue15954] No error checking after using of the wcsxfrm()

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What error message is most appropriate here?

Can we return the original string instead of exception?

--

___
Python tracker 

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



[issue15954] No error checking after using of the wcsxfrm()

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Dummy question: can you provide an example of strings that make wcsxfrm() 
> failing?

No, I can not (on Linux).

--

___
Python tracker 

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



[issue16013] small csv reader bug

2012-09-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file27284/csv_eof-3.2.patch

___
Python tracker 

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



[issue16013] small csv reader bug

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

>>> list(csv.reader(['foo,"']))
[['foo', '']]
>>> list(csv.reader(['foo,"'], strict=1))
Traceback (most recent call last):
  File "", line 1, in 
_csv.Error: unexpected end of data
>>> list(csv.reader(['foo,^'], escapechar='^'))
[['foo', '\n']]
>>> list(csv.reader(['foo,^'], escapechar='^', strict=1))
Traceback (most recent call last):
  File "", line 1, in 
_csv.Error: unexpected end of data

Is it good?

--
keywords: +patch
Added file: http://bugs.python.org/file27283/csv_eof-3.3.patch

___
Python tracker 

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



[issue16022] Mistake in "What's New in Python 3.3"

2012-09-24 Thread Georg Brandl

Georg Brandl added the comment:

Done.

--
status: open -> closed

___
Python tracker 

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



[issue15954] No error checking after using of the wcsxfrm()

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Dummy question: can you provide an example of strings that make wcsxfrm() 
failing?

--

___
Python tracker 

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



[issue16022] Mistake in "What's New in Python 3.3"

2012-09-24 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue16022] Mistake in "What's New in Python 3.3"

2012-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 35289291a2e6 by Victor Stinner in branch 'default':
Close #16022: What's New in Python 3.3 document is no more at beta stage
http://hg.python.org/cpython/rev/35289291a2e6

--
nosy: +python-dev
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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Opened issue #16030 for the repr issue.  The patch for this issue still lacks a 
fix for the stop value.

--

___
Python tracker 

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



[issue7897] Support parametrized tests in unittest

2012-09-24 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16022] Mistake in "What's New in Python 3.3"

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

@Georg: You should include this fix in Python 3.3 final.

@Raymond: FYI, I removed your warning :)

--
nosy: +georg.brandl, haypo, rhettinger
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue16030] xrange repr broken for large arguments

2012-09-24 Thread Mark Dickinson

New submission from Mark Dickinson:

Python 2.7.3+ (2.7:f51d11405f1d+, Sep 24 2012, 21:39:19) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> xrange(0, sys.maxint, sys.maxint-1)
xrange(0, -4, 9223372036854775806)

See also issue #16029.  There should be a common solution to both these issues. 
 Suggestion is to write a 'range_safe_stop' utility function that returns 
r->start + r->len * r->step clipped to the range [LONG_MIN, LONG_MAX], and use 
that for the stop value in both the repr and the pickle.

--
assignee: mark.dickinson
components: Library (Lib)
messages: 171193
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: xrange repr broken for large arguments
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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Okay, the xrange stop for both its pickle and its repr is computed as:

   r->start + r->len * r->step

If this overflows, it gives a bad value.  It would suffice to replace it with 
sys.maxint or -sys.maxint - 1 on overflow.

I'll look at this shortly.

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2012-09-24 Thread STINNER Victor

STINNER Victor added the comment:

Do you need this PEP?
http://www.python.org/dev/peps/pep-0335/

--
nosy: +haypo

___
Python tracker 

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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Removing 2.6:  this isn't a security issue.

--
stage:  -> patch review
versions:  -Python 2.6

___
Python tracker 

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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Here's the fix.  There's a commented out test, which fails because of the 
second xrange bug (or something closely related to it).

--
keywords: +patch
Added file: http://bugs.python.org/file27282/issue16029.patch

___
Python tracker 

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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

The bug is (not surprisingly) in range_reduce in Objects/rangeobject.c, where 

return Py_BuildValue("(O(iii))", Py_TYPE(r),

should be

return Py_BuildValue("(O(lll))", Py_TYPE(r),

But in writing tests for this bug, I fell over another one:


>>> import sys
>>> xrange(0, sys.maxint, sys.maxint-1)
xrange(0, -4, 2147483646)

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16029] pickle.dumps(xrange(sys.maxsize)) produces xrange(0)

2012-09-24 Thread akira

New submission from akira:

>>> import sys
  >>> from pickle import dumps, loads
  >>> r = xrange(sys.maxsize)
  >>> len(r) == sys.maxsize
  True
  >>> pr = loads(dumps(r))
  >>> len(pr) == len(r)
  False
  >>> pr
  xrange(0)
  >>> r
  xrange(9223372036854775807)

It breaks multiprocessing module:
http://stackoverflow.com/questions/12569977/python-large-iterations-number-fail

It fails on 2.6.6, 2.7.3. It works correctly on 3.1-3.3, pypy 1.7-1.9  x86_64 
Linux.

--
components: Library (Lib)
files: test_pickle_dumps_xrange.py
messages: 171187
nosy: akira
priority: normal
severity: normal
status: open
title: pickle.dumps(xrange(sys.maxsize)) produces xrange(0)
type: behavior
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file27281/test_pickle_dumps_xrange.py

___
Python tracker 

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



[issue16013] small csv reader bug

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

A shorter example:

>>> import csv
>>> list(csv.reader(['foo,"']))
[]

--
nosy: +storchaka
type:  -> behavior
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



[issue16028] break in finally discards exception

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

That portion of the documentation has been restored.  Closing this issue.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
status: open -> closed
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Reclosing.

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f51d11405f1d by Mark Dickinson in branch '2.7':
Issue #14167: restore statement about breaks in finally clauses; remove 
statement about exception chaining.
http://hg.python.org/cpython/rev/f51d11405f1d

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Yury Selivanov

Yury Selivanov added the comment:

thanks!

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks for the quick fix!  Patch applied to 3.2 and 3.3

The 2.7 commit also introduced an incorrect statement about exception chaining; 
 I'll look at fixing that.

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 485902ecf0ee by Mark Dickinson in branch '3.2':
Issue #14167: restore statement about breaks in finally clauses.
http://hg.python.org/cpython/rev/485902ecf0ee

New changeset f5ed3a5440b2 by Mark Dickinson in branch 'default':
Issue #14167: merge fix from 3.2 branch.
http://hg.python.org/cpython/rev/f5ed3a5440b2

--

___
Python tracker 

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



[issue16028] break in finally discards exception

2012-09-24 Thread Yury Selivanov

Yury Selivanov added the comment:

see the issue 14167

--
nosy: +yselivanov

___
Python tracker 

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



[issue16028] break in finally discards exception

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Hmm.  Yes, true.  Either way, it's the docs that need to be fixed rather than 
the behaviour.

Thanks for catching this!

--

___
Python tracker 

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



[issue16028] break in finally discards exception

2012-09-24 Thread Erik Allik

Erik Allik added the comment:

It looks to me that it was not removed from the doc but explicitly changed to 
say that 'break' does not cause the exception to be discarded, unless I'm 
misunderstanding it:

1.20 +:keyword:`finally` clause is executed.  If there is a saved exception
1.21 +or :keyword:`break` statement, it is re-raised at the end of the
1.22 +:keyword:`finally` clause. If the :keyword:`finally` clause raises

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Yury Selivanov

Yury Selivanov added the comment:

OK.

Attaching the patch.  Please review.

--
Added file: http://bugs.python.org/file27280/finally_doc_patch.patch

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Yury:  I don't think there's any need for yet another issue;  this one will do 
(or if you prefer, attach the patch to issue 16028.)

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Yury Selivanov

Yury Selivanov added the comment:

I'll open another issue and will attach a patch.

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Yury Selivanov

Yury Selivanov added the comment:

Can you close this one?  It's already merged.

--
nosy: +yselivanov

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Bah.  Issue 16028;  sorry.

--

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

See also issue 16021.  Re-opening this issue for reconsideration.

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

___
Python tracker 

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



[issue14167] document return statement in finally blocks

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

I think something went wrong with this doc change.  The docs used to say:

"""
If the :keyword:`finally` clause raises another exception or executes a 
:keyword:`return` or :keyword:`break` statement, the saved exception is lost.
"""

Now we have:

"""
If there is a saved exception or :keyword:`break` statement, it is re-raised at 
the end of the :keyword:`finally` clause.
"""

which doesn't make much sense (what does 'it' refer to in the case of a 'break' 
statement), and we seem to have lost the explicit statement that a 'break' in a 
finally cause swallows exceptions.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16028] break in finally discards exception

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

This *was* a documented feature until very recently;  it looks as though a 
recent doc change inadvertently removed it from the documentation.  See

http://hg.python.org/cpython/rev/bef098bd3fa5

and the associated issue, issue 14167.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16028] break in finally discards exception

2012-09-24 Thread Erik Allik

New submission from Erik Allik:

This is either a bug, or a very weird but undocumented feature/caveat.


def fn1():
while True:
try:
raise Exception()
finally:
pass
def fn2():
while True:
try:
raise Exception()
finally:
break  # <-
fn1()  # exception, as expected
fn2()  # silence!

--
messages: 171168
nosy: eallik
priority: normal
severity: normal
status: open
title: break in finally discards 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



[issue16011] "in" should be consistent with return value of __contains__

2012-09-24 Thread Neal Parikh

Neal Parikh added the comment:

Thanks for passing along the thread, it was interesting. Oddly, it seemed to 
die off with no real resolution.

I realize it is now too late to change __contains__ to return a non-boolean 
value, but for reference, the reason I wanted to return something different 
from __contains__ was also to implement a DSL, though not a SQL-related one. 
Basically, I have some kind of abstract mathematical set S, and I wanted "x in 
S" to return a constraint that the variable x must lie in the set S for use in 
a larger problem description. (In fact, one could implement __contains__ so it 
returned True/False with a constant numeric argument and a constraint object 
with a variable argument.) This would have mirrored the way one would write all 
this mathematically.

--

___
Python tracker 

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



[issue16027] pkgutil doesn't support frozen modules

2012-09-24 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



[issue16021] In a table in PEP 235, brrrrrrrr should be N/A

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Closing.  This doesn't appear to have caused any confusion in the 11 years  
since the PEP was written.

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



[issue16027] pkgutil doesn't support frozen modules

2012-09-24 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Correction: the helper function is called imp.get_frozen_object().

--

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, I was wrong.

I think that the proposed changes should be applied in 
set_difference_update_internal() directly.

--

___
Python tracker 

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



[issue16027] pkgutil doesn't support frozen modules

2012-09-24 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

pkgutil is used by runpy to run Python modules that are loaded via the -m 
command line switch.

Unfortunately, this doesn't work for frozen modules, since pkgutil doesn't know 
how to load their code object (this can be had via imp.get_code_object() for 
frozen modules).

We found the problem while working on eGenix PyRun (see 
http://www.egenix.com/products/python/PyRun/) which uses frozen modules 
extensively. We currently only target Python 2.x, so will have work around the 
problem with a patch, but Python 3.x still has the same problem.

--
components: Library (Lib)
messages: 171163
nosy: lemburg
priority: normal
severity: normal
status: open
title: pkgutil doesn't support frozen modules
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Michele Orrù

Michele Orrù added the comment:

What do you mean by "does not preserve set identity"? Because I see: 

$ ./python.exe
Python 3.3.0rc2+ (default:178f9042af81+, Sep 24 2012, 18:54:31) 
[GCC 4.2.1 Compatible Apple Clang 2.1 (tags/Apple/clang-163.7.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = set(range(1))
[65967 refs]
>>> b = set(range(20))
[65989 refs]
>>> id(a)
4540421032
[65992 refs]
>>> a -= b
[65991 refs]
>>> id(a)
4540421032

--

___
Python tracker 

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



[issue16026] csv.DictReader argument names documented incorrectly

2012-09-24 Thread Peter Eisentraut

New submission from Peter Eisentraut:

The documentation for the csv.DictReader constructor is

.. class:: DictReader(csvfile, fieldnames=None, restkey=None, restval=None, 
dialect='excel', *args, **kwds)

but the implementation is

def __init__(self, f, fieldnames=None, restkey=None, restval=None, 
dialect="excel", *args, **kwds):

The name of the first argument is documented incorrectly, leading to surprise 
errors when attempting to use key word arguments.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 171161
nosy: docs@python, petere
priority: normal
severity: normal
status: open
title: csv.DictReader argument names documented incorrectly
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, 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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords:  -easy

___
Python tracker 

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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Michele, in any case you patch is not preserve set identity.

--

___
Python tracker 

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



[issue16024] Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc

2012-09-24 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



[issue15963] Improve ./configure's support for 32/64-bit debug|release|profiled builds w/ vendor (non-gcc) compilers on proprietary UNIX systems (Solaris/HP-UX/AIX et al).

2012-09-24 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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> $ ./python.exe -m timeit  -n 100 -s "s= set(range(2000)); l = 
> set(range(2000))"   "s-=l"

s is empty set after first loop. Try this:

$ ./python.exe -m timeit  -n 100 -s "s= set(range(2000)); l = 
set(range(2000,2000+2000))"   "s-=l"

--

___
Python tracker 

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



[issue16021] In a table in PEP 235, brrrrrrrr should be N/A

2012-09-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Is this really necessary?  I suggest closing this as 'wont fix'.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue16025] Minor corrections to the zipfile documentation

2012-09-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue16025] Minor corrections to the zipfile documentation

2012-09-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file27279/doc_zipfile-2.7.patch

___
Python tracker 

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



[issue16025] Minor corrections to the zipfile documentation

2012-09-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file27278/doc_zipfile-3.2.patch

___
Python tracker 

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



[issue16025] Minor corrections to the zipfile documentation

2012-09-24 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch corrects a few markup errors in the zipfile documentation 
and adds a few relevant hyperlinks.

--
assignee: docs@python
components: Documentation
files: doc_zipfile-3.3.patch
keywords: patch
messages: 171157
nosy: docs@python, storchaka
priority: normal
severity: normal
status: open
title: Minor corrections to the zipfile documentation
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file27277/doc_zipfile-3.3.patch

___
Python tracker 

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



[issue16024] Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc

2012-09-24 Thread Larry Hastings

New submission from Larry Hastings:

You know how you start pulling on a thread and before you notice you've 
unraveled the whole sweater?  I meant to do a simple *one line* fix on the docs 
and wound up with a nearly-300-line diff.  I claim it's all an improvement, 
though I'm willing to change it if there's something you don't like.

Definite improvements:
* supports_fd et al are :class:`set` objects, not :class:`~collections.Set`.  
Those are different.
* Linked to the "specifying a file descriptor" section in os from the relevant 
discussion in what's new.
* "Availability: Unix" goes above :versionadded.

Avowed improvements:
* supports_* now explicitly mention what values are permitted for their 
parameters.
* Lots of rewriting/munging in an effort to improve readability and precision.
* A couple places where "it's" read better than "it is".

LGTU?

--
assignee: larry
components: Documentation
files: lch.supports_set.doc.cleanup.1.diff
keywords: patch
messages: 171155
nosy: georg.brandl, larry
priority: normal
severity: normal
stage: patch review
status: open
title: Doc cleanup regarding path=fd, dir_fd, follow_symlinks, etc
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file27276/lch.supports_set.doc.cleanup.1.diff

___
Python tracker 

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



[issue16023] IDLE froze when typing ctrl-shift-5

2012-09-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

What version of OSX do you use? 

Do you have ActiveState TCL installed, and if so, which version?

Does 'Ctrl+Shift+5' insert a special character in the keyboard layout you use? 

BTW. I cannot reproduce this on my machine (OSX 10.8.2) with a recent snapshot 
of the 3.2 branch.

--

___
Python tracker 

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



[issue16023] IDLE froze when typing ctrl-shift-5

2012-09-24 Thread Zellmeyer

New submission from Zellmeyer:

IDLE do not response and you have to force to quit when you type the bad 
combination ctrl-shift-5.

I find it on my macbook when i try do type a [ character and type the bad 
combination by mistake because the keyboard are not exactly the same as the 
iMac.

--
assignee: ronaldoussoren
components: IDLE, Macintosh
messages: 171154
nosy: ronaldoussoren, szellmeyer
priority: normal
severity: normal
status: open
title: IDLE froze when typing ctrl-shift-5
type: crash
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



[issue8425] a -= b should be fast if a is a small set and b is a large set

2012-09-24 Thread Michele Orrù

Michele Orrù added the comment:

woops, sry. Re-posting the benchmark, with three tests: the first one proposed 
(@abacabadabacaba) with very large sets; another one with smaller sets.

$ ./python.exe -m timeit  -n 100 -s "s= set(range(2000)); l = 
set(range(2000))"   "s-=l"
100 loops, best of 3: 9.71 usec per loop
[48787 refs]

$ ./python.exe -m timeit  -n 100 -s "s= set(range(1)); l = set(range(20))"   
"s-=l"
100 loops, best of 3: 0.366 usec per loop


$ hg co -C
$ make -j3

[!PATCHED]--
$ ./python.exe -m timeit  -n 100 -s "s= set(range(2000)); l = 
set(range(2000))"   "s-=l"
100 loops, best of 3: 665 msec per loop
[48787 refs]

$ ./python.exe -m timeit  -n 100 -s "s= set(range(1)); l = set(range(20))"   
"s-=l"
100 loops, best of 3: 0.849 usec per loop
[48787 refs]

--

___
Python tracker 

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



[issue16020] Missing >>> in Python code example

2012-09-24 Thread Ezio Melotti

Ezio Melotti added the comment:

The code didn't have any output, so I created a separate code block with 
regular Python highlight -- no need to add >>>/... there.

--

___
Python tracker 

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



[issue16020] Missing >>> in Python code example

2012-09-24 Thread Ramchandra Apte

Ramchandra Apte added the comment:

This issue still does not appear to be fixed - looking at 
http://hg.python.org/cpython/file/101354f95a07/Doc/tutorial/stdlib2.rst .

And sorry, the URL should be 
http://docs.python.org/py3k/tutorial/stdlib2.html#tools-for-working-with-lists.

--

___
Python tracker 

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



[issue16022] Mistake in "What's New in Python 3.3"

2012-09-24 Thread Ramchandra Apte

New submission from Ramchandra Apte:

In "What's New in Python 3.3", there is a note:

Note: Beta users should be aware that this document is currently in draft form. 
It will be updated substantially as Python 3.3 moves towards release, so it’s 
worth checking back even after reading earlier versions.

If it is still in a draft form, replace "Beta users" with "Pre-release users" 
or something similar.
Else, obviously remove the note.

--
assignee: docs@python
components: Documentation
messages: 171150
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: Mistake in "What's New in Python 3.3"

___
Python tracker 

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



[issue16021] In a table in PEP 235, brrrrrrrr should be N/A

2012-09-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +tim_one
type:  -> enhancement

___
Python tracker 

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



[issue16020] Missing >>> in Python code example

2012-09-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for the report.  Minor clarification for future reference.  Subsequent 
lines should begin with "..." (when doctest-style is used):

>>> def breadth_first_search(unsearched):
... node = unsearched.popleft()
etc.

--
nosy: +chris.jerdonek

___
Python tracker 

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



  1   2   >