[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file30986/issue18510.stoneleaf.01.patch

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



[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman

Ethan Furman added the comment:

Cleaner patch.

--
Added file: http://bugs.python.org/file30987/issue18510.stoneleaf.02.patch

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


--
nosy:  -scoder

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function and unused variables in some places in test_email.py

2013-07-19 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, next time I'll separate the problems into different tickets.

Here is the patch to clean up the test.

--
Added file: http://bugs.python.org/file30988/small_clean_up_to_test_email.txt

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



[issue18467] argparse - problematic 'default' behavior

2013-07-19 Thread paul j3

paul j3 added the comment:

Since parse_args takes an optional Namespace argument, you can set the its 
initial value to almost anything.  For example, with the functions defined 
previously:

parser = argparse.ArgumentParser()
parser.add_argument('-a','--algorithm', choices=['Q','S'], 
action=FooAction, type=bar)
NS = parser.parse_args(['-a','S'])
args = parser.parse_args(None, NS)

The first parse_args uses FooAction to create a default Namespace, which is 
then passed to the second.

--

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
priority: normal - low
versions:  -3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3, Python 3.5

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
Removed message: http://bugs.python.org/msg193399

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Brian Thorne

Brian Thorne added the comment:

Just did some testing on 2.7 and 3.3 on Windows and Ubuntu, the speedup is  
just noticeable - but much less so as the list grows.

--
nosy: +Thorney

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



[issue18491] Add exe wrapper functionality to Windows launcher

2013-07-19 Thread Paul Moore

Paul Moore added the comment:

Correct about .pyw files - I had forgotten those, I will update the patch.

The idea of support code was to (somewhat) alleviate Mark's question about 
what is this for, I was wondering if it was worth adding a module to the 
stdlib which did the job of saving a renamed copy of the launcher alongside a 
user-specified script.

Note that (AIUI) there is still value in this even if the launcher is installed 
- people have suggested that other approaches don't work for one reason or 
another. For example, you cannot execute .py scripts directly from the command 
line unless you manually add .py to the PATHEXT variable (as the Python 
installer does not do this).

--

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



[issue18491] Add exe wrapper functionality to Windows launcher

2013-07-19 Thread Tim Golden

Tim Golden added the comment:

Glancing back, it isn't perhaps clear to the casual reader what's being 
proposed here, and why. The idea is that a pip-style installer become part of 
core Python. For Windows users, any standalone scripts from an installed 
package would be placed in scripts/ with a stub .exe which is a copy of the 
py.exe launcher which would launch the corresponding Python file.

So, for a package Foo with a run-foo script, there would be: 
scripts/run-foo-script.py and scripts/run-foo.exe. The latter is a copy of the 
PEP397 launcher which interrogates its own filename (run-foo.exe) and looks for 
a corresponding Python script (run-foo-script.py) and then uses the launcher 
mechanics to run it, making use of all the built-in shebang-handling, 
command-line switches, etc.

This patch allows the py.exe launcher to be used in either way, transparently, 
inserting the run-foo-script.py filepath as a first parameter before the rest 
of the code runs.

--

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



[issue18480] _elementtree: missing PyType_Ready call

2013-07-19 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


--
assignee:  - ronaldoussoren

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



[issue18488] sqlite: finalize() method of user function may be called with an exception set if a call to step() method failed

2013-07-19 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

+1 for PyException_SetContext or similar. The C code should behave like a 
finally: x.finalize().

--
nosy: +amaury.forgeotdarc

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread Stefan Behnel

Stefan Behnel added the comment:

@Victor: yes, the Cython project has CI tests running against debug builds of 
all CPython branches since 2.4, updated daily. lxml is part of an extended set 
of tests for Cython, and the test suite of lxml includes several compatibility 
tests for ElementTree.

https://sage.math.washington.edu:8091/hudson/

https://sage.math.washington.edu:8091/hudson/job/cython-devel-lxml-trunk/

I noticed the failures when those tests started failing. Thanks for the quick 
fix, and actually for all the work you're doing here.

--

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



[issue18480] _elementtree: missing PyType_Ready call

2013-07-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd4c9d4bd88f by Ronald Oussoren in branch '3.3':
#18480: Add missing PyType_Ready call to _elementtree extension
http://hg.python.org/cpython/rev/cd4c9d4bd88f

New changeset 7362722646f7 by Ronald Oussoren in branch 'default':
(3.3-default): #18480: Add missing PyType_Ready call to _elementtree extension
http://hg.python.org/cpython/rev/7362722646f7

--
nosy: +python-dev

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



[issue18480] _elementtree: missing PyType_Ready call

2013-07-19 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


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

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-19 Thread Christian Heimes

Christian Heimes added the comment:

Something else is going on here. A valid server never returns an URL with 
non-ASCII chars. Your test server does the right thing, too:

$ LC_ALL=C wget http://www.libon.it/libon/search/isbn/3499155443
--2013-07-19 11:01:54--  http://www.libon.it/libon/search/isbn/3499155443
Resolving www.libon.it (www.libon.it)... 83.103.59.131
Connecting to www.libon.it (www.libon.it)|83.103.59.131|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: 
http://www.libon.it/ricerca/7818684/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-K%C3%A4fer/order/date_desc
 [following]
Incomplete or invalid multibyte sequence encountered
--2013-07-19 11:01:54--  
http://www.libon.it/ricerca/7818684/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-K%C3%A4fer/order/date_desc
Reusing existing connection to www.libon.it:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

I have digged through the code. Now I think that I know what's going on here. 
The header parsing code unquotes and converts the Location header. The code in 
the 302 handler doesn't compensate and therefore fails.

Here is a patch that corrects the code in the 302 function.

--
keywords: +patch
Added file: http://bugs.python.org/file30976/issue17214.patch

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



[issue18491] Add exe wrapper functionality to Windows launcher

2013-07-19 Thread Vinay Sajip

Vinay Sajip added the comment:

How about the following?

1. Paul updates the patch to include .pyw files, but also puts all the 
functionality of this patch in #if defined(SCRIPT_WRAPPER).
2. SCRIPT_WRAPPER is left undefined in the launcher Visual Studio project, so 
it will build identically to how it does now.
3. Once the dust has settled on distutils-sig, and we know for sure what we 
need for script wrappers, we add a separate Visual Studio project to the Python 
solution which defines SCRIPT_WRAPPER and puts the built files in whatever  
destination is appropriate.

This will give the benefit that we can reuse common functionality at the source 
code level, without changing the existing behaviour of py.exe/pyw.exe.

--

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



[issue18491] Add exe wrapper functionality to Windows launcher

2013-07-19 Thread Paul Moore

Paul Moore added the comment:

I've no problem with that suggestion. The patch is clean enough that ifdef-ing 
it out won't be hard.

Revised patch incoming :-) It's needed for the pyw support in any case.

--

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



[issue18479] Improvements to Powershell activate script for venv

2013-07-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ff5e7505696 by Vinay Sajip in branch 'default':
Closes #18479: Changed venv Activate.ps1 to make deactivate a function, and 
removed Deactivate.ps1.
http://hg.python.org/cpython/rev/1ff5e7505696

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

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In Lib/test/test_email/test_email.py, line 389, there is a unit test function:

def test_del_param_on_nonexistent_header(self):
msg = Message()
msg.del_param('filename', 'content-disposition')

There is no assertion here, unlike other unit test functions, such as:

def test_del_param_on_other_header(self):
msg = Message()
msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')
msg.del_param('filename', 'content-disposition')
self.assertEqual(msg['content-disposition'], 'attachment')

--
components: Tests
files: add_assert_equal_on_test_del_param_on_nonexistent_header.txt
messages: 193356
nosy: r.david.murray, vajrasky
priority: normal
severity: normal
status: open
title: No assertion in test_del_param_on_nonexistent_header function
versions: Python 3.4
Added file: 
http://bugs.python.org/file30977/add_assert_equal_on_test_del_param_on_nonexistent_header.txt

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



[issue18491] Add exe wrapper functionality to Windows launcher

2013-07-19 Thread Mark Hammond

Mark Hammond added the comment:

Vinay's idea makes sense to me.  Paul can also subtly change the patch such 
that when SCRIPT_WRAPPER is defined, failure to find the wrapper is fatal and 
prints a message specific to this fact rather than just starting an interactive 
Python (assuming I read the patch correctly, that is :)  Then a new .exe is 
built named something innocuous, installed in a single well-known location as 
the stub and that pip-style code creating the wrapper has a nice easy job :)

--

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



[issue18504] IDLE:Improvements- Improving Mock_Text

2013-07-19 Thread R. Jayakrishnan

New submission from R. Jayakrishnan:

Following the Idle: mock Text class and test thereof created #18365
I am trying to improve the _decode function because most of the Idletests needs 
the mock text and requires some more features to handle indexes.
Started improving the mockText _decode method while writing unit test for 
AutoExpand.py at #18292. 
For now I want the mock text to decode following indexes: 
line.char, insert, end, +-#c/chars, lineend, linestart, wordstart, wordend

For this I am trying to write regular expressions to extract the parts of index.
The submitted decodeTest.py is a sample script to show how my regular 
expression starts manipulating the decoding of indexes.

I have attached a checklist of several indexes. So you can easily run them and 
get an understanding of my approach.

--
files: decodeTest.py
messages: 193358
nosy: JayKrish
priority: normal
severity: normal
status: open
title: IDLE:Improvements- Improving Mock_Text
Added file: http://bugs.python.org/file30978/decodeTest.py

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



[issue18504] IDLE:Improvements- Improving Mock_Text

2013-07-19 Thread R. Jayakrishnan

Changes by R. Jayakrishnan raaj...@gmail.com:


Added file: http://bugs.python.org/file30979/decodeChecklist.txt

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



[issue18504] IDLE:Improvements- Improving Mock_Text

2013-07-19 Thread R. Jayakrishnan

Changes by R. Jayakrishnan raaj...@gmail.com:


Removed file: http://bugs.python.org/file30978/decodeTest.py

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



[issue18504] IDLE:Improvements- Improving Mock_Text

2013-07-19 Thread R. Jayakrishnan

Changes by R. Jayakrishnan raaj...@gmail.com:


Added file: http://bugs.python.org/file30980/decodeTest.py

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



[issue18292] IDLE Improvements: Unit test for AutoExpand.py

2013-07-19 Thread R. Jayakrishnan

R. Jayakrishnan added the comment:

I am trying to improve the _decode function of mock Text class because most of 
the Idletests needs the mock text and requires some more features to handle 
indexes.
Created an issue IDLE:Improvements- Improving Mock_Text
http://bugs.python.org/issue18504

--

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



[issue18492] Add test.support.regrtest_run flag, simplify support.requires

2013-07-19 Thread R. David Murray

R. David Murray added the comment:

Since we only use unittest for running subsets of our test suite, I think the 
better behavior is to run everything that -u all normally runs. That is, when 
one uses unittest to run a bit of the test suite, one generally wants to run 
the tests one specifies, not have them skipped.

Obviously this is open to discussion, however ;)

--

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



[issue16595] Add resource.prlimit

2013-07-19 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

From my original post which unfortunately was ignored :( :  
http://mail.python.org/pipermail/python-ideas/2012-June/015323.html
...for completeness perhaps it also makes sense to expose Linux-specific RLIMIT 
constants:

RLIMIT_MSGQUEUE
RLIMIT_NICE
RLIMIT_RTPRIO
RLIMIT_RTTIME
RLIMIT_SIGPENDING

--
nosy: +giampaolo.rodola

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread R. David Murray

R. David Murray added the comment:

That's because there's nothing to assert.  The test is making sure no exception 
is raised.  (Why no exception is raised is a good question, but that design 
predates my stewardship of the module :)

A comment to that effect would probably be a good idea.

--

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Anyway, I found another issue on line 393 on the same file:

def test_del_nonexistent_param(self):
msg = Message()
msg.add_header('Content-Type', 'text/plain', charset='utf-8')
existing_header = msg['Content-Type']
msg.del_param('foobar', header='Content-Type')
self.assertEqual(msg['Content-Type'], 'text/plain; charset=utf-8')

The variable existing_header is never used. Either we can remove it or change 
it to:

def test_del_nonexistent_param(self):
msg = Message()
msg.add_header('Content-Type', 'text/plain', charset='utf-8')
existing_header = msg['Content-Type']
msg.del_param('foobar', header='Content-Type')
self.assertEqual(msg['Content-Type'], existing_header)

At first, I wanted to create a ticket for this. But then, I thought why do not 
we combine these menial problems together?

--

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



[issue18505] Duplicate function names in test_email.py

2013-07-19 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In Lib/test/test_email/test_email.py,

Part 1: line 4210 and 4217 have same function name, which is 
test_encode_one_long_line. In fact, they have same function body!

def test_encode_one_long_line(self):
self._test_encode('x' * 100 + '\n', 'x' * 75 + '=\n' + 'x' * 25 + '\n')

One of them can be removed.

Part 2: line 928 and 1009 have same function name, which is 
test_splitter_split_on_punctuation_only_if_fws. This time, they have different 
function body and one of them (line 928) is overshadowed (not being executed by 
unit test) by the other. So we must rename one of them.

--
components: Tests
files: fix_duplicate_function_names.txt
messages: 193366
nosy: r.david.murray, vajrasky
priority: normal
severity: normal
status: open
title: Duplicate function names in test_email.py
versions: Python 3.4
Added file: http://bugs.python.org/file30981/fix_duplicate_function_names.txt

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



[issue16595] Add resource.prlimit

2013-07-19 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Fedora 18, this is the result after applying your patch and execute your unit 
test:

[sky@localhost cpython]$ ./python Lib/test/test_resource.py 
test_args (__main__.ResourceTest) ... ok
test_fsize_enforced (__main__.ResourceTest) ... ok
test_fsize_ismax (__main__.ResourceTest) ... ok
test_fsize_toobig (__main__.ResourceTest) ... ok
test_getrusage (__main__.ResourceTest) ... ok
test_prlimit (__main__.ResourceTest) ... ERROR
test_setrusage_refcount (__main__.ResourceTest) ... ok

==
ERROR: test_prlimit (__main__.ResourceTest)
--
Traceback (most recent call last):
  File Lib/test/test_resource.py, line 131, in test_prlimit
1, resource.RLIMIT_AS)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/unittest/case.py, line 
614, in assertRaises
return context.handle('assertRaises', callableObj, args, kwargs)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/unittest/case.py, line 
150, in handle
callable_obj(*args, **kwargs)
PermissionError: [Errno 1] Operation not permitted

--
Ran 7 tests in 0.990s

FAILED (errors=1)
Traceback (most recent call last):
  File Lib/test/test_resource.py, line 143, in module
test_main()
  File Lib/test/test_resource.py, line 140, in test_main
support.run_unittest(ResourceTest)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/test/support.py, line 
1615, in run_unittest
_run_suite(suite)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/test/support.py, line 
1590, in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File Lib/test/test_resource.py, line 131, in test_prlimit
1, resource.RLIMIT_AS)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/unittest/case.py, line 
614, in assertRaises
return context.handle('assertRaises', callableObj, args, kwargs)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/unittest/case.py, line 
150, in handle
callable_obj(*args, **kwargs)
PermissionError: [Errno 1] Operation not permitted

With sudo, I got this:

[sky@localhost cpython]$ sudo ./python Lib/test/test_resource.py 
[sudo] password for sky: 
test_args (__main__.ResourceTest) ... ok
test_fsize_enforced (__main__.ResourceTest) ... ok
test_fsize_ismax (__main__.ResourceTest) ... ok
test_fsize_toobig (__main__.ResourceTest) ... ok
test_getrusage (__main__.ResourceTest) ... ok
test_prlimit (__main__.ResourceTest) ... FAIL
test_setrusage_refcount (__main__.ResourceTest) ... ok

==
FAIL: test_prlimit (__main__.ResourceTest)
--
Traceback (most recent call last):
  File Lib/test/test_resource.py, line 131, in test_prlimit
1, resource.RLIMIT_AS)
AssertionError: ValueError not raised by prlimit

--
Ran 7 tests in 1.002s

FAILED (failures=1)
Traceback (most recent call last):
  File Lib/test/test_resource.py, line 143, in module
test_main()
  File Lib/test/test_resource.py, line 140, in test_main
support.run_unittest(ResourceTest)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/test/support.py, line 
1615, in run_unittest
_run_suite(suite)
  File 
/home/sky/Code/python/programming_language/cpython/Lib/test/support.py, line 
1590, in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File Lib/test/test_resource.py, line 131, in test_prlimit
1, resource.RLIMIT_AS)
AssertionError: ValueError not raised by prlimit

--
nosy: +vajrasky

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok

Vajrasky Kok added the comment:

I see.

Anyway, I am just curious. Why not doing try and catch?

def test_del_param_on_nonexistent_header(self):
msg = Message()
try:
msg.del_param('filename', 'content-disposition')
except:
self.fail('del_param on empty msg raised exception!')

Or is it better this way?

def test_del_param_on_nonexistent_header(self):
msg = Message()
# Deleting param on empty msg should not raise exception.
msg.del_param('filename', 'content-disposition')

--

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function and unused variables in some places in test_email.py

2013-07-19 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Another unused variable in line 2268 on function test_bad_multipart:

def test_bad_multipart(self):
eq = self.assertEqual
msg1 = Message()
msg1['Subject'] = 'subpart 1'
msg2 = Message()
msg2['Subject'] = 'subpart 2'
r = MIMEMessage(msg1)
self.assertRaises(errors.MultipartConversionError, r.attach, msg2)

The variable eq is never used and can be removed.

I have changed the title of the ticket to reflect the problem better.

--
title: No assertion in test_del_param_on_nonexistent_header function - No 
assertion in test_del_param_on_nonexistent_header function and unused variables 
in some places in test_email.py

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



[issue18287] PyType_Ready() should sanity-check the tp_name field

2013-07-19 Thread Niklas Koep

Changes by Niklas Koep niklas.k...@gmail.com:


Removed file: http://bugs.python.org/file30678/patch

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



[issue18436] Add mapping of symbol to function to operator module

2013-07-19 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue18506] DISABLEd Tkinter.Listbox still fires ListboxSelect for mouse click

2013-07-19 Thread Ned Deily

Ned Deily added the comment:

The behavior you are reporting is in the Tk listbox widget.  Python's Tkinter 
is a fairly thin wrapper around Tk and its widgets.  I believe you will see the 
same behavior if you translate your Python code snippet to an equivalent Tcl 
wish script.  If you think the behavior is incorrect, I suggest you ask on one 
of the Tk related forums.

--
nosy: +ned.deily
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue18506] DISABLEd Tkinter.Listbox still fires ListboxSelect for mouse click

2013-07-19 Thread Kaushik Ghose

Kaushik Ghose added the comment:

Thanks for your response. Best -Kaushik

--

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



[issue15805] Add stdout redirection tool to contextlib

2013-07-19 Thread Marc Abramowitz

Changes by Marc Abramowitz msabr...@gmail.com:


--
nosy: +Marc.Abramowitz

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



[issue18438] Obsolete url in comment inside decimal module

2013-07-19 Thread Éric Araujo

Éric Araujo added the comment:

Praise the Wayback Machine: 
http://web.archive.org/web/20050309223101/http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html

--
nosy: +eric.araujo

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



[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-19 Thread Phil Webster

Phil Webster added the comment:

I added and rewrote tests to use the Text widget (when necessary). The only 
changes made to FormatParagraph are documentation/comment formatting and the if 
__main__ function. I will work on the comment header behavior separately and 
can post the patch in this issue. Thanks for your guidance Terry!

--
Added file: 
http://bugs.python.org/file30982/18226IDLEUnitTestFormatParagraph5.patch

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



[issue18503] No assertion in test_del_param_on_nonexistent_header function and unused variables in some places in test_email.py

2013-07-19 Thread R. David Murray

R. David Murray added the comment:

We prefer one ticket per issue.  The line is fuzzy...I think it would be OK to 
fix these all at once since they are all small cleanups in test_email, but as 
you can tell from how complex the title got, they are not really conceptually 
related.

The try/except/fail is a valid style.  I prefer to just let the exception 
raise, and put in a comment to that effect, but it is definitely a personal 
style thing.

--

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f25a7dd8346 by Victor Stinner in branch 'default':
Issue #18408: Fix list_ass_slice(), handle list_resize() failure
http://hg.python.org/cpython/rev/3f25a7dd8346

--

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



[issue18453] There are unused variables inside DateTimeTestCase class in test_xmlrpc.py

2013-07-19 Thread Terry J. Reedy

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


--
nosy: +belopolsky

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



[issue15805] Add stdout redirection tool to contextlib

2013-07-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't think this has anything to do in contextlib (which isn't a library of 
context managers, but a library of tools to work with context managers), it 
probably belongs in the io module instead.

--
nosy: +pitrou

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



[issue18460] .chm documentation files advertised in download.html but not there.

2013-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The files are built and included with the Windows installer. Perhaps they can 
be installed without installing anything else. In any case, unless they are 
(again?) made available as a separate download, 

HTML Help (.chm) files are made available in the Windows section on the 
Python download page.

should be changed to something like

Compiled HTML Help (.chm) files  are included with the Windows MSI Installer 
on the Python download page.

--
nosy: +terry.reedy

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



[issue18507] import_init() should not use Py_FatalError() but return an error

2013-07-19 Thread STINNER Victor

New submission from STINNER Victor:

The import_init() function calls Py_FatalError() at any error. This is not kind 
for Py_NewInterpreter() which calls import_init(): Py_NewInterpreter() exits 
Python with a fatal error, instead of returning NULL, on import_init() failure. 
The pyfailmalloc tool can be used to easily inject faults (memory allocation 
failure) to test this issue: see issue #18408.

import_init() should return an error instead of using Py_FatalError().

--
messages: 193377
nosy: brett.cannon, haypo, ncoghlan
priority: normal
severity: normal
status: open
title: import_init() should not use Py_FatalError() but return an error
type: enhancement
versions: Python 3.4

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread STINNER Victor

STINNER Victor added the comment:

import_init() calls Py_FatalError() at any error. This is not kind for 
Py_NewInterpreter() which calls import_init(): Py_NewInterpreter() exits Python 
with a fatal error, instead of returning NULL, on import_init() failure.

I created the issue #18507 for that.

--

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



[issue18484] No unit test for iso2time function from http.cookiejar module

2013-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Alexander, I added you for possible review because of your interest in time 
functions. I wonder a bit if this function is redundant with functions in other 
modules.

--
nosy: +belopolsky, terry.reedy
stage:  - patch review

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



[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Chris Lambacher

New submission from Chris Lambacher:

When an Enum is being created, the _value2member_map class property is defined 
to speed lookup of Enum values later on. If the value does not exist then it 
falls back to a linear search through the _member_map.values() looking for 
member.value == value. This differs from population of the _value2member_map 
dictionary since population happens like this:
enum_class._value2member_map[value] = enum_member 

This differs because value is the value of the property in the definition, 
not the _value property of enum_member. In most cases this does not matter, but 
for instances where a __new__ or __init__ is doing something funky with the 
values (like auto-numbering) then the _value2member_map dict won't have the 
right information.

--
messages: 193379
nosy: lambacck
priority: normal
severity: normal
status: open
title: enum.Enum population of _value2member_map does not match fallback search
type: behavior
versions: Python 3.4

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



[issue18473] some objects pickled by Python 3.x are not unpicklable in Python 2.x because of incorrect REVERSE_IMPORT_MAPPING

2013-07-19 Thread Terry J. Reedy

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


--
nosy: +alexandre.vassalotti, pitrou

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



[issue18466] Spelling mistakes in various code comments.

2013-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

'everytime' is not an English word and should be corrected; hardcoded should be 
hard-coded. Could you at least describe your script. My fantasy is being able 
to check text parts of files with the help of a program such as LibreOffice.

--
nosy: +terry.reedy
versions: +Python 2.7, Python 3.3, Python 3.4

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



[issue18509] CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error

2013-07-19 Thread STINNER Victor

New submission from STINNER Victor:

I modified CJK codecs to reuse the new PyUnicodeWriter API (to use the PEP 393 
instead of Py_UNICODE*). The problem is that PyUnicodeWriter error is not 
handled correctly: the decoder should return MBERR_EXCEPTION, whereas the error 
is not handled at all currently.

I found this issue while working on issue #18408, using the pyfailmalloc tool 
to inject faults (memory allocation error).

--
messages: 193381
nosy: haypo
priority: normal
severity: normal
status: open
title: CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error
versions: Python 3.4

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



[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread STINNER Victor

STINNER Victor added the comment:

fix CJK codecs: using UNIINV to report _PyUnicodeWriter_WriteChar() failure in 
Modules/cjkcodecs/cjkcodecs.h does not work. The caller is not aware of the 
failure: multibytecodec_decerror() receives e=1, whereas it should get 
MBERR_EXCEPTION

I created the issue #18509 for that.

--

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



[issue18508] enum.Enum population of _value2member_map does not match fallback search

2013-07-19 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
assignee:  - ethan.furman
nosy: +ethan.furman

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



[issue18506] DISABLEd Tkinter.Listbox still fires ListboxSelect for mouse click

2013-07-19 Thread Kaushik Ghose

New submission from Kaushik Ghose:

Run the script below. Clicking on the window will fire off ListboxSelect 
events even though the widget is disabled. Keyboard actions do not fire this 
event.

#-- Test file --

import Tkinter as tki

def selection_changed(event):
  print 'Selection changed'

root = tki.Tk()
listbox = tki.Listbox(root, selectmode=tki.BROWSE)
listbox.pack(side='left', fill='both', expand=True)
listbox.bind('ListboxSelect', selection_changed)
listbox.config(state=tki.DISABLED)
root.mainloop()

--
components: Tkinter
messages: 193368
nosy: kghose
priority: normal
severity: normal
status: open
title: DISABLEd Tkinter.Listbox still fires ListboxSelect for mouse click
type: behavior
versions: Python 2.7

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



[issue18510] if Enum member value is not hashable an exception is raised

2013-07-19 Thread Ethan Furman

New submission from Ethan Furman:

While working on issue #18508 I stumbled across this:

Traceback (most recent call last):
...
  File /usr/local/lib/python3.4/enum.py, line 417, in __new__
if value in cls._value2member_map:
TypeError: unhashable type: 'list'

I'll wrap it in a try-except block, but I must admit I was surprised the answer 
wasn't False.

--
assignee: ethan.furman
messages: 193384
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: if Enum member value is not hashable an exception is raised
type: behavior

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



[issue18492] Add test.support.regrtest_run flag, simplify support.requires

2013-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Currently, all requires() tests pass when the file they occur in is run  as 
'__main__'. This is especially needed when the file ends with the now standard 
boilerplate.
  if __name__ == '__main__':
  ...
  unittest.main(...)
as there is currently no way to set resources within the unittest.main call.

The problem is that this permissiveness does not apply to subsidiary files 
discovered from and run by a main file, even though it should. The current 
workaround is to explicitly set use_resources for the benefit of subsidiary 
files, as in test_idle.py.

As I see it, the main point of this patch, somewhat obscured by the title, is 
to extend the current resource permissiveness from tests *in* main files run as 
main to tests in other files discovered and run from a main file. It also 
extends the permisiveness to any test not run by regrtest (ie, by unittest).

The key change is
-if sys._getframe(1).f_globals.get(__name__) == __main__:
+if not regrtest_run:

'regrtest_run == True' is currently spelled 'use_resources is not None', so the 
latter could be used instead to replace the frame-check without otherwise 
adding new code. 

Extending the permissiveness from main files to subsidiary files strikes me as 
a no-brainer. Splitting a (potentially) large file into a master file and a 
package of subsidiary files should not affect which tests are run.

More interesting is extending the permisiveness to tests run under unittest 
with python -m unittest target. Target can be a master file, a test file, or 
a test case or test methods. Subfile targets can only be run with unittest, not 
regrtest, and there is no way to enable resources for such targets.
  python -m unittest idlelib.idle_test.test_xy.TextText # runs
  python -m unittest idlelib.idle_test.test_xy.GuiText # skips
So the patch enables something that is currently not possible.

Serhiy is concerned about the possible booby-trap for users that run slow 
resource intensive tests. Some thoughts:

* Running tests as main is mainly done interactively, and usually by developers 
at that. Humans can stop a test and ignore errors better than buildbots.

* There are multiple ways to run a file from the command line. The test chapter 
of the manual can document that 
  python -m test.test_xyz
is more or less equivalent to
  python -m test -uall test_zyz
with -v possibly tossed in. Anyone who does not want that can still run under 
regrtest by using the currently documented
  python -m test test_xyz

* Anyone running a test file loaded in an Idle window very likely wants to run 
all tests possible.

* Documenting that running under unittest enables all resources is trickier as 
long as resources are cpython and regrtest specific. I think I would mention 
this in the test chapter, where resources are discussed, rather than the 
unittest chapter.

*If -u is added to unittest (and 'use=' to .main), a default of all would be 
the right thing for subfile targets, even if not for file and multi-file 
targets.
---

--
nosy: +terry.reedy
stage:  - patch review

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



[issue18492] Add test.support.regrtest_run flag, simplify support.requires

2013-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#18441 is partly related in that it also suggests (eventually) moving check 
code (for guis) from multiple test files to support and regrtest. I do not 
believe there would be any conflict.

--

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner

New submission from Wes Turner:

random.shuffle [1][2] could be faster. 

``xrange(10,1,-1)`` is faster than ``reversed(xrange(1,10))``.

[1] http://hg.python.org/cpython/file/v3.3.2/Lib/random.py#l254
[2] http://hg.python.org/cpython/file/v2.7.5/Lib/random.py#l276

--
components: Library (Lib)
files: random-shuffle_v2.7.5_timeit.py
messages: 193388
nosy: westurner
priority: normal
severity: normal
status: open
title: random.shuffle could be faster
type: performance
versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file30983/random-shuffle_v2.7.5_timeit.py

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner

Wes Turner added the comment:

Added patch to random.shuffle for trunk

--
Added file: http://bugs.python.org/file30985/random-shuffle_trunk.patch

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



[issue18511] random.shuffle could be faster

2013-07-19 Thread Wes Turner

Wes Turner added the comment:

Added patch to random.shuffle for v2.7.5

--
keywords: +patch
Added file: http://bugs.python.org/file30984/random-shuffle_v2.7.5.patch

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



[issue18466] Spelling mistakes in various code comments.

2013-07-19 Thread Févry Thibault

Févry Thibault added the comment:

Terry Reedy : The scripts needs to be improved and I won't be able to access my 
computer until mid August so I don't think I will be able to do anything until 
then. But the script should be able to do that if I work on it a bit. I would 
use python enchant rather than libre-office for spell-checking and would need a 
text file about words specifics to python that should not be reported. I'll 
work on it once I get back (8th August) and when it is a bit more polished I'll 
update this post.

--

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



[issue18510] if Enum member value is not hashable an exception is raised

2013-07-19 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue18510] dict.__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman

Ethan Furman added the comment:

Commenting further:

some_key in dict

is conceptually the same as 

some_key in dict.keys()

which /would/ return False for an unhashable key -- at least it did in 2.x; for 
3.x you have to say

some_key in list(dict.keys())

which seems like a step backwards.

Is it worth changing __contains__ and keys() to be in line with equality?

--
title: if Enum member value is not hashable an exception is raised - 
dict.__contains__ raises exception instead of returning False

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



[issue18510] dict.__contains__ and dict.keys().__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
title: dict.__contains__ raises exception instead of returning False - 
dict.__contains__ and dict.keys().__contains__ raises exception instead of 
returning False

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



[issue18510] dict.__contains__ raises exception instead of returning False

2013-07-19 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
assignee: ethan.furman - 
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue15805] Add stdout redirection tool to contextlib

2013-07-19 Thread Marc Abramowitz

Marc Abramowitz added the comment:

As it happens, I wrote a similar context manager to Victor's recently for a 
setup.py because I wanted to suppress compiler errors that are output to the 
console by distutils.ccompiler.CCompiler.has_function. As Victor mentioned, for 
this to work with subprocesses, you need to go a little more low-level and mess 
around with file descriptors. Here's my function:

http://marc-abramowitz.com/archives/2013/07/19/python-context-manager-for-redirected-stdout-and-stderr/

(Maybe distutils.ccompiler.CCompiler.has_function should redirect its own 
output automatically, but that's another issue)

But then I got to thinking that it could be made a bit more powerful and the 
syntax could be a little nicer. So I have this code that I'm experimenting with:

https://gist.github.com/msabramo/6043474

But critiquing my own function, I wonder if it's trying to do too much in one 
function and it's using keyword arguments where it could be using the with 
statement better. So I might like Nick's API better.

--

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