[issue24849] Add __len__ to map, everything in itertools

2015-08-13 Thread flying sheep
flying sheep added the comment: The *iterable* itself may be reentrant, but the iterator formed from iter(iterable) is not. So by your previous comment, giving the iterator form a length is not appropriate. With the exception of tee, all the functions in itertools return iterators. ah,

[issue24857] Crash on comparing call_args with long strings

2015-08-13 Thread Wilfred Hughes
New submission from Wilfred Hughes: What steps will reproduce the problem? from mock import Mock m = Mock() m(1, 2) Mock name='mock()' id='139781492681104' m.call_args == foob Traceback (most recent call last): File stdin, line 1, in module File

[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix

2015-08-13 Thread Berker Peksag
Berker Peksag added the comment: +1 I'd delete most of the CGI section, add a note about PEP and mention Gunicorn, uwsgi and Waitress. The frameworks section also needs a cleanup. Do you want to work on a patch? -- nosy: +berker.peksag stage: - needs patch versions: +Python

[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix

2015-08-13 Thread Georg Brandl
Georg Brandl added the comment: It's probably better to remove the document for now, and add a rewritten version back when it arrives. Although, this topic sees lot of change regularly, so it is probably not a good one for the standard documentation after all. -- nosy: +georg.brandl

[issue24857] Crash on comparing call_args with long strings

2015-08-13 Thread Michael Foord
Michael Foord added the comment: call_args is not user settable! It is set for you by the mock when it is called. Arguably it could be a property instead. -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org

[issue24857] mock: Crash on comparing call_args with long strings

2015-08-13 Thread Wilfred Hughes
Changes by Wilfred Hughes yowilf...@gmail.com: -- title: Crash on comparing call_args with long strings - mock: Crash on comparing call_args with long strings ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857

[issue24855] fail to mock the urlopen function

2015-08-13 Thread sih4sing5hong5
New submission from sih4sing5hong5: I also posted in stackoverflow: http://stackoverflow.com/questions/30978207/python-urlopen-mock-fail ``` from unittest.mock import patch import urllib from urllib import request from urllib.request import urlopen @patch('urllib.request.urlopen') def

[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread Martijn Pieters
New submission from Martijn Pieters: The documentation states that `side_effect` can be set to an [iterable](https://docs.python.org/3/glossary.html#term-iterable): If you pass in an iterable, it is used to retrieve an iterator which must yield a value on every call. This value can either

[issue24857] Crash on comparing call_args with long strings

2015-08-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +michael.foord stage: - needs patch type: crash - behavior versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857

[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Argument Clinic code was not regenerated. Actually the commit breaks Argument Clinic. $ make clinic ./python -E ./Tools/clinic/clinic.py --make Error in file ./Modules/posixmodule.c on line 11211: Docstring for os.cpu_count does not have a summary line!

[issue24855] fail to mock the urlopen function

2015-08-13 Thread sih4sing5hong5
sih4sing5hong5 added the comment: It is normal because of __all__ syntax. By: https://github.com/testing-cabal/mock/issues/313#issuecomment-130564364 -- status: open - closed ___ Python tracker rep...@bugs.python.org

[issue24857] mock: Crash on comparing call_args with long strings

2015-08-13 Thread Wilfred Hughes
Wilfred Hughes added the comment: This caught me by surprise and I spent a while debugging due to this issue. Isn't it reasonable that I can compare two values in Python without exceptions being raised? (1, 2) == foob False I'm happy to write a patch. --

[issue24857] Crash on comparing call_args with long strings

2015-08-13 Thread Michael Foord
Michael Foord added the comment: Oops, I misunderstood the bug report - however, call_args is a tuple, so you can't compare it directly to a string like that. Please refer to the docs on using call_args. -- ___ Python tracker rep...@bugs.python.org

[issue24857] mock: Crash on comparing call_args with long strings

2015-08-13 Thread Wilfred Hughes
Wilfred Hughes added the comment: This bug is particularly subtle because it only applies to *long* strings. m.call_args == f False m.call_args == fo False m.call_args == foo False m.call_args == foob Traceback (most recent call last): File stdin, line 1, in module File

[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2015-08-13 Thread Robert Collins
Robert Collins added the comment: Ok, so will someone commit 3), or would you like me to do so? After that it sounds like we can move this back to patch review, since there will be nothing left ready for commit. -- ___ Python tracker

[issue24857] mock: Crash on comparing call_args with long strings

2015-08-13 Thread Michael Foord
Michael Foord added the comment: Ok, fair enough. -- resolution: not a bug - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24857 ___

[issue24854] Null check handle return by new_string()

2015-08-13 Thread Pankaj Sharma
New submission from Pankaj Sharma: The issue reported in python-2.7.10/Parser/tokenizer.c:237 to handle NULL return by new_string() if PyMem_MALLOC() failed. So need to check for NULL and return to prevent from crash happened in get_normal_name().this issue related with issue18470 has been

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-13 Thread Alex Shkop
Alex Shkop added the comment: @rbcollins that is exactly what was trying to say in previous comment. We can make a change to current patch that won't affect behavior. In old API in this sequence of filters last filter was never used: simplefilter(ignore) simplefilter(error, append=True)

[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix

2015-08-13 Thread John Hagen
John Hagen added the comment: A couple other notes I saw: The examples (https://docs.python.org/3.5/howto/webservers.html#setting-up-fastcgi) do not follow PEP 8 (should not have an encoding statement if it is UTF-8 Python 3) or the current guidance in PEP 394 to use python3 in the shebang

[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread R. David Murray
R. David Murray added the comment: The documentation is accurate. The object being manipulated by the code clause you site is not the original object passed in to the side_effect argument. -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed

[issue15601] tkinter test_variables fails with OS X Aqua Tk 8.4

2015-08-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Andrew (and others): I wasn't sure whether to reopen this or start a new issue. Will re-close this and open new if preferable. -- nosy: +terry.reedy status: closed - open ___ Python tracker rep...@bugs.python.org

[issue24857] mock: Crash on comparing call_args with long strings

2015-08-13 Thread R. David Murray
R. David Murray added the comment: Yeah, if it isn't comparable it should return either False or NotImplemented, not raise an exception. False would be better here, I think. -- keywords: +easy nosy: +r.david.murray ___ Python tracker

[issue24855] fail to mock the urlopen function

2015-08-13 Thread R. David Murray
R. David Murray added the comment: It has nothing to do with __all__, and everything to do with the way namespaces work in Python. 'from urllib.request import urllib' creates a name 'urllib' in the global namespace of your module pointing to the urlopen function (*before* you do your patch),

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2015-08-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset d9c85b6bab3a by R David Murray in branch '2.7': #21167: Fix definition of NAN when ICC used without -fp-model strict. https://hg.python.org/cpython/rev/d9c85b6bab3a New changeset 5e71a489f01d by R David Murray in branch '3.4': #21167: Fix

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2015-08-13 Thread R. David Murray
R. David Murray added the comment: Thanks Chris, and Mark. I ran the tests on 3.6 both on Linux (non ICC) and on Mac (with ICC without -fp-model strict) and all the tests passed. -- resolution: - fixed stage: - resolved status: open - closed ___

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2015-08-13 Thread R. David Murray
R. David Murray added the comment: Larry, do you want this for 3.5.0a2? It's an innocuous patch for anyone not using ICC, and makes ICC just work (with the default ICC build arguments) for people using ICC. (Well, on (lin/u)nux and mac, anyway, I'm not sure we've resolved all the ICC issues

[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-13 Thread R. David Murray
R. David Murray added the comment: Is this buildbot failure: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.5/builds/189 related to this issue? LINK : fatal error LNK1104: cannot open file 'C:\buildbot.python.org\3.5.kloth-win64\build\PCBuild\amd64\_tkinter_d.pyd'

[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: To fix this in a generic way, perhaps the function could update a volatile global variable after the recursive call? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24851

[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18

2015-08-13 Thread Mark Roseman
Mark Roseman added the comment: Awesome, thanks Kevin. Have attached calltip.patch. The extra lift() call doesn't seem to hurt on Windows or X11, so didn't make it conditional. -- keywords: +patch Added file: http://bugs.python.org/file40173/calltip.patch

[issue15601] tkinter test_variables fails with OS X Aqua Tk 8.4

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please open a new issue Laura. -- nosy: +serhiy.storchaka status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15601 ___

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Laura Creighton
New submission from Laura Creighton: I have tried this on several debian unstable releases, and get the following 3 failures lac at smartwheels:~$ lsb_release -a LSB Version:

[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect

2015-08-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset c515b40a70eb by Antoine Pitrou in branch '3.4': Issue #16554: fix description for MAKE_CLOSURE. Initial patch by Daniel Urban. https://hg.python.org/cpython/rev/c515b40a70eb New changeset 2a41fb63c095 by Antoine Pitrou in branch '3.5': Issue

[issue24856] Mock.side_effect as iterable or iterator

2015-08-13 Thread Martijn Pieters
Martijn Pieters added the comment: Bugger, that's the last time I take someone's word for it and not test properly. Indeed, I missed the inheritance of NonCallableMock, so the property is inherited from there. Mea Culpa! -- ___ Python tracker

[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect

2015-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: The description for MAKE_FUNCTION had already been fixed in the meantime, so I pushed the changes for MAKE_CLOSURE. Thank you! -- nosy: +pitrou resolution: - fixed stage: patch review - resolved status: open - closed

[issue24853] Py_Finalize doesn't clean up PyImport_Inittab

2015-08-13 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24853 ___ ___ Python-bugs-list mailing

[issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4

2015-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm seeing this bug in Python 3.4.2 as well, and the patch here (tstate_trashcan.patch) appears to fix it. What is the context? Some specific C code? -- ___ Python tracker rep...@bugs.python.org

[issue24492] using custom objects as modules: AttributeErrors new in 3.5

2015-08-13 Thread Brett Cannon
Brett Cannon added the comment: I noticed you accepted the PR on Bitbucket, Larry. Should I consider your part done and I can now pull the commit into the 3.5 and default branches on hg.python.org? -- ___ Python tracker rep...@bugs.python.org

[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-13 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21159 ___

[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-13 Thread Robert Collins
Robert Collins added the comment: I've applied this since it seems Lukasz was busy. Thanks for the patch Lukasz! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21159 ___

[issue24861] deprecate importing components of IDLE

2015-08-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for doing the research. It seems that extensions are the only unknown. Steps for doing this. 1. Nick once said to start with a notice in idlelib.__init__. How about the following. The idlelib package implements the Idle application, which include

[issue24861] deprecate importing components of IDLE

2015-08-13 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24861 ___ ___ Python-bugs-list

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. The issue still looks strange to me. It looks as a result of mix Python core, library or tests of different versions. Could you please test what following commands output? import tkinter tcl = tkinter.Tcl() tcl.getboolean(42) True

[issue24860] handling of IDLE 'open module' errors

2015-08-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: I see this as two related changes: a) Leave the module name query box open when there is a error, so the user can either correct a mistake (or hit Cancel) without reopening the box and re-entering the module name. Good idea. b) Put the error message in the

[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 267422f7c927 by Robert Collins in branch '3.4': Issue #21159: Improve message in configparser.InterpolationMissingOptionError. https://hg.python.org/cpython/rev/267422f7c927 New changeset 1a144ff2d78b by Robert Collins in branch '3.5': Issue

[issue24860] handling of IDLE 'open module' errors

2015-08-13 Thread Mark Roseman
Mark Roseman added the comment: Exactly. The querydialog code (which will replace the simpledialog askstring/askinteger calls) displays errors as shown in querydialog.png, with the error messages disappearing as soon as you hit another key. You can also pass in a 'validator' to check if the

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks strange. Current default Tcl in Debian unstable is 8.6 [1]. New Python3 builds depend on libtcl8.6 [2]. The full version of the 8.4 branch is 8.4.20 [3], this is the last release in the 8.4 branch. Perhaps your installation was not updated too

[issue24861] deprecate importing components of IDLE

2015-08-13 Thread Mark Roseman
New submission from Mark Roseman: One of the concerns with making significant structural changes to the IDLE codebase is breakage of external that might import a piece of idlelib (so not just 'import idlelib' but a particular submodule). PEP 434 already makes the case that this behaviour is

[issue24860] handling of IDLE 'open module' errors

2015-08-13 Thread Mark Roseman
New submission from Mark Roseman: In EditorWindow.open_module... once switch to querydialog, display errors (e.g. module not found) in askstring dialog itself, not open up subsequent 'showerror' dialog -- components: IDLE messages: 248539 nosy: kbk, markroseman, roger.serwy,

[issue24860] handling of IDLE 'open module' errors

2015-08-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Where is querydialog? (It looks like something than should be in tkinter ;-). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860 ___

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2015-08-13 Thread Larry Hastings
Larry Hastings added the comment: Assuming that ICC_NAN_STRICT is only on for Intel icc: yes, please. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21167 ___

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Laura. Looks as binary _tkinter is out of sync with the library and tests. Failing tests were added in issue15133 together with related changes in Python library (added BooleanVar.set and other changes) and _tkinter (changed getboolean()). If Debian

[issue24492] using custom objects as modules: AttributeErrors new in 3.5

2015-08-13 Thread Larry Hastings
Larry Hastings added the comment: Yep. This time I have foisted nearly all the work, including the forward-merging, onto y'all. *sits back, sips iced coffee* -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24492

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Laura Creighton
Laura Creighton added the comment: So this is a debian packaging issue we need to tell the debian package maintainers about? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___

[issue24862] subprocess.Popen behaves incorrect when moved in process tree

2015-08-13 Thread Andre Merzky
New submission from Andre Merzky: - create a class which is a subclass of multiprocessing.Process ('A') - in its __init__ create new thread ('B') and share a queue with it - in A's run() method, run 'C=subprocess.Popen(args=/bin/false)' - push 'C' though the queue to 'B' - call 'C.pull()' --

[issue24860] handling of IDLE 'open module' errors

2015-08-13 Thread Mark Roseman
Mark Roseman added the comment: Work in progress, have a few more tweaks to make, but here's a snapshot... -- Added file: http://bugs.python.org/file40176/querydialog.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24860

[issue24854] Null check handle return by new_string()

2015-08-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 208d6d14c2a3 by Benjamin Peterson in branch '2.7': add missing NULL checks to get_coding_spec (closes #24854) https://hg.python.org/cpython/rev/208d6d14c2a3 -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this looks as packaging issue. Added Matthias Klose, the Debian package maintainer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24858 ___

[issue24859] ctypes.Structure bit order is reversed - counts from right

2015-08-13 Thread Martin Panter
Martin Panter added the comment: It would be helpful if you could trim down your example code a bit. Without studying the whole file, it is hard to see exactly what order you are seeing and what order you expect, since there are two versions with different orders in the code. My

[issue24858] python3 -m test -ugui -v test_tk gives 3 failures under Debian unstable (sid)

2015-08-13 Thread Laura Creighton
Laura Creighton added the comment: Python 3.4.3+ (default, Jul 28 2015, 13:17:50) [GCC 4.9.3] on linux Type help, copyright, credits or license for more information. import tkinter tcl = tkinter.Tcl() tcl.getboolean(42) 42 tkinter.BooleanVar.set function BooleanVar.set at 0x7f15b780bea0 print

[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-13 Thread Paul Murphy
Paul Murphy added the comment: Somehow, you need to preserve access to the stack memory. The generated code is still growing the stack, it just fails to touch any of it. I'm guessing a volatile access would just add an extra non-stack access to the infinite loop. Initially, I had tried

[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Initially, I had tried creating a non-inlined function to touch the stack memory. It worked in this case, but still required some undesirable compiler specific assistance. Hmm... store the non-inlined function's pointer in a volatile global, and call that

[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-13 Thread Steve Dower
Steve Dower added the comment: No, any machine with Visual Studio installed is unaffected by this. That buildbot seems to have a previous failed/aborted build that still has some files locked. A reboot is the easiest solution, but going through and killing any extra processes is what's needed