[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

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

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

[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

[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'],

[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

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

[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

[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

[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

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

[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

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

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

[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

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

[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

[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

[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

[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

[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

[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

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

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

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

[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

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

[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

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

[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']

[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

[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

[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

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

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

[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

[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

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

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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

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

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

[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

[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

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

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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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