[issue6528] builtins colored as keyword at beginning of line

2012-01-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 2d4ce2cdd6d4 by Terry Jan Reedy in branch '3.2':
#6528 None, True, False are keywords in 3.x. Patch by Roger Serwy.
http://hg.python.org/cpython/rev/2d4ce2cdd6d4

New changeset 522f07bfa067 by Terry Jan Reedy in branch 'default':
Merge with 3.2 #6528 None, True, False are keywords in 3.x. Patch by R. Serwy.
http://hg.python.org/cpython/rev/522f07bfa067

--
nosy: +python-dev

___
Python tracker 

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



[issue6528] builtins colored as keyword at beginning of line

2012-01-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I just realized that there is 'another' reason not to reuse builtin names 
(other than those usually given): they will be colorized as builtins even if 
they have no relation to the builtin. Make_pat uses the function any() defined 
just above (before the builtin, I am sure), so 'any' is colored as if it were 
the builtin. Within ColorDelegator.py, it is only used within make_pat, so I 
considered renaming it to anyp or any_pat, but it might be used by some other 
module that imports ColorDelegator. Another issue.

"name not in keyword.kwlist" could be "name not in {None, True, False}", but 
those happen to be the first three items in the kwlist, so the time difference 
would be nil.

Looks good. Tested on 3.2.2 Win7. Applied.

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

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2012-01-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If there are any tests for Idle, I have not found them. No idlelib/test/, no 
test/test_idle. There is a testcode.py with random code. I want to look at 
tkinter/test/ someday to see if it has any models for testing Idle. Roger, do 
you know of anything?

--

___
Python tracker 

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



[issue13435] Copybutton does not hide tracebacks

2012-01-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

Now 2.7 uses Sphinx 1.0, but I think a full rebuild should be triggered in 
order to update all the files.
Georg, can you do something about it?

--

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2012-01-16 Thread Ezio Melotti

Ezio Melotti  added the comment:

If the patch works for you, I guess you can commit it; if tests can be added 
too, that's even better.

--

___
Python tracker 

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



[issue13695] "type specific" to "type-specific"

2012-01-16 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

Found one little bug again in 
http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange

Look at the table with the fields Operation, Result, Notes, and fix the fifth 
record of the Result field from "i'th item of s, origin 0" to "i-th item of s, 
origin 0".

So change only that apostrophe into a hyphen, so "i'th" to "i-th".

--

___
Python tracker 

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



[issue6528] builtins colored as keyword at beginning of line

2012-01-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2012-01-16 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue11906] test_argparse failure in interactive mode

2012-01-16 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
status: open -> closed

___
Python tracker 

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



[issue13122] Out of date links in the sidebar of the documentation index of versions 3.1 and 3.2

2012-01-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

'All Releases' rather than 'Everything else' is both more accurate and to me, 
more graceful.

--

___
Python tracker 

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



[issue13756] Python3.2.2 make fail on cygwin

2012-01-16 Thread Luis Marsano

Luis Marsano  added the comment:

The README file implies support:
[⋮]
Build Instructions
--

On Unix, Linux, BSD, OSX, and Cygwin:
[⋮]

--
components: +Build -Installation
nosy: +Luis.Marsano

___
Python tracker 

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



[issue13797] Add a __buffer__ special method to retrieve a PEP 3118 object

2012-01-16 Thread Nick Coghlan

New submission from Nick Coghlan :

Currently, there's no straightforward way to create new classes in Python that 
delegate the PEP 3118 buffer APIs to another object that supports them (e.g. 
bytes, bytearray, memoryview, array.array, a NumPy array).

I see a few possible ways to go about this:

1. Add a single new special method, __buffer__. This creates an entry in the 
underlying getbuffer slot, but leaves releasebuffer empty.

The getbuffer wrapper then calls __buffer__ and delegates the getbuffer call to 
the returned object.

Any created Py_buffer instances refer directly to the underlying PEP 3118 
supporting object, not the original object that defines __buffer__

The downside of this approach is that you can't implement a completely new PEP 
3118 supporting object in pure Python (since you don't get access to the flags)

2. As above, but any Py_buffer structs returned are updated to refer to the 
original object, not the underlying one. A releasebuffer wrapper is also 
created, that calls back into __buffer__ to retrieve the object again. This 
approach has problems if __buffer__ can change to refer to different objects 
over time.

3. Define separate __getbuffer__ and __releasebuffer__ special methods. All C 
types implementing the PEP 3118 slots get these special methods automatically 
(as with any other slot). The flag variables are passed into __getbuffer__, and 
it is expected to return a memoryview object defining the view. The underlying 
getbuffer slot wrapper stores the current object in the Py_buffer "obj" slot, 
and the returned memoryview in "internal". The rest of the Py_buffer fields are 
populated based on the memoryview contents.

The releasebuffer wrapper then reverses this process, by passing the memoryview 
instance from the internal slot into the __releasebuffer__ call.

--
components: Interpreter Core
messages: 151347
nosy: ncoghlan, pitrou, skrah
priority: normal
severity: normal
status: open
title: Add a __buffer__ special method to retrieve a PEP 3118 object
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



[issue13797] Add a Python level special method to retrieve a PEP 3118 object

2012-01-16 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)
title: Add a __buffer__ special method to retrieve a PEP 3118 object -> Add a 
Python level special method to retrieve a PEP 3118 object

___
Python tracker 

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



[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-01-16 Thread Nick Coghlan

Changes by Nick Coghlan :


--
title: Add a Python level special method to retrieve a PEP 3118 object -> Allow 
objects implemented in pure Python to export PEP 3118 buffers

___
Python tracker 

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



[issue13435] Copybutton does not hide tracebacks

2012-01-16 Thread Georg Brandl

Georg Brandl  added the comment:

A full rebuild should be done anyway next time the script runs.

--

___
Python tracker 

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



[issue13695] "type specific" to "type-specific"

2012-01-16 Thread Georg Brandl

Georg Brandl  added the comment:

Would you care to explain why that change needs to be made?

--

___
Python tracker 

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



[issue13796] use 'text=...' to define the text attribute of and xml.etree.ElementTree.Element

2012-01-16 Thread patrick vrijlandt

patrick vrijlandt  added the comment:

I agree the Element syntax is sometimes awkward.

But how would you represent text or tail attributes within this enhanced 
element?
 comes to mind ...

--
nosy: +patrick.vrijlandt

___
Python tracker 

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



[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-01-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Reviewing Stefan's work on #10181 suggests to me that option 3 is the only 
feasible approach.

(Allowing memoryview subclasses will permit types to pass their own state 
between __getbuffer__ and __releasebuffer__)

--

___
Python tracker 

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



[issue13793] hasattr, delattr, getattr fail with unnormalized names

2012-01-16 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson
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



[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?

2012-01-16 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson
stage: test needed -> needs patch

___
Python tracker 

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



[issue13798] Pasting and then running code doesn't work in the IDLE Shell

2012-01-16 Thread Ramchandra Apte

New submission from Ramchandra Apte :

If you paste code with multiple lines which are not in a block of code into the 
IDLE Shell and press enter to run the code, only the first line of the code 
gets executed and the rest of the code is ignored.

You can even put garbage such as "" in the lines after the first line.

--
components: IDLE
messages: 151352
nosy: ramchandra.apte
priority: normal
severity: normal
status: open
title: Pasting and then running code doesn't work in the IDLE Shell
type: behavior
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



[issue13703] Hash collision security issue

2012-01-16 Thread STINNER Victor

STINNER Victor  added the comment:

The vulnerability is known since 2003 (Usenix 2003): read "Denial of
Service via Algorithmic Complexity Attacks" by Scott A. Crosby and Dan
S. Wallach.
http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf

This paper compares Perl 5.8 hash function, MD5, UHASH (UMAC
universal), CW (Carter-Wegman) and XOR12. Read more about UMAC:
http://en.wikipedia.org/wiki/UMAC
"A UMAC has provable cryptographic strength and is usually a lot less
computationally intensive than other MACs."

oCERT advisory #2011-003: multiple implementations denial-of-service
via hash algorithm collision
http://www.ocert.org/advisories/ocert-2011-003.html

nRuns advisory:
http://www.nruns.com/_downloads/advisory28122011.pdf

CRuby 1.8.7 fix (use a randomized hash function):
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_7/string.c?r1=34151&r2=34150&pathrev=34151
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=34151

JRuby uses Murmurhash and a hash (random) "seed" since JRuby 1.6.5.1:
https://github.com/jruby/jruby/commit/c1c9f95ed29cb93806fbc90e9eaabb9c406581e5
https://github.com/jruby/jruby/commit/2fc3a13c4af99be7f25f7dfb6ae3459505bb7c61
http://jruby.org/2011/12/27/jruby-1-6-5-1
JRUBY-6324: random seed for srand is not initialized properly:
https://github.com/jruby/jruby/commit/f7041c2636f46e398e3994fba2045e14a890fc14

Murmurhash:
https://sites.google.com/site/murmurhash/
pyhash implements Murmurhash:
http://code.google.com/p/pyfasthash/

--

___
Python tracker 

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



[issue13799] Base 16 should be hexadecimal in Unicode HOWTO

2012-01-16 Thread Ramchandra Apte

New submission from Ramchandra Apte :

"base 16" should be "hexadecimal" in the Unicode HOWTO in both Python 2 and 3 
docs.

--
assignee: docs@python
components: Documentation
messages: 151354
nosy: docs@python, ramchandra.apte
priority: normal
severity: normal
status: open
title: Base 16 should be hexadecimal in Unicode HOWTO
type: enhancement
versions: Python 2.6, 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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-16 Thread R. David Murray

R. David Murray  added the comment:

Good point.  That should be fixed.  It should be "empty format specification".

--

___
Python tracker 

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



[issue12834] memoryview.tobytes() incorrect for non-contiguous arrays

2012-01-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Added 10181 as a dependency - as noted in my review comments on that issue, I 
think this becomes fairly trivial to fix (and test) given Stefan's other 
improvements.

--
dependencies: +Problems with Py_buffer management in memoryobject.c (and 
elsewhere?)
nosy: +ncoghlan

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread R. David Murray

R. David Murray  added the comment:

Meaning you want to run the same test suite with a variety of different DB 
connections?  That seems like a reasonable use case.

Personally I find that while I sometimes create subclasses to adjust certain 
class parameters (thus creating a parameterized test case), more often I also 
have test support methods that are different between the subclasses, which 
would be more clumsy to do via non-subclass parameterization.

Also, I do have to admit that for the case of just adjusting class constants, 
it would probably be a fair bit more readable to use a class parameterization 
scheme to express the testing variations, if only because it would pull the 
variations into a single cohesive block of code.

So I guess I'm a +0 on this given a concrete use case.

--

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-01-16 Thread Nick Coghlan

Nick Coghlan  added the comment:

Finally reviewed Stefan's latest patch. It mostly looks great to me. Aside from 
a few minor cosmetic quibbles, the only substantive change I would like is to 
expose the Py_buffer len field as "memoryview.size" instead of "memoryview.len" 
(to reduce confusion with "len(memoryview)" and to encourage a conceptual link 
with sys.getsizeof()).

As noted in the review, I also think fixing #12384 should be fairly 
straightforward and it would be nice to have that working when the change is 
applied.

(Kristjan: I added you to the nosy list, since you commented on another issue 
that you had been poking around in the memoryview internals and noticed a few 
dodgy things. Stefan's work on this issue is aimed at comprehensively 
addressing those problems).

--
nosy: +krisvale
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread R. David Murray

R. David Murray  added the comment:

Drat, the tracker lost my post.  In summary, given a concrete use case (running 
a test case with a variety of different DB connections) and the improved 
readablility for the common case of just changing class constants in the 
'parameterized' subclasses, I'd change to being a +0 on this.

--

___
Python tracker 

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



[issue13801] The Python 3 Docs don't highlight nonlocal

2012-01-16 Thread Ramchandra Apte

New submission from Ramchandra Apte :

The Python 3 Docs don't highlight nonlocal such as in the code example in the 
Python 3 documentation for itertools.zip_longest() 
(http://docs.python.org/py3k/library/itertools.html)

--
messages: 151362
nosy: ramchandra.apte
priority: normal
severity: normal
status: open
title: The Python 3 Docs don't highlight nonlocal

___
Python tracker 

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



[issue13801] The Python 3 Docs doesn't highlight nonlocal

2012-01-16 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
title: The Python 3 Docs don't highlight nonlocal -> The Python 3 Docs doesn't 
highlight nonlocal

___
Python tracker 

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



[issue13801] The Python 3 Docs doesn't highlight nonlocal

2012-01-16 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +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



[issue13801] The Python 3 Docs doesn't highlight nonlocal

2012-01-16 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, georg.brandl
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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Mark, would you like to work on a patch for this?

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread Michael Foord

Michael Foord  added the comment:

Why not create a simple TestCase factory in load_tests?

Before a patch can be produced a clean api that offers a clear benefit over the 
TestCase factory needs to be proposed.

--

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2012-01-16 Thread Christian Häggström

Changes by Christian Häggström :


--
nosy: +chn

___
Python tracker 

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



[issue13801] The Python 3 Docs doesn't highlight nonlocal

2012-01-16 Thread Justin Wehnes

Justin Wehnes  added the comment:

Nonlocal is highlighted under Language Reference under simple statements 
section 6.13 (http://docs.python.org/dev/reference/index.html).  
help("nonlocal") will also bring up the documentation (works for me in 3.3).

--
nosy: +jwehnes

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-01-16 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

Hi,
I think that the documentation is pretty clear ("[if topdown=False] ...  the 
directories in dirnames have already been generated by the time dirnames itself 
is generated"). And such behaviour is what one would expect, since it is the 
result of the simplest implementation (listdir(), yield , yield 
, yeild , yeild ).

I don't think that the implementation will be changed, since it is pretty to do 
listdir() yourself if needed, and it would make the function slower for the 
common use case.

Improving the documentation is always possible, what sentence would you see 
added (what would make the behaviour clearer to you?) ?

--
nosy: +zbysz

___
Python tracker 

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



[issue13801] The Python 3 Docs don't highlight nonlocal

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Not really.  If you follow the link given in the first message and compare how 
“is” and “nonlocal” are styled, you will see the bug.  :)

I hope that Sphinx configures Pygments to use a Python3Lexer, not Python.  
Georg?

--
nosy: +eric.araujo
stage:  -> needs patch
title: The Python 3 Docs doesn't highlight nonlocal -> The Python 3 Docs don't 
highlight nonlocal

___
Python tracker 

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



[issue13801] The Python 3 Docs don't highlight nonlocal

2012-01-16 Thread Justin Wehnes

Justin Wehnes  added the comment:

Ahh yes I see it.  Sorry about that.

--

___
Python tracker 

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-16 Thread Simon Sapin

Simon Sapin  added the comment:

heapq_merge_key_duplicate.patch is a new patch with two code path. It also 
updates the function’s docstring (which the previous patch did not). Raymond, 
do you think the speed is worth the DRY violation?

--
Added file: http://bugs.python.org/file24248/heapq_merge_key_duplicate.patch

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> However, the generated (files? and) dirs do not necessarily reflect the 
> current situation as produced by os.listdir.

What do you mean exactly? Another process has re-created "b" in parallel?
This race condition is pretty impossible to solve in the general case (unless 
the filesystem is transactional): even if you call os.listdir() again, a new 
file or dir could appear just before the following call to os.rmdir().

(just for the record, shutil.rmtree already allows you to delete a filesystem 
tree)

--
nosy: +pitrou

___
Python tracker 

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



[issue13793] hasattr, delattr, getattr fail with unnormalized names

2012-01-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Normalizing the string in getattr() is unacceptable. We'll just have to 
document, that all identifiers are in NFKC.

--

___
Python tracker 

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-01-16 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


--
nosy: +zbysz

___
Python tracker 

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



[issue13665] TypeError: string or integer address expected instead of str instance

2012-01-16 Thread Meador Inge

Meador Inge  added the comment:

LGTM.  Thanks for fixing this.

--

___
Python tracker 

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



[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?

2012-01-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I think an exception is fine, but it should only happen in 3.3.

--

___
Python tracker 

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



[issue13801] The Python 3 Docs don't highlight nonlocal

2012-01-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

The problem was until very recently, pygments omitted the nonlocal keyword. We 
probably need to wait for another pygments release.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-01-16 Thread patrick vrijlandt

patrick vrijlandt  added the comment:

The documentation of this function is generally ambiguous, because os.walk is a 
generator. Thus "generate" means (1) yielded from a generator and (2) prepared 
for later use within the generator. To avoid the ambiguity, "generate" should 
be avoided if possible. (1) might be replaced by "return" and (2) by "prepare".

@zbysz
The paragraph you cite is about "Modifying dirnames ". If you are not 
"Modifying dirnames" (like me) this section easily skips your attention.

My problem was, of course, that I had myself changed the directory structure - 
It's not a race condition with another process but an effect  of the loop 
os.walk was managing.

@pitrou
shutil.rmtree cannot help me, because I'm only deleting empty dirs.

Proposal (very verbose I'm afraid):
If you change the directory structure below dirpath while topdown=True, you can 
modify dirnames in-place so that walk will visit the right directories. If you 
change the directory structure below dirpath while topdown=False (maybe while 
you where there), dirnames and filenames can still reflect the old situation 
and it might be necessary to call os.listdir again.

--

___
Python tracker 

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



[issue13796] use 'text=...' to define the text attribute of and xml.etree.ElementTree.Element

2012-01-16 Thread Pedro Andres Aranda Gutierrez

Pedro Andres Aranda Gutierrez  added the comment:

Touché :-)
I was just frustrated because my XMLs never have tail or text as
attributes and I wanted to have more compact code...

On Mon, Jan 16, 2012 at 12:14 PM, patrick vrijlandt
 wrote:
>
> patrick vrijlandt  added the comment:
>
> I agree the Element syntax is sometimes awkward.
>
> But how would you represent text or tail attributes within this enhanced 
> element?
>  comes to mind ...
>
> --
> nosy: +patrick.vrijlandt
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue12415] Missing: How to checkout the Doc sources

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Please review.

--

___
Python tracker 

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



[issue12415] Missing: How to checkout the Doc sources

2012-01-16 Thread Éric Araujo

Changes by Éric Araujo :


Added file: http://bugs.python.org/file24249/metadoc-where-are-the-sources.diff

___
Python tracker 

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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-16 Thread Eric V. Smith

Eric V. Smith  added the comment:

Changing to a documentation issue.

--
assignee: eric.smith -> docs@python
components: +Documentation -Interpreter Core
keywords: +easy
nosy: +docs@python
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



[issue11805] package_data only allows one glob per-package

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Copied from #13712:

[I]
Problem is that the setup.cfg syntax does not define how to give more than one 
value.  If it’s judged acceptable to disallow paths with embedded spaces, we 
could do something like this:

[files]
package_data =
spam = first second third

Otherwise we’d need to use multiple lines (requested in #5302) [actually no, it 
was this bug #11805]

[files]
package_data =
spam = first
spam = second
spam = third

We probably don’t want that.  An intermediate idea:

[files]
package_data =
spam = first
   second
   third

Not sure this would be the nicest thing for people to write, and for us (me) to 
extend the setup.cfg parser for.


[Erik Bray]
FWIW, I'm for the first option for specifying package_data:

[files]
package_data =
spam = first second third

I'm pretty sure this is how I ended up implementing it in d2to1, since I needed 
this functionality.

Theoretically spaces could be supported with an escape sequence, but I don't 
think that's worth complicating things for if package_data is deprecated 
anyways.  I'm all for making it difficult for anyone trying to include 
filenames with spaces in their source code.


So, I think allowing spaces and newlines to separate multiple values will be 
the nicest (spaces only would require users to cram all there file specs on one 
line).

--

___
Python tracker 

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



[issue12409] Moving "Documenting Python" to Devguide

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Glad my action plan worked :)

There are now obsolete entries in the Doc/tools/sphinxext/susp-ignored.csv 
file: All lines starting with “documenting” can be removed.

--

___
Python tracker 

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



[issue11805] package_data only allows one glob per-package

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

(To clarify quotes in my message: First is a copied message from me, marked 
[I], then one form Erik, and the last paragraph is me again.  Sleep good, 
should get more of that.)

--

___
Python tracker 

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



[issue13588] Change name of internal closure functions in importlib

2012-01-16 Thread Brett Cannon

Brett Cannon  added the comment:

Sorry, been busy. I will definitely get to it this week.

On Sun, Jan 15, 2012 at 19:58, Berker Peksag  wrote:

>
> Berker Peksag  added the comment:
>
> Hi Brett, did you have a chance to review the patch I submitted?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue13412] Symbolic links omitted by os.listdir on some systems

2012-01-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

While this may in fact be related to #6727, I don't believe it's a proper 
duplicate. I believe there's a more fundamental issue that's causing both #6727 
and #13412, and that's that stat/wstat is broken on Windows due to a regression 
in the MS C runtime: 
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/93ebb061-d952-4650-b15c-30548a6649a8/

I mention that here because a fix for #6727 if localized to import.c may not 
address this issue.

--

___
Python tracker 

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



[issue5300] Distutils ignores file permissions

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

FTR it looks like 
http://mail.python.org/pipermail/python-list/2009-January/1188084.html was the 
original report for this.

--

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-01-16 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

> The documentation of this function is generally ambiguous, because
> os.walk is a generator. Thus "generate" means (1) yielded from a 
> generator and (2) prepared for later use within the generator. To avoid 
> the ambiguity, "generate" should be avoided if possible. (1) might be 
> replaced by "return" and (2) by "prepare".
It think that you are wrong here: generate is consistently used in
meaning (1) in the docstring. Also "return" means something completely 
different. "generate" is better than "prepare", because it is more specific,
especially from the POV of the user of the function, who only cares about
when something is yielded, not when it is prepared.

> Proposal (very verbose I'm afraid):
> If you change the directory structure below dirpath while topdown=True, 
> you can modify dirnames in-place so that walk will visit the right 
> directories. If you change the directory structure below dirpath while 
> topdown=False (maybe while you where there), dirnames and filenames can 
> still reflect the old situation and it might be necessary to call 
> os.listdir again.
Hm, I think that the difference in behaviour between topdown=False and 
topdown=True is smaller then this proposal implies.
When topdown=True, the list is not updated after changes on disk. So both 
removing and adding directories does _not_ cause them to added or removed from 
the list of subdirectories to visit. Nevertheless, the default behaviour on
error is to do nothing, so it _looks_ like they were skipped.

So I think that the documentation could only clarify that the list of 
subdirectories is queried first, before the dir or the subdirectories are 
"generated".

--

___
Python tracker 

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



[issue13779] os.walk: bottom-up

2012-01-16 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

>>> os.makedirs('/tmp/a/b/c')
>>> gen  = os.walk('/tmp/a')
>>> next(gen)
('/tmp/a', ['b'], [])
>>> os.makedirs('/tmp/a/b2')
>>> next(gen)
('/tmp/a/b', ['c'], [])
>>> next(gen)
('/tmp/a/b/c', [], [])

>>> gen  = os.walk('/tmp/a', onerror=print)
>>> next(gen)
('/tmp/a', ['b2', 'b'], [])
>>> os.rmdir('/tmp/a/b2')
>>> next(gen)
[Errno 2] No such file or directory: '/tmp/a/b2'
('/tmp/a/b', ['c'], [])

--

___
Python tracker 

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



[issue8502] support plurals in pygettext

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

Thank you for making a patch.  I’ve been busy and could not find time to look 
at it, but after I add a testing machinery for scripts like pygettext I will 
look into this.

--
assignee: docs@python -> 
dependencies: +Add tests for some scripts in Tools/scripts
nosy:  -georg.brandl
stage:  -> needs patch
title: proposal: encourage xgettext rather than pygettext.py in gettext docs -> 
support plurals in pygettext

___
Python tracker 

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



[issue8913] Document that datetime.__format__ is datetime.strftime

2012-01-16 Thread Éric Araujo

Éric Araujo  added the comment:

IMO, now that two official releases of Python 3 have shipped with this behavior 
(3.1 and 3.2), it is too late to think about changing what datetime.__format__ 
does, and we should merely document that it is the same as strftime.

--

___
Python tracker 

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



[issue13588] Change name of internal closure functions in importlib

2012-01-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9935f7837c4b by Brett Cannon in branch 'default':
Issue #13588: Rename decorators in importlib.
http://hg.python.org/cpython/rev/9935f7837c4b

--
nosy: +python-dev

___
Python tracker 

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



[issue13588] Change name of internal closure functions in importlib

2012-01-16 Thread Brett Cannon

Brett Cannon  added the comment:

Thanks for the patch, Berker! It's all committed.

--

___
Python tracker 

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



[issue13609] Add "os.get_terminal_size()" function

2012-01-16 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

Does this need need more discussion, code review, testing, or just more time?

--

___
Python tracker 

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



[issue12409] Moving "Documenting Python" to Devguide

2012-01-16 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7167c04780ed by Sandro Tosi in branch '2.7':
Issue: #12409: remove obsolete susp-entries
http://hg.python.org/cpython/rev/7167c04780ed

New changeset 153e32333aaa by Sandro Tosi in branch '3.2':
Issue: #12409: remove obsolete susp-entries
http://hg.python.org/cpython/rev/153e32333aaa

New changeset a6bf08666da2 by Sandro Tosi in branch 'default':
Issue: #12409: merge with 3.2
http://hg.python.org/cpython/rev/a6bf08666da2

--
nosy: +python-dev

___
Python tracker 

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



[issue12409] Moving "Documenting Python" to Devguide

2012-01-16 Thread Sandro Tosi

Sandro Tosi  added the comment:

Éric, thanks for spotting it: removed.

--

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
hgrepos: +104

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Changes by Jason R. Coombs :


Added file: http://bugs.python.org/file24250/4aaf78f0dd10.diff

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

4aaf78f0dd10.diff is the same patch as that for 2.7 but ported to 3.1.

--

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2012-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There seem to be two issues at play here:

- the atexit module (and its companion helper _Py_PyAtExit()) doesn't know 
about sub-interpreters.

- PyState_FindModule() doesn't know about sub-interpreters either, because the 
m_index field (which records the module's index in an interpreter's module list 
(PyInterpreterState.modules_by_index)) is recorded in the PyModuleDef structure 
rather than the module instance: it is therefore global to all interpreters

Having atexit work properly with sub-interpreters would require fixing these 
two issues AFAICT.

--
nosy: +loewis, pitrou
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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2012-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, it seems I may be mistaken about the second point. m_index is actually 
generated such that all modules end up in the same position in the 
interpreters' respective modules_by_index lists. Sorry.

--

___
Python tracker 

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



[issue12705] Make compile('1\n2\n', '', 'single') raise an exception instead of silently truncating?

2012-01-16 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue13695] "type specific" to "type-specific"

2012-01-16 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

I guess you're reffering to the  "i'th" --> "i-th"  thing.

I found numerous occasions on the Internet that say like "n-th element blah 
blah blah", not "n'th element..."

So I guess writting this thing as "i-th" would be correct here, too.

--

___
Python tracker 

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



[issue13798] Pasting and then running code doesn't work in the IDLE Shell

2012-01-16 Thread Roger Serwy

Roger Serwy  added the comment:

This is a duplicate of #3559.

--
nosy: +serwy

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2012-01-16 Thread Roger Serwy

Roger Serwy  added the comment:

I'm not aware of any formal tests for IDLE. Can you show me the docs for 
writing proper unit tests? I'll see if I can write one for this.

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread R. David Murray

R. David Murray  added the comment:

Maybe we could add a recipe for doing this to the load_tests docs?

I don't think that load_tests is going to be more readable, though, since it 
doesn't allow you to put the parameterization next to the class you are 
parameterizing (unless you do some additional hackery).

But yes, if anything else is done a concrete API proposal is the first 
requirement.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-01-16 Thread Eric Snow

Eric Snow  added the comment:

> The vulnerability is known since 2003 (Usenix 2003): read "Denial of
> Service via Algorithmic Complexity Attacks" by Scott A. Crosby and Dan
> S. Wallach.

Crosby started a meaningful thread on python-dev at that time similar to the 
current one:

  http://mail.python.org/pipermail/python-dev/2003-May/035874.html

It includes a some good insight into the problem.

--
nosy: +eric.snow

___
Python tracker 

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



[issue13801] The Python 3 Docs don't highlight nonlocal

2012-01-16 Thread Sandro Tosi

Changes by Sandro Tosi :


--
nosy: +sandro.tosi

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
hgrepos: +105

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Changes by Jason R. Coombs :


Added file: http://bugs.python.org/file24251/4fdbc9f74235.diff

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-01-16 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Eric Snow wrote:
> 
> Eric Snow  added the comment:
> 
>> The vulnerability is known since 2003 (Usenix 2003): read "Denial of
>> Service via Algorithmic Complexity Attacks" by Scott A. Crosby and Dan
>> S. Wallach.
> 
> Crosby started a meaningful thread on python-dev at that time similar to the 
> current one:
> 
>   http://mail.python.org/pipermail/python-dev/2003-May/035874.html
> 
> It includes a some good insight into the problem.

Thanks for the pointer. Some interesting postings...

Vulnerability of applications:
http://mail.python.org/pipermail/python-dev/2003-May/035887.html

Speed of hashing, portability and practical aspects:
http://mail.python.org/pipermail/python-dev/2003-May/035902.html

Changing the hash function:
http://mail.python.org/pipermail/python-dev/2003-May/035911.html
http://mail.python.org/pipermail/python-dev/2003-May/035915.html

--

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2012-01-16 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I ported the patch to the 3.2 branch. This port required more extensive 
adjustments. In particular, the NullImporter no longer used (char *) for 
directory detection, but instead used platform-specific PyObjects.

Therefore, the 3.2 diff creates a new function, Py_PathIsDir, which takes a 
PyUnicode on Windows and PyBytes on other platforms and calculates the 
directory state of the parameter.

I'm fairly unhappy with the way the patch for 2.7 and 3.1 translated to 3.2.

So, I'm seeking review and approval of the 2.7 and 3.1 patches, and comments on 
the 3.2 patch.

--

___
Python tracker 

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



[issue13695] "type specific" to "type-specific"

2012-01-16 Thread Georg Brandl

Georg Brandl  added the comment:

"numerous occasions" is not good enough. Why not let a native speaker decide?

--

___
Python tracker 

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



[issue13793] hasattr, delattr, getattr fail with unnormalized names

2012-01-16 Thread Jim Jewett

Jim Jewett  added the comment:

Why is normalization in getattr unacceptable?  I won't pretend to *like* it, 
but the difference between two canonically equal strings really is (by 
definition) just a representational issue.

Would it be OK to normalize in object's own implementation, so that custom 
classes could avoid the normalization, but it would happen by default?

--

___
Python tracker 

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



[issue12415] Missing: How to checkout the Doc sources

2012-01-16 Thread Sandro Tosi

Sandro Tosi  added the comment:

that looks ok to me.

--

___
Python tracker 

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



[issue13793] hasattr, delattr, getattr fail with unnormalized names

2012-01-16 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Because it's (very) expensive and the method you propose would fail in the case 
that someone had put the normalized and unnormalized string in the object's 
__dict__.

--

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2012-01-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The library manual has chapters for

unittest: the generic testing framework (package) that any app can use

test: a package with the Python test suite; test_x tests module x
  It has other modules and subpackages, probably not all documented.
  The test modules use unittest, doctest, and other code.

test.support: some of the other code

AS it says in the test chapter, the test suite imports each test_x and runs its 
test_main function. The tkinter package includes a test subpackage. test_tk 
checks that _tkinter and tk are available and if so, runs the tests in 
tkinter.test. (But I am not sure it really does what it should ;-).

My thought is that we might want to do something similar with idle. However, 
there needs to be a test_idle module in any case, so we can start with a few 
tests there and migrate them to a separate idlelib.test subpackage later if we 
want.

--

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread Mark Diekhans

Mark Diekhans  added the comment:

> R. David Murray  added the comment:
> 
> Meaning you want to run the same test suite with a variety of
> different DB connections?  That seems like a reasonable use
> case.

This is for external parameterization of a test to run in a
different environment.  Internal reuse of test code is usually
better done inside of the code using standard OOP approaches.

The different in database connections is due to wanting to run
the tests on different systems with different database users,
passwords and database names.  Normally we have an object that
reads this information from file specified on the command line,
the object is passed to code that creates the connections.

A similar problem exists when tests must be run against a server
and require a host name.  External parameterization to specify
the host name is required.

While it's certainly possible to come up with says to pass this
setting things in globals (including environment variable), this
does lead to confusing code.

Mark

--

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-01-16 Thread Berker Peksag

Changes by Berker Peksag :


Added file: http://bugs.python.org/file24252/issue13641_v3_with_tests.diff

___
Python tracker 

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



[issue13165] Integrate stringbench in the Tools directory

2012-01-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berkerpeksag

___
Python tracker 

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



[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The macros should be named PyDelta_XXX, as PyDelta_Check and friend.
Otherwise, makes sense.

--
nosy: +pitrou

___
Python tracker 

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



[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-16 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I named them following the other accessor macros: PyDateTime_TIME_GET_HOUR(), 
even though the check function is named PyTime_Check().
Which inconsistency do you prefer? :)

--

___
Python tracker 

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



[issue13727] Accessor macros for PyDateTime_Delta members

2012-01-16 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ow. Then I don't mind :)

--

___
Python tracker 

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



[issue11695] Improve argparse usage/help customization

2012-01-16 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berkerpeksag

___
Python tracker 

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



[issue8285] IDLE not smart indenting correctly in nested statements

2012-01-16 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The current indentation is a consequent of using tabs for indents.
Changing that is the subject of #7676.
#1196946 is a similar issue.

--
nosy: +terry.reedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> IDLE shell shouldn't use TABs
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue13781] gzip module does the wrong thing with an os.fdopen()'ed fileobj

2012-01-16 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

For 3.x, I think that ignoring non-string names is a reasonable fix. The docs
for io.FileIO specify that its name attribute can be either a path or an integer
file descriptor, and changing this doesn't seem to serve any purpose.

As for the case of 2.7's bogus "" name attribute, I'm not sure what the
best course of action is. I agree that ideally we would want to get rid of the
attribute altogether (for objects returned by fdopen), or change the semantics
to those used by FileIO in 3.x, but making that sort of change in a bugfix
release seems unwise.

One alternative would be for GzipFile to specifically check whether a file
object was returned by fdopen(), and if so ignore the fake name. I'm not sure
how this could be accomplished, though - just checking for name == "" is
too fragile for my liking, and I can't see any other obvious way of
distinguishing objects created by fdopen() from those created by open().

> (another quick test shows that gzip in python 3.x can't output to a BytesIO
> fileobj at all, it thinks it is readonly)

Are you sure about this? I can't reproduce the problem. Running this script:

import gzip, io

b = io.BytesIO()
with gzip.GzipFile(fileobj=b, mode="w") as g:
g.write(b"asdf ghjk")
print(b.getvalue())
b.seek(0)
with gzip.GzipFile(fileobj=b, mode="r") as g:
print(g.read())

I get the following output:


b'\x1f\x8b\x08\x00\xe1\xa4\x14O\x02\xffK,NISH\xcf\xc8\xca\x06\x00P\xd2\x1cJ\t\x00\x00\x00'
b'asdf ghjk'

--

___
Python tracker 

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



[issue13802] IDLE Prefernces/Fonts: use multiple alphabets in examples

2012-01-16 Thread Terry J. Reedy

New submission from Terry J. Reedy :

In the Fonts/Tabs tab of the IDLE Preference dialog, the large box for examples 
of the font selected shows a small square of ascii chars. I think the box 
should also show 1 char for each of several alphabets so the consequence of 
choosing various fonts will be more evident. I am thinking of adding several 
line with the format
Alphabet \u 

--
components: IDLE
messages: 151415
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE Prefernces/Fonts: use multiple alphabets in examples
type: enhancement
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



[issue13165] Integrate stringbench in the Tools directory

2012-01-16 Thread Jim Jewett

Jim Jewett  added the comment:

The URL got mangled in at least my browser, so I'm repasting it on its own line:

http://svn.python.org/projects/sandbox/trunk/stringbench

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue12600] Support parameterized TestCases in unittest

2012-01-16 Thread R. David Murray

R. David Murray  added the comment:

That's not the kind of parameterization this ticket is about, though.  You are 
talking about passing data in to a test run from the command line (or other 
source), which is a different issue (though the implementations might share 
some common infrastructure).

--

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2012-01-16 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



  1   2   >