[issue12075] python3.2 memory leak when reloading class with attributes

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.2

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



[issue11945] Adopt and document consistent semantics for handling NaN values in containers

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.2

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



[issue14507] Segfault with deeply nested starmap calls

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.2

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



[issue12211] Better document math.copysign behavior.

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.2

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



[issue16809] Tk 8.6.0 introduces TypeError. (Tk 8.5.13 works)

2013-06-30 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Please commit the full patch in all active branches.

--

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



[issue18329] for line in socket.makefile() speed degradation

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

3.4 have same performance as 3.3.

--

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



[issue18328] Use after free in pystate.c

2013-06-30 Thread Charles-François Natali

Charles-François Natali added the comment:

Well, tstate is freed, but is not used afterwards, it's just comparing the 
pointer against the TLS.

--
nosy: +neologix

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



[issue11126] Wave.py does not always write proper length in header

2013-06-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue14507] Segfault with deeply nested starmap calls

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This looks as a duplicate of issue14010.

--
nosy: +serhiy.storchaka

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



[issue11126] Wave.py does not always write proper length in header

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't see anything wrong in current code. In first alternation data is an 
array of sampwidth-sized items and the number of written bytes is len(data) * 
self._sampwidth. In second alternation data is raw bytes object and the number 
of written bytes is just len(data).

Could you please provide a sample script which exposes the wrong behavior?

--

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



[issue18328] Use after free in pystate.c

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Seems it is not possible to write a test for this.

--
nosy: +serhiy.storchaka
stage: test needed - needs patch

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



[issue18178] Redefinition of malloc(3) family of functions at build time

2013-06-30 Thread koobs

koobs added the comment:

I've added a new FreeBSD 10.0-CURRENT buildbot to the pool (thanks antoine) 
that reproduces the issue and should provide sufficient coverage for testing 
the proposed patch:

http://buildbot.python.org/all/buildslaves/koobs-freebsd10

I'll upgrade the FreeBSD 9-STABLE buildbot once this is resolved

--
nosy: +koobs

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



[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-30 Thread Łukasz Langa

Łukasz Langa added the comment:

Having all information in place, I think it's acceptable for both of us
to implement preference for explicit registration, leaving both ways of
implicit registration as equally binding. The latter is future proof in
the sense that if we change our minds later, it's going to be easier to
lift the dispatch conflict than to introduce conflicts where there
weren't any before.

The point you're making about `Abc.register(Cls)` being external to the
definition of Cls and thus somewhat dependant on import order and other
machinery is what convinced me in the end. I also like the proposed
terminology and think it should appear in the documentation.

I created a modified patch. This wasn't as tricky as I feared but
required me to formulate an explicit rule: all implicit ABCs are
inserted in the MRO of a given class directly after the last explicit
ABC in the MRO of said class. One open question is what to do with the
algorithm described in PEP 443 which no longer describes the state of
things exactly. Although the said PEP is final, some parts of the
discussion on this issue just beg to be included in the Abstract base
classes section. What do you think we should do?

Answering your questions, neither scanning the source code nor using
a private attribute on ABCMeta can be considered an *obvious* way to
distinguish between registered and inferred ABCs. The former is static
analysis which might involve opening (and understanding) a number of
black boxes, the latter is fragile by definition and breaks the
abstraction (again, opening a black box). This is why we introduced
a public API to get the current cache token [1]_. As for dispatch
differences between MutableMapping and dict, it's in my previous message
(191947) on the issue, classes G and H.

On an unrelated note, thank you for correcting my English. It seems that
after achieving a level of fluency that is bearable to native speakers,
nobody corrects my mistakes anymore. This in turn places me in an
unfortunate plateau.

And yes, I'm well aware that my gut would win no popularity contest,
especially when the BDFL's one is a contender :-) I just hope this
doesn't automatically make the feelings of my own gut invalid.

.. [1] http://bugs.python.org/issue16832

--
Added file: http://bugs.python.org/file30733/issue18244.diff

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



[issue4199] add shorthand global and nonlocal statements

2013-06-30 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Closing and rejecting based on said discussion. 
http://mail.python.org/pipermail/python-dev/2013-June/127143.html

--
nosy: +gregory.p.smith
resolution:  - rejected
status: open - closed

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



[issue18305] [patch] Fast sum() for non-numbers

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Looks like this bug is CPython-specific, others (Jython, IronPython...) don't 
 have it, so people will move code that depends on the internal optimization 
 to other pythons that DO have it. :)

I don't know about IronPython, but Jython and PyPy have same behavior as 
CPython.

Even if the proposed implementation returns same result for common types, it 
may have different behavior for user types. Such changes should not do in 
bugfix releases, this is a new feature. I think that it is worthwhile to 
discuss the idea at first in the Python-Ideas mailing list [1]. But I suspect 
that most core developers will agree with Terry.

[1] http://mail.python.org/mailman/listinfo/python-ideas

--
nosy: +aleax
versions: +Python 3.4 -Python 2.7

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



[issue18331] runpy.run_path gives functions with corrupted .__globals__

2013-06-30 Thread Drekin

New submission from Drekin:

Let's have a simple script test.py:
def f():
return x
x = 2
print(f())

Now if we try to run it via runpy.run_path, we get the following:
 import runpy
 g = runpy.run_path(test.py)
2
 g[f]() is None
True
 g[x] is 2
True
 g[f].__globals__[x] is None
True

Is the behaviour of f.__globals__ after return from run_path intended and why?

--
components: Library (Lib)
messages: 192072
nosy: Drekin
priority: normal
severity: normal
status: open
title: runpy.run_path gives functions with corrupted .__globals__
type: behavior
versions: Python 3.3

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



[issue18328] Use after free in pystate.c

2013-06-30 Thread Christian Heimes

Christian Heimes added the comment:

I think it's unsafe. The address of a pointer should not be used once the 
pointer has been freed.

How about we reverse the order? At first we remove the key from TLS and then 
free the tstate.

--
keywords: +patch
Added file: http://bugs.python.org/file30734/tstate.patch

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



[issue18328] Use after free in pystate.c

2013-06-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

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



[issue18331] runpy.run_path gives functions with corrupted .__globals__

2013-06-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +ncoghlan

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



[issue18038] Unhelpful error message on invalid encoding specification

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19bc00996e74 by R David Murray in branch '3.3':
#18038: Use non-deprecated assert names in tests.
http://hg.python.org/cpython/rev/19bc00996e74

New changeset 29e7f6a2dc0d by R David Murray in branch 'default':
Null merge #18038: Use non-deprecated assert names in tests.
http://hg.python.org/cpython/rev/29e7f6a2dc0d

--

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



[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-30 Thread Łukasz Langa

Łukasz Langa added the comment:

Here's an improved patch which doesn't copy data between lists in `_c3_mro()` 
so much.

--
Added file: http://bugs.python.org/file30735/issue18244.diff

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



[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Christian Heimes

New submission from Christian Heimes:

Under rare circumstances listdir() could leak a FD:

- HAVE_FDOPENDIR is defined
- dup(fd) succeeds
- fdopendir() fails and sets dirp to NULL
- if (dirp == NULL) goto exit
- the dupped fd isn't closed because exit just handles dirp != NULL.

Proposed fix:

if (dirp != NULL) {
...
} else if (fd != -1) {
close(fd);
}


CID 992693 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle

--
components: Extension Modules
messages: 192077
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: _posix_listdir may leak FD
type: resource usage
versions: Python 3.3, Python 3.4

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



[issue18331] runpy.run_path gives functions with corrupted .__globals__

2013-06-30 Thread Richard Oudkerk

Richard Oudkerk added the comment:

When modules are garbage collected the associated globals dict is purged -- see 
#18214.  This means that all values (except __builtins__) are replaced by None.

To work around this run_path() apparently returns a *copy* of the globals dict 
which was created before purging.

--
nosy: +sbt

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



[issue18333] Memory leak in _pickle.c:Unpickler_set_memo()

2013-06-30 Thread Christian Heimes

New submission from Christian Heimes:

Unpickler_set_memo() has a memory leak when it is called with an empty 
dictionariy as argument

- PyDict_Check(obj) is true
- PyDict_Size(obj) returns 0
- _Unpickler_NewMemo(new_memo_size) calls PyMem_MALLOC(0)
- PyMem_MALLOC(0) returns a valid pointer although 0 bytes have been requested
- later on an error occurs: goto exit
- because new_memo_size == 0, PyMem_FREE(new_memo) is never executed

CID 983308 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable new_memo going out of scope leaks the storage it 
points to.

--
components: Extension Modules
messages: 192079
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Memory leak in _pickle.c:Unpickler_set_memo()
type: resource usage
versions: Python 3.3, Python 3.4

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



[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I think this is a duplicate of #17899.

--
nosy: +sbt

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



[issue18328] Use after free in pystate.c

2013-06-30 Thread Charles-François Natali

Charles-François Natali added the comment:

 I think it's unsafe. The address of a pointer should not be used once the 
 pointer has been freed.

Dereferencing a freed pointer is unsafe. A pointer is just an address,
there's nothing inherently unsafe with comparing a pointer with a
value. The only thing that could go wrong is if the same address was
reused in between which could end up screwing your code logic, but
since here the TLS can only be set by the current thread, I think it's
perfectly safe.

 How about we reverse the order? At first we remove the key from TLS and then 
 free the tstate.

Looks good to me!

--

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



[issue18332] _posix_listdir may leak FD

2013-06-30 Thread Christian Heimes

Christian Heimes added the comment:

You are right.

--
resolution:  - duplicate
status: open - closed
superseder:  - os.listdir() leaks FDs if invoked on FD pointing to a 
non-directory

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



[issue18189] IDLE Improvements: Unit test for Delegator.py

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The test_delegator patches were useful for working out and testing the use of 
the gui resource.

However, they are not appropriate for testing the Delegator class. It is a 
standalone class that has nothing to do with tkinter; in fact, the file has no 
imports. The test should be a normal text-only test. The only import needed is 
unittest.

Delegator has two unused methods. We can delete them, leaving just 4 methods to 
test.

--
stage: patch review - needs patch

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



[issue18189] IDLE Improvements: Unit test for Delegator.py

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a568a5426a16 by Terry Jan Reedy in branch '2.7':
Issue 18189: remove unused methods in idlelib.Delegator.Delegator.
http://hg.python.org/cpython/rev/a568a5426a16

New changeset 9d65716367c1 by Terry Jan Reedy in branch '3.3':
Issue 18189: remove unused methods in idlelib.Delegator.Delegator.
http://hg.python.org/cpython/rev/9d65716367c1

--
nosy: +python-dev

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



[issue18224] pyvenv pydoc.py script causing AttributeErrors on Windows

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af837bf390d0 by Vinay Sajip in branch '3.3':
Issue #18224: Removed pydoc script from created venv, as it causes problems on 
Windows and adds no value over and above python -m pydoc ...
http://hg.python.org/cpython/rev/af837bf390d0

New changeset de73e7ffabb3 by Vinay Sajip in branch 'default':
Closes #18224: Removed pydoc script from created venv, as it causes problems on 
Windows and adds no value over and above python -m pydoc ...
http://hg.python.org/cpython/rev/de73e7ffabb3

New changeset c17fa2cbad43 by Vinay Sajip in branch '3.3':
Issue #18224: Updated test.
http://hg.python.org/cpython/rev/c17fa2cbad43

New changeset ae69436eb7c2 by Vinay Sajip in branch 'default':
Issue #18224: Updated test.
http://hg.python.org/cpython/rev/ae69436eb7c2

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

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



[issue18288] Idle 2.7: Run Module does not set __file__

2013-06-30 Thread Roger Serwy

Roger Serwy added the comment:

See issue8515. The patch was not applied to 2.7.

--

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



[issue18318] Idle: stop depending on console output

2013-06-30 Thread Roger Serwy

Roger Serwy added the comment:

This looks similar to issue13582 with the patch to redirect console writes to a 
GUI text box.

--

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



[issue18189] IDLE Improvements: Unit test for Delegator.py

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I asked on the core-mentorship list about pydev test philosophy. I got useful 
answers from Nick and Antoine that can be summarized as We are pragmatic, not 
dogmatic. One may have to be a list member to read this link, but here it is.
http://mail.python.org/mailman/private/core-mentorship/2013-June/001855.html

I tried out multiple test methods, but decided that I preferred the continuous 
scenario in the patch that follows.

Because the code was written before the addition of sets, the private cache was 
a dict used as a set. I changed it to a set.

--

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



[issue18189] IDLE Improvements: Unit test for Delegator.py

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 231c122b44b6 by Terry Jan Reedy in branch '2.7':
Issue #18189: add test_delegator for Idle Delegator class.
http://hg.python.org/cpython/rev/231c122b44b6

New changeset c7605471e8ae by Terry Jan Reedy in branch '3.3':
Issue #18189: add test_delegator for Idle Delegator class.
http://hg.python.org/cpython/rev/c7605471e8ae

--

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



[issue18189] IDLE Improvements: Unit test for Delegator.py

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue8515] idle Run Module (F5) does not set __file__ variable

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a958b7f16a7d by Terry Jan Reedy in branch '2.7':
Issue #8515: Set __file__ when run file in IDLE. Backport 2c276d0553ff by
http://hg.python.org/cpython/rev/a958b7f16a7d

--

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



[issue18288] Idle 2.7: Run Module does not set __file__

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks Roger, problem fixed.

--
dependencies: +idle Run Module (F5) does not set __file__ variable
resolution:  - duplicate
stage: test needed - committed/rejected
status: open - closed

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



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Todd, do you have a Mac to test this on?

This patch treat sending messages to a widget as a backup option. In 18318 I 
propose we make Idle a true gui app, with all messages other than 'No tkinter' 
handled by the gui. Console writing, when available, would then be a secondary 
option for those who want it. But in the meanwhile, I would like this or 
something like it applied.

--
nosy: +Todd.Rovito

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13582
___
___
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-06-30 Thread Christian Heimes

Christian Heimes added the comment:

The macro W_SIZE at 
http://hg.python.org/cpython/file/dbdb6f7f9a1a/Python/marshal.c#l130 has 
introduced a reference leak at
http://hg.python.org/cpython/file/dbdb6f7f9a1a/Python/marshal.c#l390 . Because 
W_SIZE returns in an error case the reference count of PyObject *utf8 isn't 
decreased. 

CID 1040640 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable utf8 going out of scope leaks the storage it points 
to.

--
nosy: +christian.heimes
resolution: fixed - 
stage: committed/rejected - needs patch
status: closed - open

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



[issue18318] Idle: stop depending on console output

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The proposal here is to flip the roles of text console and graphics gui, rather 
than to indefinitely bandage the current roles. I would want that even with the 
patch for #13582 applied (which I hope can be done soon).

--

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



[issue15767] add ModuleNotFoundError

2013-06-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Hey Brett,

Sorry for reopening this issue.  I am confused by the spec for 
ModuleNotFoundError.  Look at this (in a pretty recent repo):

$ ./python.exe
Python 3.4.0a0 (default:8f22e03f5f07, Jun 27 2013, 08:49:16) 
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin
Type help, copyright, credits or license for more information.

[1]
 import bogus
Traceback (most recent call last):
  File stdin, line 1, in module
ModuleNotFoundError: No module named 'bogus'

[2]
 from re import bogus
Traceback (most recent call last):
  File stdin, line 1, in module
ModuleNotFoundError: cannot import name bogus

[3]
 import re.bogus
Traceback (most recent call last):
  File frozen importlib._bootstrap, line 1553, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named 're.bogus'; re is not a package

Given that it knows that re is not a package, I would have expected [2] not to 
raise ModuleNotFoundError, because there is no way that bogus could be a 
package.  OTOH, I would have expected [3] to raise ModuleNotFoundError, since 
this syntax implies that bogus is a submodule.

But perhaps I am missing something and I need to look at the distinction 
differently?  Sadly the docs don't really help me; they claim to explain why I 
get ModuleNotFoundError in [2], but the motivation as the specific attribute 
being requested cannot be known a priori to be a module or some other type of 
object seems wrong, given that [3] proves it *does* know.

(Aside, it's also odd that bogus is quoted in the error message for [1] and [3] 
but not for [2] -- in fact the phrasing of [2] compared to [1] seems 
arbitrarily different, both seem to tell me exactly the same thing.)

--
nosy: +gvanrossum
status: closed - open

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



[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Ok, let's do it.  I just sent you a review of your latest code (admitting I 
don't actually follow the logic in full detail, so I'm mostly harping on tests 
and comments...).

Regarding the PEP: feel free to update this.  Clearly nobody read it this 
carefully before...  Final in the Python world doesn't mean every typo 
remains forever and for PEPs this young that also applies to esoteric details 
that were perhaps not fully, or not correctly, specified before.

--

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



[issue17814] Popen.stdin/stdout/stderr documentation should mention object type

2013-06-30 Thread Nikolaus Rath

Changes by Nikolaus Rath nikol...@rath.org:


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

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



[issue17814] Popen.stdin/stdout/stderr documentation should mention object type

2013-06-30 Thread Nikolaus Rath

Nikolaus Rath added the comment:

patch attached.

--

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



[issue18331] Document that runpy.run_path and run_module copy the module globals

2013-06-30 Thread Nick Coghlan

Nick Coghlan added the comment:

As Richard said, the __globals__ attributes of the functions are pointing at 
the real module dictionary, which may have been cleared when the temporary 
module was destroyed.

However, I just checked the docs and they don't actually mention the fact that 
run_path and run_module currently return a copy of the globals - they say they 
return the resulting module globals dictionary.

Since I would prefer it if the functions actually worked as advertised, I 
suggest we document the namespace copying as a CPython implementation detail, 
rather than as a guaranteed feature. That way we can eliminate these copy 
operations once the module namespace purging has been eliminated.

Some related references:
   Don't purge module dicts before shutdown: issue 18214
   Don't purge module dicts at all: issue 812369
   More robust finalisation semantics: PEP 442
   
We should also tidy up the headings in the data model reference (
http://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy) 
so we can link directly to the section that mentions the CPython module 
clearing implementation detail this behaviour is designed to work around.

--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  - needs patch
title: runpy.run_path gives functions with corrupted .__globals__ - Document 
that runpy.run_path and run_module copy the module globals
type: behavior - enhancement
versions: +Python 2.7, Python 3.4

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



[issue6181] Tkinter.Listbox several minor issues

2013-06-30 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nikolaus Rath

New submission from Nikolaus Rath:

When using the three parameter form of type to create a new class, and any of 
the base classes has a metaclass with a __prepare__ function, the __prepare__ 
function is not executed:


   class CustomMetaclass(type):
  ... @classmethod
  ... def __prepare__(cls, name, bases):
  ...  return { 'prepared_for': name }
  ...
   class ParentClass(metaclass=CustomMetaclass):
  ... pass
  ...
   class ClassOne(ParentClass):
  ... pass
  ...
   ClassTwo = type('ClassTwo', (ParentClass,), {})
   ClassOne.prepared_for
  'ClassOne'
   ClassTwo.prepared_for
  'ParentClass'
   'prepared_for' in ClassOne.__dict__
  True
   'prepared_for' in ClassTwo.__dict__
  False


I am not sure if that is intended behavior or not. I am attaching a doc patch 
for the case that this is intended.

--
components: Interpreter Core
files: type_doc_patch.diff
keywords: patch
messages: 192099
nosy: Nikratio
priority: normal
severity: normal
status: open
title: type(name, bases, dict) does not call metaclass' __prepare__ attribute
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file30737/type_doc_patch.diff

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



[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread R. David Murray

R. David Murray added the comment:

Intentional is not perhaps the exactly right term, but it is working as 
expected.  There was a thread about this on python-dev (PEP 3115 compliant 
dynamic type creation and adding types.build_class for 3.3), that ultimately 
resulted in the addition of the 'new_class' function to the types module.  The 
documentation should probably just say that types doesn't handle metaclass 
__prepare__, and provide a link to the new_class function.

--
assignee:  - docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, ncoghlan, r.david.murray
versions: +Python 3.4

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



[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nick Coghlan

Nick Coghlan added the comment:

I think we should actually go further, and explicitly defer to 
http://docs.python.org/3/library/types#dynamic-type-creation for dynamic type 
creation.

Type shouldn't be called with arbitrary bases any more, precisely *because* 
doing so breaks __prepare__ handling. It's only safe to call a metaclass 
directly with arbitrary bases if you call types.prepare_class first:

mcl, namespace, kwds = types.prepare_class(name, bases)
cls = mcl(name, bases, namespace, **kwds)

You can only skip types.prepare_class if you *know* you already have the right 
metaclass (such as when there aren't any base classes defined).

--

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



[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nikolaus Rath

Nikolaus Rath added the comment:

In that cases, maybe type(name, cls, clsdict) should actually raise an error if 
there's a metaclass with __prepare__ involved?

Presumably that would break only code that was already broken, but it would 
convert previously hidden behavioral bugs into an explicit expressions raised 
at the right point.

--

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



[issue7136] Idle File Menu Option Improvement

2013-06-30 Thread Todd Rovito

Todd Rovito added the comment:

PING

It has been a month since Roger's last comment on the patch looking good, can 
somebody please commit or post feedback.  Thanks.

--
nosy: +terry.reedy

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



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Todd Rovito

Todd Rovito added the comment:

Yes I have a Mac and I am glad to help, so I gave it a test run tonight.  The 
first thing I did was apply the patch  then I ran idle from the console like so:
./python.exe Lib/idlelib/idle.py

For testing I used a simple print command to print to stderr:
sys.stderr.write(spam/n)

which I got the output of
spam/n6

I also tried to use the newer print function:
print(fatal error, file=sys.stderr)

Python 3.4 on the Mac behaved exactly the same way with or without the patch.  
I got the stderr output in the Python shell and nothing appeared in the 
console.  With the patch applied I saw no dialog box to capture the stderr 
output.  Maybe I didn't perform the test correctly?

Another thing to consider is for Mac IDLE runs in a special mode via 
macosxSupport.py which I turn on by forcing runningAsOSXApp() to always return 
True.  Even after setting runningAsOSXApp() to true a dialog box does not 
appear when writing to stderr.

Maybe I am not testing this patch correctly? Let me know if I can do anything 
else to help, thanks.

--

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



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Print in the user process goes to shell window. You need to stimulate (or just 
add) print or warn in the idle process, which normally goes to console, or 
nowhere. It is hard (intentionally, I am sure) to dynamically manipulate idle 
process code. Roger said try adding a raise Exception to a constructor for 
one of the extensions. I would start with a warning in PyShell. See doc or 
test_warnings for an example warnings call.

--
stage:  - test needed

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



[issue7136] Idle File Menu Option Improvement

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am planning to commit. PS. Shorter names that include '27', '33', etc, are 
easier to work with ;-).

--
assignee: roger.serwy - terry.reedy

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



[issue7136] Idle File Menu Option Improvement

2013-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26ef5d5d5c3e by Terry Jan Reedy in branch '2.7':
Issue #7136: In the Idle File menu, New Window is renamed New File.
http://hg.python.org/cpython/rev/26ef5d5d5c3e

New changeset c39ddff53694 by Terry Jan Reedy in branch '3.3':
Issue #7136: In the Idle File menu, New Window is renamed New File.
http://hg.python.org/cpython/rev/c39ddff53694

New changeset 5bc3d8d22a93 by Terry Jan Reedy in branch 'default':
(merge) Issue #7136: In the Idle File menu, New Window is renamed New File.
http://hg.python.org/cpython/rev/5bc3d8d22a93

--
nosy: +python-dev

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



[issue7136] Idle File Menu Option Improvement

2013-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For some reason, the idlelib/help.txt was reformatted with double indents (not 
sure I like this) for 3.4 but not 3.3. So parts of the patch against 3.4 would 
not apply to 3.3, which must be patched first. And the merge to 3.4 likewise 
failed for two files. We should have the same text for all versions except 
where is actually matters. Or replace with the doc, as proposed elsewhere. 

The 'new window' issue is Blank file editor window for a new file versus 
File editor window pre-loaded with existing file. New file captures the 
difference between the two where as New window is the same for both. So even 
native English speaker could be initially confused. When I tested, New file 
looks right. File / New may be standard on Windows, but File / New File looks 
fine to me.

Toby, thank you for sharing your experience. We need more of such, even if we 
have been slow to respond.

--

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



[issue7136] Idle File Menu Option Improvement

2013-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue18244] singledispatch: When virtual-inheriting ABCs at distinct points in MRO, composed MRO is dependent on haystack ordering

2013-06-30 Thread Gabriel Genellina

Changes by Gabriel Genellina ggenell...@gmail.com:


--
nosy: +ggenellina

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



[issue18335] Add textwrap.dedent, .indent, as str methods.

2013-06-30 Thread Terry J. Reedy

New submission from Terry J. Reedy:

To end proposals for new syntax to do what they do for triple-quoted strings. 
Nick Coghlan gave reasons as follows: run time cost small, can be optimized 
away, would be used more than some other string methods. 
http://mail.python.org/pipermail/python-ideas/2013-July/021717.html

In response, Guido said That's a compelling argument. Let's do it.
http://mail.python.org/pipermail/python-ideas/2013-July/021718.html

--
messages: 192109
nosy: ncoghlan, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: Add textwrap.dedent, .indent, as str methods.
type: enhancement
versions: Python 3.4

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



[issue18318] Idle: stop depending on console output

2013-06-30 Thread Gabriel Genellina

Changes by Gabriel Genellina ggenell...@gmail.com:


--
nosy: +ggenellina

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



[issue13582] IDLE and pythonw.exe stderr problem

2013-06-30 Thread Gabriel Genellina

Changes by Gabriel Genellina ggenell...@gmail.com:


--
nosy: +ggenellina

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



[issue18335] Add textwrap.dedent, .indent, as str methods.

2013-06-30 Thread SpaghettiToastBook

Changes by SpaghettiToastBook spaghettitoastb...@gmail.com:


--
nosy: +SpaghettiToastBook

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