[issue13519] Tkinter rowconfigure and columnconfigure functions crash if minsize, pad, or weight is not None

2011-12-02 Thread aoi.leslie

New submission from aoi.leslie :

Symptom:
When use tkinter Widget class's rowconfigure or columnconfigure function (The 
two functions are defined in baseclass Misc.) to get the setting for a row or 
column (The setting is a dict containing fields 'minsize', 'pad', 'weight', and 
'uniform'.), if field value of 'minsize', 'pad', or 'weight' is a positive 
integer instead of None, then error |TypeError: argument of type 'int' is not 
iterable| is raised. Field value of 'uniform' does not matter.

Speculation:
File |tkinter.__init__|, function |_grid_configure|, line 1279, code |elif '.' 
in value| caused this error. The code assumes the value is a str, but the value 
can be int.

Suggested Fix:
Change the code block around line 1279 to handle int value as well.

--
components: Tkinter
files: Reproduce.py
messages: 148752
nosy: aoi.leslie
priority: normal
severity: normal
status: open
title: Tkinter rowconfigure and columnconfigure functions crash if minsize, 
pad, or weight is not None
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file23835/Reproduce.py

___
Python tracker 

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



[issue13517] readdir() in os.listdir not threadsafe on OSX 10.6.8

2011-12-02 Thread Thouis (Ray) Jones

Thouis (Ray) Jones  added the comment:

Further testing indicates the problem is in the filesystem itself (either the 
server or client, but not in python).

Serializing the loops calling readdir / readdir_r fixes the problem on my 
system, but using either function in a large number of parallel threads causes 
some directory entries to be missed (usually 2 entries in a row, oddly enough). 
 I was also able to cause 'find' to fail in the same way by placing the 
filesystem under sufficient stress, which I hadn't managed to do before 
(leading me to trust the filesystem more than I should have).

I apologize for the noise.  I've closed this bug report.

--
status: open -> closed

___
Python tracker 

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



[issue11201] Python installation error 2203

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

corenova, can you try what Martin said?

--
nosy: +ezio.melotti
status: open -> pending

___
Python tracker 

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



[issue5689] Support xz compression in tarfile module

2011-12-02 Thread Éric Araujo

Éric Araujo  added the comment:

I’m perfectly happy to let Lars do it next week or next month, there is no 
rush.  The existing patch may even require very little or no change, as 
Nadeem’s module (in the stdlib) provides the same classes than the other lzma 
module which was used by the patch.

--

___
Python tracker 

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



[issue8414] Add test cases for assert

2011-12-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bcfb499338c1 by Ezio Melotti in branch '2.7':
#8414: add more tests for "assert".  Initial patch by Gregory Nofi.
http://hg.python.org/cpython/rev/bcfb499338c1

New changeset 1efefeda00a7 by Ezio Melotti in branch '3.2':
#8414: add more tests for "assert".  Initial patch by Gregory Nofi.
http://hg.python.org/cpython/rev/1efefeda00a7

New changeset 47afbb2033aa by Ezio Melotti in branch 'default':
#8414: merge with 3.2.
http://hg.python.org/cpython/rev/47afbb2033aa

--
nosy: +python-dev

___
Python tracker 

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



[issue8414] Add test cases for assert

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Committed, thanks for the patch!
I preferred to add a separate test, because only the tests with "assert False" 
need to be skipped with -O, the other can run with and without -O.

--
assignee:  -> ezio.melotti
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.3

___
Python tracker 

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



[issue13449] sched - provide an "async" argument for run() method

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Library (Lib)
stage:  -> patch review
type:  -> feature request

___
Python tracker 

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



[issue9530] integer undefined behaviors

2011-12-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also issue #13496.

--

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2011-12-02 Thread sbt

New submission from sbt :

The attached patch makes pickle use an object's __qualname__ attribute if 
__name__ does not work.

This makes nested classes, unbound instance methods and static methods 
picklable (assuming that __module__ and __qualname__ give the correct 
"address").


BTW, It would not be hard to make instance methods picklable (and, as a 
by-product, class methods) by giving instance methods a __reduce__ method 
equivalent to

  def __reduce__(self):
return (getattr, (self.__self__, self.__name__))

Is there any reason not to make such a change?

--
files: pickle_qualname.patch
keywords: patch
messages: 148759
nosy: pitrou, sbt
priority: normal
severity: normal
status: open
title: Patch to make pickle aware of __qualname__
versions: Python 3.3
Added file: http://bugs.python.org/file23836/pickle_qualname.patch

___
Python tracker 

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



[issue12005] modulo result of Decimal differs from float/int

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Extension Modules
stage:  -> patch review
type:  -> feature request

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2011-12-02 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



[issue12067] Doc: remove errors about mixed-type comparisons.

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Would it be ok to state that:
1) <, >, ==, >=, <=, and != compare the values of two objects;
2) the two objects don't necessarily have to be of the same type;
3) with == and !=, objects of different types compare unequal, unless they 
define a specific __eq__ and/or __ne__;
4) with <, >, <=, and >=, the comparison of objects of different types raises a 
TypeError, unless they define specific __lt__, __gt__, __le__, and __ge__;
5) some built-in types define these operations, so it's possible to compare 
e.g. int and floats;

This should summarize the possible behaviors.  There's no reason IMHO to expose 
implementation details and to special case built-in types (unless their 
comparison is actually different and doesn't depend on __eq__, __ne__, etc.).

--

___
Python tracker 

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



[issue12208] Glitches in email.policy docs

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

LGTM.

--
assignee: docs@python -> eric.araujo
nosy: +ezio.melotti
stage: patch review -> commit review

___
Python tracker 

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



[issue9420] gdbm with /usr/include/ndbm.h

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> patch review

___
Python tracker 

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



[issue11513] chained exception/incorrect exception from tarfile.open on a non-existent file

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> needs patch
type:  -> behavior
versions: +Python 2.7 -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



[issue2651] Strings passed to KeyError do not round trip

2011-12-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy:  -BreamoreBoy
versions: +Python 3.3

___
Python tracker 

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



[issue13513] IOBase docs incorrectly link to the readline module

2011-12-02 Thread Éric Araujo

Éric Araujo  added the comment:

That’s a known behavior of Sphinx.  Please go ahead and commit.

--
nosy: +eric.araujo
title: IOBase docs incorrectly link to the GNU readline module -> IOBase docs 
incorrectly link to the readline module

___
Python tracker 

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



[issue13513] IOBase docs incorrectly link to the readline module

2011-12-02 Thread Éric Araujo

Changes by Éric Araujo :


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



[issue13499] uuid documentation example uses invalid REPL/doctest syntax

2011-12-02 Thread Éric Araujo

Éric Araujo  added the comment:

Please add >>> and commit.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13513] IOBase docs incorrectly link to the readline module

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

+1

--
nosy: +ezio.melotti
stage: patch review -> commit review

___
Python tracker 

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



[issue13499] uuid documentation example uses invalid REPL/doctest syntax

2011-12-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d9e918c8d9d6 by Ezio Melotti in branch '2.7':
#13499: fix example adding >>> before the comments.
http://hg.python.org/cpython/rev/d9e918c8d9d6

New changeset 9e7728dc35e7 by Ezio Melotti in branch '3.2':
#13499: fix example adding >>> before the comments.
http://hg.python.org/cpython/rev/9e7728dc35e7

New changeset 060c7093a81f by Ezio Melotti in branch 'default':
#13499: merge with 3.2.
http://hg.python.org/cpython/rev/060c7093a81f

--
nosy: +python-dev

___
Python tracker 

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



[issue13499] uuid documentation example uses invalid REPL/doctest syntax

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Done!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
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



[issue13494] 'cast' any value to a Boolean?

2011-12-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2f9c986b46cd by Ezio Melotti in branch '2.7':
#13494: s/cast/convert/.  Also add a link.
http://hg.python.org/cpython/rev/2f9c986b46cd

New changeset 69369fd3514b by Ezio Melotti in branch '3.2':
#13494: s/cast/convert/.  Also add a link.
http://hg.python.org/cpython/rev/69369fd3514b

New changeset 454b97887c5a by Ezio Melotti in branch 'default':
#13494: merge with 3.2.
http://hg.python.org/cpython/rev/454b97887c5a

--
nosy: +python-dev

___
Python tracker 

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



[issue13494] 'cast' any value to a Boolean?

2011-12-02 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed!

@Eli
At least in the doc, I haven't seen any other suspicious use of 'cast'.

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage: needs patch -> 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



[issue13390] Hunt memory allocations in addition to reference leaks

2011-12-02 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

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



[issue13390] Hunt memory allocations in addition to reference leaks

2011-12-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The feature is interesting, but I'm not convinced that a very simple
> counter is enough to track memory leaks. It may help the CPython test
> suite, but what about real world application?

Good question. A simple counter is the only thing we can enable by default, 
though. Anything else would require recompiling Python, which is probably a 
barrier for most users.

> Did you already found real leaks using your hack^Wpatch? (was
> c6dafa2e2594 found by your tool?)

yes, c6dafa2e2594 was found with this patch. It's the only one, though (there's 
also a leak in test_ctypes but I don't want to investigate :-)).

--

___
Python tracker 

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



[issue13496] bisect module: Overflow at index computation

2011-12-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2011-12-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The attached patch makes pickle use an object's __qualname__ attribute
> if __name__ does not work.
> 
> This makes nested classes, unbound instance methods and static methods
> picklable (assuming that __module__ and __qualname__ give the correct
> "address").

Thanks. I'm not sure that's a good approach for protocol 3: some pickles
created by Python 3.3 would not be readable by Python 3.2. That's why I
initially added that idea to PEP 3154, for a hypothetical protocol 4.

However, perhaps it is possible to use the same reduce/getattr trick you
are proposing for instance methods?

> BTW, It would not be hard to make instance methods picklable (and, as
> a by-product, class methods) by giving instance methods a __reduce__
> method equivalent to
> 
>   def __reduce__(self):
> return (getattr, (self.__self__, self.__name__))
> 
> Is there any reason not to make such a change?

I don't see any personally. Actually, multiprocessing has a Pickler
subclass called ForkingPickler which does something similar (in
Lib/multiprocessing/forking.py).

--

___
Python tracker 

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



[issue9276] pickle should support methods

2011-12-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

PEP 3155 is now implemented (the __qualname__ attribute), making many more 
things potentially picklable. See PEP 3154 for a hypothetical new pickle 
protocol, and issue 13520 for a patch proposal.

--

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2011-12-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +alexandre.vassalotti

___
Python tracker 

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



[issue13439] turtle: Errors in docstrings of onkey and onkeypress

2011-12-02 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6e03ab9950f6 by Petri Lehtinen in branch '2.7':
Issue #13439: Fix many errors in turtle docstrings.
http://hg.python.org/cpython/rev/6e03ab9950f6

New changeset cc559e1e3bd8 by Petri Lehtinen in branch '3.2':
Issue #13439: Fix many errors in turtle docstrings.
http://hg.python.org/cpython/rev/cc559e1e3bd8

New changeset 8d60c1c89105 by Petri Lehtinen in branch 'default':
Issue #13439: Merge branch 3.2
http://hg.python.org/cpython/rev/8d60c1c89105

--
nosy: +python-dev

___
Python tracker 

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



[issue13439] turtle: Errors in docstrings of onkey and onkeypress

2011-12-02 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

Fixed, thanks!

--
resolution:  -> fixed
stage: needs patch -> 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



[issue12067] Doc: remove errors about mixed-type comparisons.

2011-12-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In Python 3, where all classes inherit from object, the default rules are, by 
experiment, (which someone can verify from the code) simpler than you stated.

3. By default, == and /= compare identities.
4. By default, order comparisons raise TypeError.
ob <= ob raises even though ob == ob because ob is ob.

I am not sure of the method look-up rules for rich comparisons, but perhaps the 
following are true:

3) with == and !=, an object is equal to itself and different objects (a is not 
b) compare unequal, unless the class of the first define a specific __eq__ and 
__ne__;

4) with <, >, <=, and >=, comparison raises a TypeError, unless the class of 
the first object defines specific __lt__, __gt__, __le__, and __ge__, or the 
class of the second defines the reflected method (__ge__ reflects __lt__, 
etcetera);

What is not clear to me is whether the reflected method is called if the first 
raises TypeError. The special method names doc (reference 3.3) says "A rich 
comparison method may return the singleton NotImplemented if it does not 
implement the operation for a given pair of arguments. 
...
There are no swapped-argument versions of these methods (to be used when the 
left argument does not support the operation but the right argument does); 
rather, __lt__() and __gt__() are each other’s reflection, __le__() and 
__ge__() are each other’s reflection, and __eq__() and __ne__() are their own 
reflection."

Does 'not supported' mean 'raises TypeError', 'returns NotImplemented', or 
both? If the last, I don't really understand the reason for NotImplemented 
versus TypeError. That point should be clarified in 3.3 also. And 3.3 should be 
referenced in the comparisons section.

I think point 5 should say a bit more: builtin numbers compare as expected, 
even when of different types; builtin sequences compare lexicographically.

--

___
Python tracker 

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



[issue13515] Consistent documentation practices for security concerns and considerations

2011-12-02 Thread Georg Brandl

Georg Brandl  added the comment:

Please propose a concrete new styling for the warnings; I think that should be 
done regardless of the other points.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue13390] Hunt memory allocations in addition to reference leaks

2011-12-02 Thread Meador Inge

Meador Inge  added the comment:

On Fri, Dec 2, 2011 at 12:12 PM, Antoine Pitrou  wrote:

> yes, c6dafa2e2594 was found with this patch. It's the only one, though 
> (there's also a leak in test_ctypes but I don't want to investigate :-)).

I'll take a look at the ctypes leak.

--
nosy: +meador.inge

___
Python tracker 

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



[issue13515] Consistent documentation practices for security concerns and considerations

2011-12-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Also consider writing a security howto guide so that the docs don't become 
littered with warnings.

--
nosy: +rhettinger

___
Python tracker 

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



[issue3907] "for line in file" doesn't work for pipes

2011-12-02 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 2.7 -Python 2.5

___
Python tracker 

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



[issue13495] IDLE: Regression - Two ColorDelegator instances loaded

2011-12-02 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 3.1

___
Python tracker 

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



[issue13506] IDLE sys.path does not contain Current Working Directory

2011-12-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

On 3.2.2, I get
>>> import sys
>>> sys.path
['C:\\Programs\\Python32\\Lib\\idlelib', 'C:\\Windows\\system32\\python32.zip', 
'C:\\Programs\\Python32\\DLLs', 'C:\\Programs\\Python32\\lib', 
'C:\\Programs\\Python32', 'C:\\Programs\\Python32\\lib\\site-packages', 
'F:\\Python']

so I presume the fix should include 3.2 and 3.3.

--
nosy: +terry.reedy
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



[issue13519] Tkinter rowconfigure and columnconfigure functions crash if minsize, pad, or weight is not None

2011-12-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Running on Win 7, 3.2.2, IDLE, I get
''' 
Traceback (most recent call last):
  File "F:\Python\mypy\tem.py", line 19, in 
the_rowconfigure_info = the_frame.rowconfigure(the_row_index)
  File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1326, in 
grid_rowconfigure
return self._grid_configure('rowconfigure', index, cnf, kw)
  File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1279, in 
_grid_configure
elif '.' in value:
TypeError: argument of type 'int' is not iterable
'''
(For tracker purposes, this is a graceful exit, not a crash - as in *nix 
segfault or equivalent Windows error box.)
'''
>>> help(Frame.rowconfigure)
Help on function grid_rowconfigure in module tkinter:

grid_rowconfigure(self, index, cnf={}, **kw)
Configure row INDEX of a grid.

Valid resources are minsize (minimum size of the row),
weight (how much does additional space propagate to this row)
and pad (how much space to let additionally).
'''
The above implies that setting uniform=1 (in your code) works because it is 
ignored. From docs on the web, it appears that 'uniform' is valid and is just 
missing from our doc string. It is different from the other three, though, in 
jperhaps not being restricted to int values.

You are right that (line 1259)
def _grid_configure(self, command, index, cnf, kw):
expects strings (which is what tcl uses). I do not know enough, though, to know 
where the bug is. I do notice, however, that setting with a Python int matches 
online Python examples and that the code runs without the attempt to read the 
config.

--
nosy: +gpolo, terry.reedy
type: crash -> behavior
versions: +Python 2.7, Python 3.3

___
Python tracker 

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



[issue9663] importlib should exclusively open bytecode files

2011-12-02 Thread Brett Cannon

Brett Cannon  added the comment:

Fixed by Issue13146.

--
resolution:  -> out of date
stage: test needed -> 
status: open -> closed
superseder:  -> Writing a pyc file is not atomic

___
Python tracker 

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



[issue11838] IDLE: make interactive code savable as a runnable script

2011-12-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Roger Serway pointed me to the PastePyShell.py extension that is part of the 
IdleX package http://idlex.sourceforge.net/ 
That does the conversion when *pasting* interpreter text into an edit window. I 
would have File/Save do the same thing when saving the shell text to a .py file.

--

___
Python tracker 

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



[issue13521] Make dict.setdefault() atomic

2011-12-02 Thread Raymond Hettinger

New submission from Raymond Hettinger :

A dialog on python-dev suggests that dict.setdefault() was intended to be 
atomic and that a number of experienced developers have deployed code relying 
on its atomicity:  
http://mail.python.org/pipermail/python-3000/2007-July/008693.html

The actual implementation shows a second call to PyDict_Setitem() which can 
call PyObject_Hash() which can call arbitrary Python code.   
http://hg.python.org/cpython/file/2.7/Objects/dictobject.c#l1937

This fix is straight-forward, use the results of the initial lookup to insert 
the default object.  This will make the operation atomic and it will make it 
faster.

--
components: Interpreter Core
messages: 148782
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Make dict.setdefault() atomic
type: behavior
versions: Python 2.7, Python 3.1, 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



[issue11838] IDLE: make interactive code savable as a runnable script

2011-12-02 Thread Roger Serwy

Roger Serwy  added the comment:

I considered saving directly from the shell but then I ran into a use-case 
problem. Saving the shell window as an runnable script will also save any 
syntax errors that were entered. A user would then have to open an editor to 
correct these errors.

A high-level task analysis would be as follows:
With "Save As Runnable", the user needs to save, open, and then fix.
With "Paste from Shell", the user needs to copy, paste, and then fix.


If you have suggestions for handling shell errors, I'm open to them.

--

___
Python tracker 

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



[issue13521] Make dict.setdefault() atomic

2011-12-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

+1.

--
nosy: +pitrou

___
Python tracker 

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



[issue13521] Make dict.setdefault() atomic

2011-12-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue13519] Tkinter rowconfigure and columnconfigure functions crash if minsize, pad, or weight is not None

2011-12-02 Thread aoi.leslie

aoi.leslie  added the comment:

Setting the config has no problem. Only reading has.

The config is read from Tk at line 1270 by code

res = self.tk.call('grid',
   command, self._w, index)

. If each of the four options (minsize, pad, uniform, and weight) has been set 
to value 1, |res|'s value after the tk call would be a tuple |('-minsize', 1, 
'-pad', 1, '-uniform', '1', '-weight', 1)|. This explains why |uniform|'s value 
does not cause problem, because it is a str, while the other three's are int. 
Also int 0 does not cause problem because it is handled at line 1277 by code

if not value:
value = None

so the resulting option value appears as None in rowconfigure or 
columnconfigure's resulting dict.

In my speculation, the bug is that, when converting from the tuple returned by 
tk call into the resulting dict to be returned by rowconfigure or 
columnconfigure, the converting code assumes that the option values in the 
tuple returned by tk call are all str. But somehow only |uniform|'s value is 
str, while other three's are int.

--

___
Python tracker 

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



[issue11838] IDLE: make interactive code savable as a runnable script

2011-12-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Either way, it would be nice to have erroneous commands flagged or filtered. 
That can be detected when the first line of output is 

Traceback (most recent call last):

I typically would copy, correct, and rerun a line until I get it correct, so I 
would want bad lines just removed. Others might prefer otherwise. I should take 
a look at your extension when I get a chance.

--

___
Python tracker 

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