[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-09 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



[issue17841] Remove missing aliases from codecs documentation

2013-05-09 Thread Nick Coghlan

Nick Coghlan added the comment:

For anyone else reading the issue and wondering about Ezio's question above - 
this issue was actually spun out from issue 7475, which covers the long saga of 
getting these codecs fully restored in the new world order of Python 3 :)

--

___
Python tracker 

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



[issue17947] Code, test, and doc review for PEP-0435 Enum

2013-05-09 Thread Ethan Furman

New submission from Ethan Furman:

PEP-0435 has been approved!

Now for lots of code review.

--
assignee: docs@python
components: Documentation, Library (Lib), Tests
files: ref435.py
hgrepos: 189
messages: 188812
nosy: barry, docs@python, eli.bendersky, stoneleaf
priority: normal
severity: normal
status: open
title: Code, test, and doc review for PEP-0435 Enum
versions: Python 3.4
Added file: http://bugs.python.org/file30191/ref435.py

___
Python tracker 

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



[issue17883] Fix buildbot testing of Tkinter

2013-05-09 Thread Martin v . Löwis

Martin v. Löwis added the comment:

> a) Is Windows Server 2003 is really meant to be spported?

Yes

> b) Are UNCs expected to behave differently on Server 2003?

No.

> c) Can UNCs be disabled on a particular machine?

I may misunderstand "can": yes, it is possible, but no, it is not desirable.

Zach: Temporarily committing changes to test specific buildbot issues is fine; 
asking the slave operator for direct access to the machine may also work.

--

___
Python tracker 

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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-05-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

if (PyLong_CheckExact(item) || (PyLong_Check(item) &&
item->ob_type->tp_as_number->nb_index == 
PyLong_Type.tp_as_number->nb_index))

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17282] document the defaultTest parameter to unittest.main()

2013-05-09 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue17828] More informative error handling when encoding and decoding

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

The attached proof of concept catches Type/ValueError in str.encode and raises 
another exception with a better message:
>>> 'example'.encode('hex_codec')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: invalid input type for hex_codec codec ('str' does not support the 
buffer interface)

(note: the patch doesn't handle the exception chaining yet and probably leaks.)

If Nick proposal in msg187704 is accepted, this should become a 
codecs.EncodeTypeError.  The same should then be done for bytes.decode and for 
codecs.encode/decode.

--
Added file: http://bugs.python.org/file30190/issue17828-2.diff

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

To summarize:
 * str.encode does only str->bytes;
 * bytes.decode does only bytes-> str;
 * codecs.encode/decode do obj->obj;

The things that could go wrong are:
 1) the input type is wrong (i.e. the codec doesn't accept the type of the 
input);
 2) the input value is invalid;
 3) for str.encode/bytes.decode only, the output type is wrong (i.e. the codec 
returned a non-bytes/non-str object);

My patch only covers 3.  The four new exceptions suggested by Nick in msg187704 
would cover the first 2 cases.
For str.encode/bytes.decode, if we knew the input type accepted by the codec we 
could also provide a better error message (e.g. "codecs accepts '...', not 
'...'; use ... instead"), but we don't.

--

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

The attached patch changes the error message of str.encode/bytes.decode when 
the codec returns the wrong type:

>>> import codecs
>>> 'example'.encode('rot_13')
TypeError: encoder returned 'str' instead of 'bytes', use codecs.decode for 
str->str conversions
>>> codecs.encode('example', 'rot_13')
'rknzcyr'
>>>
>>> b'000102'.decode('hex_codec')
TypeError: decoder returned 'bytes' instead of 'str', use codecs.encode for 
bytes->bytes conversions
>>> codecs.decode(b'000102', 'hex_codec')
b'\x00\x01\x02'

This only solves part of the problem though, because individual codecs might 
raise other errors if the input type is wrong:
>>> 'example'.encode('hex_codec')
Traceback (most recent call last):
  File "/home/wolf/dev/py/py3k/Lib/encodings/hex_codec.py", line 16, in 
hex_encode
return (binascii.b2a_hex(input), len(input))
TypeError: 'str' does not support the buffer interface

--
keywords: +patch
Added file: http://bugs.python.org/file30189/issue17828-1.diff

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Looks good to me, too.

--

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I think it looks good now. I'll probably just rewrite the test once you commit 
it.

--
keywords:  -needs review

___
Python tracker 

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



[issue17828] More informative error handling when encoding and decoding

2013-05-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Ezio pointed out on IRC that the extra type checks in str.encode, bytes.decode 
and bytearray.decode should reference the appopriate codecs module function in 
addition to the codec in use.

So if str.encode produces something other than bytes, it should reference 
codecs.encode, while the binary decoding methods should mention codecs.decode 
if they produce something other than str.

--

___
Python tracker 

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



[issue17841] Remove missing aliases from codecs documentation

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

@Nick
While this works as a short-term solution, I think it would be good to
 1) reintroduce the aliases in 3.4 (so that codecs.encode(b'foo', 'base64') 
works without spelling out the full codec name);
 2) either separate these codecs from the others, or tweak the error message of 
str.encode/bytes.decode to point to codecs.encode/decode.
Should I create a new issue and/or ask python-dev about this?

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
type: behavior -> enhancement
versions: +Python 3.4

___
Python tracker 

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



[issue17841] Remove missing aliases from codecs documentation

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ead47bc3a763 by Ezio Melotti in branch '3.3':
#17841: remove missing codecs aliases from the documentation.  Patch by Thomas 
Fenzl.
http://hg.python.org/cpython/rev/ead47bc3a763

New changeset eafff38a56cc by Ezio Melotti in branch 'default':
#17841: merge with 3.3.
http://hg.python.org/cpython/rev/eafff38a56cc

--
nosy: +python-dev

___
Python tracker 

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



[issue14878] Improve documentation for generator.send method

2013-05-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: needs patch -> committed/rejected
type:  -> enhancement
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



[issue14878] Improve documentation for generator.send method

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b8c0bf8fcb8 by Andrew Kuchling in branch '2.7':
#14878: add cross-reference to the yield statement.
http://hg.python.org/cpython/rev/7b8c0bf8fcb8

--
nosy: +python-dev

___
Python tracker 

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



[issue14878] Improve documentation for generator.send method

2013-05-09 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Thanks for the patch!

--
nosy: +akuchling
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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Guido van Rossum

Guido van Rossum added the comment:

cellfree4.diff.  Addressed review:

- Moved test to test_scope.py
- Added @cpython_only
- Fixed comment indent (and removed tabs :-)
- Fixed missing NULL test

I decided to keep the super() call; it's likely that it's tested elsewhere but 
I don't want to verify that there really is a test that puts self into a cell 
*and* uses super().

I also decided not to bother rewriting the test using weakrefs.  Let me know if 
you really want me to do that.

--
Added file: http://bugs.python.org/file30188/cellfree4.diff

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1fa70b797973 by Andrew Kuchling in branch '3.3':
#17700: update the curses HOWTO for 3.x
http://hg.python.org/cpython/rev/1fa70b797973

New changeset 70f530161b9b by Andrew Kuchling in branch 'default':
#17700: merge with 3.3
http://hg.python.org/cpython/rev/70f530161b9b

--
nosy: +python-dev

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-05-09 Thread A.M. Kuchling

A.M. Kuchling added the comment:

Applied to 3.3 and 3.4.  I'll leave this issue open for a week so that Victor 
can comment on Unicode/wide-characters.

--

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Guido van Rossum

Guido van Rossum added the comment:

I see. I really don't care, it's extremely rare to see a closure object.

--

___
Python tracker 

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



[issue11354] argparse: nargs could accept range of options count

2013-05-09 Thread paul j3

paul j3 added the comment:

This patch adds this `nargs='{m,n}'` or `nargs=(m,n)` feature.

It builds on the `better nargs error message` patch in 
http://bugs.python.org/msg187754

It includes an argparse.rst paragraph, changes to argparse.py, and additions to 
test_argparse.py.

The tests include those proposed by wm, rewritten to use the ParserTestCase 
framework where possible.  I did not give a lot of thought to test names.  The 
coverage could also use further thought.

As WM noted some range cases are the equivalent to existing nargs options 
('{1,}'=='+').  I did not attempt to code or test such equivalences.  Since the 
'{0,}' form uses regex matching just like '*',
I don't think there is any advantage to making such a translation.  

I convert the tuple version (m,n) to the re string '{m,n}' during the 
add_argument() testing.  So it is the string form that is added to the parser 
action.  This is also the format that appears in usage.

The documentation paragraph is:

'{m,n}'. m to n command-line arguments are gathered into a list. This is 
modeled on the Regular Expression use. '{,n}' gathers up to n arguments. '{m,}' 
gathers m or more. Thus '{1,}' is the equivalent to '+', and '{,1}' to '?'. A 
tuple notation is also accepted, '(m,n)', '(None,n)', '(m,None)'. For example:

>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo', nargs='{2,4}')
>>> parser.parse_args('--foo a b c'.split())
Namespace(foo=['a', 'b', 'c'])
>>> parser.parse_args('--foo a'.split())
usage: PROG [-h] [--foo FOO{2,4}]
PROG: error: argument --foo: expected {2,4} arguments

--
Added file: http://bugs.python.org/file30187/nargsrange.patch

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Consider the following testcase

class X:
def meth(self):
print(self)
super()

def f():
k = X()
def g():
return k
return g
c = f().__closure__[0]
X.meth(c)

With patch
$ ./python unboxing.py 


Without patch
$ ./python unboxing.py

Traceback (most recent call last):
  File "x.py", line 12, in 
X.meth(c)
  File "x.py", line 4, in meth
super()
TypeError: super(type, obj): obj must be an instance or subtype of type

Maybe you don't care. OTOH, perhaps it could be fixed by checking if the first 
argument is in fact a closure in super().

In the best world, super() would be syntax instead of a call, and we would just 
push the __class__ the closure and first argument in the interpreter loop.

--

___
Python tracker 

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



[issue17908] Unittest runner needs an option to call gc.collect() after each test

2013-05-09 Thread Michael Foord

Michael Foord added the comment:

The default test runner is quite horrible.

--

___
Python tracker 

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



[issue17883] Fix buildbot testing of Tkinter

2013-05-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Amaury and Martin: there is a problem on one machine with 
test.test_tcl.TclTest.testLoadWithUNC that you two jointly wrote, reviewed, and 
applied in #6470.

This issue (17883) is above getting the tcl/tk/tkinter tests to actually be run 
on 2.7, which they were not before. Zack's patch succeeded in doing that, and 
the tests all pass on all buildbots except (if I understand correctly) on one 
Snakebite machine "x86 Windows Server 2003 [SB] 2.7". 

(According to http://buildbot.python.org/all/builders/, the only other 
Server-2.7 bot is x86 Windows Server 2008 [SB] 2.7, and that seems not to have 
run these tests: the most recent(?) log says "test_tk skipped -- DLL load 
failed: The specified module could not be found.". But if I understand, this 
was back in January.)

With the original
   f = os.popen('%s -c "import Tkinter; print Tkinter"' % (unc_name,))
f.read() returns '', so 'Tkinter' is not found in the null string and the 
assertion that it is fails.

To get more info -- from an error traceback presumed to be on stderr -- we 
tried using subprocess.POpen instead and the child process startup fails with 
"WindowsError: [Error 5] Access is denied", so the Python import is never 
tried. Unless there is an error in the subprocess call or if Win Servers 
require a different version of UNC, it would seem that the test is not at 
fault. 

a) Is Windows Server 2003 is really meant to be spported?
b) Are UNCs expected to behave differently on Server 2003?
c) Can UNCs be disabled on a particular machine?
In other words, should we just ignore this error, and possibly catch it with 
'except WinError"?

--
nosy: +amaury.forgeotdarc, loewis

___
Python tracker 

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



[issue17936] O(n**2) behaviour when adding/removing classes

2013-05-09 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



[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-05-09 Thread STINNER Victor

STINNER Victor added the comment:

Alex> In my opinion that should use PyLong_CheckExact

+1

--
nosy: +haypo

___
Python tracker 

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



[issue17883] Fix buildbot testing of Tkinter

2013-05-09 Thread Zachary Ware

Zachary Ware added the comment:

I'm not sure where to go with this from here, without knowing more about what's 
going wrong.  Just to make sure there wasn't anything wrong with the Tcl/Tk 
build or some manner of issue with things not being properly cleaned up or 
something, I set the 'custom' builder on that buildbot to build cpython#2.7 and 
got the same result: 
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%20custom/builds/9

I've got a few changes lined up to try to get some more output (namely, add a 
'print cmd' to the test_tcl test, and hack up Tools/buildbot/test.bat to just 
run the Tcl/Tk tests in verbose mode to try and get something from 
test_ttk_guionly), but I don't think we want to pollute the main repository 
with them.  Which direction should we go from here?

--

___
Python tracker 

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



[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe

2013-05-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached script, test_initiate_send.py, tests initiate_send with
threads, causing duplicate writes and an IndexError. This is the
script output using python on the default branch:

$ python test_initiate_send.py
--- Test: duplicate data sent ---
chat.send('thread data')
chat.send('thread data')

--- Test: IndexError ---
chat.send('thread data')
chat.send('thread data')
Exception in thread Thread-2:
Traceback (most recent call last):
  File "Lib/threading.py", line 644, in _bootstrap_inner
self.run()
  File "Lib/threading.py", line 601, in run
self._target(*self._args, **self._kwargs)
  File "test_initiate_send.py", line 25, in 
thread = threading.Thread(target=lambda : chat.push('thread data'))
  File "Lib/asynchat.py", line 194, in push
self.initiate_send()
  File "Lib/asynchat.py", line 254, in initiate_send
del self.producer_fifo[0]
IndexError: deque index out of range


The script does not fail with Pierrick patch:

$ python test_initiate_send.py
--- Test: duplicate data sent ---
chat.send('main data')
chat.send('thread data')

--- Test: IndexError ---
chat.send('thread data')


The patch misses to also appendleft() 'first' when 'num_sent' is zero,
which may happen on getting EWOULDBLOCK on send().

--
nosy: +xdegaye
Added file: http://bugs.python.org/file30186/test_initiate_send.py

___
Python tracker 

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



[issue17946] base64 encoding result should be str, not bytes

2013-05-09 Thread R. David Murray

R. David Murray added the comment:

This has been discussed numerous times.  There are just as many times when you 
want the output to be binary (because you are about to send it on the wire).  
However, the deciding factor is that the API is now what it is, and changing it 
at this point would be backward incompatible, so we won't do that.

--
nosy: +r.david.murray
resolution:  -> rejected
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



[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2013-05-09 Thread Gregory HOULDSWORTH

Gregory HOULDSWORTH added the comment:

Splendid, it works and is indeed far more elegant.
Well done there, thanks.

--
resolution:  -> works for me

___
Python tracker 

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



[issue17946] base64 encoding result should be str, not bytes

2013-05-09 Thread Lucas Clemente Vella

New submission from Lucas Clemente Vella:

As stated in RFC 3548:

   Base encoding of data is used in many situations to store or transfer
   data in environments that, perhaps for legacy reasons, are restricted
   to only US-ASCII [9] data.

thus, I was surprised to see, when I used base64 for the first time in python 
3, that the encodig result was bytes, not str. Well, if I am encoding something 
to base64, I am most certainly needing it as a printable ASCII string, not as 
an binary byte array.

Thus, I suggest that the output of:
   base64.b64encode(data)
to be, instead, the output of:
   base64.b64encode(data).decode('ascii')

--
components: Library (Lib)
messages: 188786
nosy: Lucas.Vella
priority: normal
severity: normal
status: open
title: base64 encoding result should be str, not bytes
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-05-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Agreed with Eric. We're already modifying PEP 435 to do it that way.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2013-05-09 Thread Guilherme Polo

Guilherme Polo added the comment:

Here is a quick patch for it: http://pastebin.com/m1XQBGqU (I forgot my
password for the tracker, and leaving home right now).

Does it work for you ?

--

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Ok, here's a version with a unittest.  I've also improved the comment that set 
Nick off the track.

--
keywords: +patch
Added file: http://bugs.python.org/file30185/cellfree3.diff

___
Python tracker 

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



[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2013-05-09 Thread Guilherme Polo

Guilherme Polo added the comment:

Uh.. well observed.

It sounds like you are the first actual user of peer_create. Now I wish Tk
had done this in a different way: when creating a text widget, specificy
that it is a peer of some other text widget via an option ("-peer w" for
example).

If possible I would like to keep the functionality through the method
"peer_create" (and as a minor detail, newPathName should be None by default
-- it is easy to pick some name for the peer).

--

___
Python tracker 

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



[issue17858] Different documentation for identical methods

2013-05-09 Thread Andriy Mysyk

Andriy Mysyk added the comment:

Incorporated R. David Murray's feedback...

   .. method:: acquire(blocking=True, timeout=-1)

  Without any optional argument, this method acquires the lock
  unconditionally, if necessary waiting until it is released by another
  thread (only one thread at a time can acquire a lock).

  If *blocking* is ``False``, the call returns immediately.  If *blocking*
  is ``True``, the lock is acquired unconditionally. In both cases
  the return value indicates whether or not the lock was acquired.

  If the floating-point *timeout* argument is present and positive, it
  specifies the maximum wait time in seconds before returning; the return
  value indicates whether or not the lock was acquired.  A negative
  *timeout* argument specifies an unbounded wait and is the same as not
  specifying a *timeout* and also setting *blocking* to ``True``.  A zero
  *timeout* is the same as not specifying a *timeout* and setting *blocking*
  to ``False``.  You cannot specify a *timeout* if *blocking* is ``False``.

  The return value is ``True`` if the lock is acquired successfully,
  ``False`` if not.

--
Added file: http://bugs.python.org/file30184/issue17858.patch

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-05-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, fair enough.

--
status: closed -> open

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-05-09 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

http://mail.python.org/pipermail/python-dev/2013-April/125761.html asked to 
leave bugs open.

--

___
Python tracker 

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



[issue17945] tkinter/Python 3.3.0: peer_create doesn't instantiate Text

2013-05-09 Thread Gregory HOULDSWORTH

New submission from Gregory HOULDSWORTH:

Python version: 3.3.0 32bit
OS: Windows 7 Service Pack 1 64bit

The peer_create method of the Text class, introduced in changeset
<71041c0dedd5> in response to issue <2843> creates a tk text widget
but does not instantiate Text. Because they don't exist as Python
objects, we have to use tk.call() to manipulate them. This also breaks
the nametowidget method used with Text's peer_names, again because
these widgets don't exist in Python.

Following the inheritance of Text in /Lib/tkinter/__init__.py:2039
Text > Widget > BaseWidget, where the actual widget creation occurs
with a call to self.tk.call:

self.tk.call(
(widgetName, self._w) + extra + self._options(cnf))

We cannot smuggle in the tk command '.myoriginaltext peer create' as
a tuple in place of the widgetName ('text') because we end up with the
malformed argument:

((.myoriginaltext, 'peer', 'create'), .peer.path ...)

The attached file is my second attempt, using subclassing.
Lot of code duplication, ugly and not thoroughly tested: I'm hoping a
more elegant solution can be found.

--
components: Tkinter
files: pythonlevelpeers.py
messages: 188778
nosy: ghoul, gpolo
priority: normal
severity: normal
status: open
title: tkinter/Python 3.3.0: peer_create doesn't instantiate Text
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file30183/pythonlevelpeers.py

___
Python tracker 

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



[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-05-09 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue16741] `int()`, `float()`, etc think python strings are null-terminated

2013-05-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks, for 3.4 I will use new formatting feature.

--

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Patch LGTM.
You should commit it to 3.3 and then merge it with default (unless the patch 
contains parts that are specific to 3.4).

--

___
Python tracker 

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



[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-05-09 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree it should work the same as Enum, and I agree it should be possible to 
supply the module name. But wouldn't it be cleaner as:

Point = namedtuple('Point', 'x y z', module=__name__)

rather than:

Point = namedtuple(__name__ + '.Point', 'x y z')

?

--
nosy: +eric.smith

___
Python tracker 

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



[issue17700] Update Curses HOWTO for 3.4

2013-05-09 Thread A.M. Kuchling

A.M. Kuchling added the comment:

I've just verified that I still have commit access to the repo, so unless 
someone has any further suggested changes to the patch, I'll go ahead and 
commit it to trunk.  Should I also commit it to the 3.3 branch?

Victor: I'm willing to improve the HOWTO's discussion of Unicode/wide 
characters if you can point me at some references.

--

___
Python tracker 

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



[issue17938] Duplicate text in docs/reference/import statement

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report!

--
assignee: docs@python -> ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.4

___
Python tracker 

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



[issue17938] Duplicate text in docs/reference/import statement

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 844c6442a39e by Ezio Melotti in branch '3.3':
#17938: remove duplicate paragraphs.
http://hg.python.org/cpython/rev/844c6442a39e

New changeset ebc296bf23d1 by Ezio Melotti in branch 'default':
#17938: merge with 3.3.
http://hg.python.org/cpython/rev/ebc296bf23d1

--
nosy: +python-dev

___
Python tracker 

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



[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

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

___
Python tracker 

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



[issue17943] AttributeError: 'long' object has no attribute 'release' in Queue.put()

2013-05-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Waiters are created through _allocate_lock(), so you should look there.

But, unless you have further info, I don't think keeping this open as a bug is 
useful.

--

___
Python tracker 

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



[issue17809] FAIL: test_expanduser when $HOME ends with /

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dee0a2dea11e by Ezio Melotti in branch '3.3':
#17809: fix a test failure in test_expanduser when $HOME has a trailing /.  
Patch by Kubilay Kocak.
http://hg.python.org/cpython/rev/dee0a2dea11e

New changeset 489f075430de by Ezio Melotti in branch 'default':
#17809: merge with 3.3.
http://hg.python.org/cpython/rev/489f075430de

--
nosy: +python-dev

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-05-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't think so. The bug is fixed, and the fix will be in the release.

--

___
Python tracker 

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



[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-05-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Shouldn't it left opened until regression fix release has released.

--

___
Python tracker 

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



[issue16631] tarfile.extractall() doesn't extract everything if .next() was used

2013-05-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch for issue16601 has fixed this issue too.

--
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> Restarting iteration over tarfile continues from where it left 
off.

___
Python tracker 

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2013-05-09 Thread Michael Birtwell

Michael Birtwell added the comment:

Sorry about the delay in the contributor form. Things got in the way then I 
completely forgot about it. It's done now.

--

___
Python tracker 

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2013-05-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for contribution.

I have committed simpler test.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2013-05-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b86fb6f5bc9 by Serhiy Storchaka in branch '2.7':
Issue #16601: Restarting iteration over tarfile no more continues from where
http://hg.python.org/cpython/rev/9b86fb6f5bc9

New changeset 9ed127d8ad61 by Serhiy Storchaka in branch '3.3':
Issue #16601: Restarting iteration over tarfile no more continues from where
http://hg.python.org/cpython/rev/9ed127d8ad61

New changeset 1c6a1427353b by Serhiy Storchaka in branch 'default':
Issue #16601: Restarting iteration over tarfile no more continues from where
http://hg.python.org/cpython/rev/1c6a1427353b

--
nosy: +python-dev

___
Python tracker 

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



[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-05-09 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> If the name is a qualified dotted name, it will be split and the first 
> part becomes the __module__.

That will not work correctly if the module name has a dot in it.

--
nosy: +sbt

___
Python tracker 

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



[issue17927] Argument copied into cell still referenced by frame

2013-05-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, I misread the second patch, I think due to the "copy the cell into" in
the comment. I believe I would have grasped it immediately if it said
something like "reference the cell from".

--

___
Python tracker 

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



[issue17944] Refactor test_zipfile

2013-05-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which refactors test_zipfile, decreases it's size by 269 lines, 
makes adding tests for new compression types and new tests for all compression 
types simpler, and makes test_zipfile discoverable.

--
components: Tests
files: test_zipfile.patch
keywords: patch
messages: 188760
nosy: alanmcintyre, ezio.melotti, serhiy.storchaka, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Refactor test_zipfile
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30182/test_zipfile.patch

___
Python tracker 

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



[issue17583] IDLE HOWTO

2013-05-09 Thread Amit Saha

Amit Saha added the comment:

Hello, I just wanted to check if I should attach the image files separately and 
submit the text as a diff? 

Thanks.

--

___
Python tracker 

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



[issue16584] unhandled IOError filecmp.cmpfiles() if file not readable

2013-05-09 Thread Till Maas

Till Maas added the comment:

I just tried on a Windows 8 system with python from GIMP. The error occurs 
there as well if I compare two empty files after I removed permissions for one 
of the files. I do not know how to manage Windows' file ACLs in python, 
therefore I created the test case using the Explorer.

--

___
Python tracker 

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



[issue11354] argparse: nargs could accept range of options count

2013-05-09 Thread paul j3

paul j3 added the comment:

I think this patch should build on http://bugs.python.org/issue9849, which 
seeks to improve the error checking for nargs.  There, add_argument returns an 
ArgumentError if the nargs value is not a valid string, interger, or it there 
is mismatch between a tuple metavar and nargs.  

This range nargs should be tested at the same time, and return a ArgumentError 
if possible.

--

___
Python tracker 

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



[issue17922] Crash in clear_weakref

2013-05-09 Thread Jan Safranek

Jan Safranek added the comment:

On 05/07/2013 05:32 PM, Antoine Pitrou wrote:
> Jan, one possibility would be for Pegasus to stop "unloading" Python,
> it seems.

It is always possibility. Actually, Pegasus "plugin" is just a shared
object (.so) and the .so is linked with Python. Pegasus calls dlopen()
and dlclose() on it. After dlclose(), the "plugin" is removed from
memory. Unfortunately, libpython2.7.so stays loaded, at least
/proc/XXX/mems says so. If there was a way to unload libpython2.7.so
from memory too...

Jan

--

___
Python tracker 

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



[issue17922] Crash in clear_weakref

2013-05-09 Thread Jan Safranek

Jan Safranek added the comment:

On 05/07/2013 06:06 PM, Antoine Pitrou wrote:
> a significant amount of static data inside CPython actually survives
> Py_Finalize :-/

As a solution, would it be possible to wipe all registered types in
Py_Finalize?

Jan

--

___
Python tracker 

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