From tjreedy at udel.edu Thu Aug 8 07:28:34 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Thu, 08 Aug 2013 01:28:34 -0400 Subject: [Idle-dev] Test coverage for Idle Message-ID: Although regrtest supposedly has a coverage option (I could not get it to work ;-), the devguide recommends cloning coveragepy (with unix instructions). I wrote the following cover.bat file for using it on windows. @echo off rem Usage: cover fileName [test_ suffix] # proper case required setlocal set py=py33\pcbuild\python_d set src=idlelib.%1 if "%2" EQU "" set tst=py33/Lib/idlelib/%1.py if "%2" NEQ "" set tst=py33/Lib/idlelib/idle_test/test_%2.py %py% coveragepy run --pylib --source=%src% %tst% %py% coveragepy report --show-missing %py% coveragepy html htmlcov\py33_Lib_idlelib_%1.html The last line opens the report in the default browser. In includes a copy of the target file with missed lines highlighted in pink. Very nice, and mush better than regrtest would do even if it worked. I used 'cover FormatParagraph' to identify the lines missed by Phil's last patch for test_formatparagraph and added tests to boost covereage to 100% (the 'if __name__' block in FormatParagraph.py prevents it as being recognized as 100%, but it is) -- Terry Jan Reedy From rovitotv at gmail.com Mon Aug 19 02:48:25 2013 From: rovitotv at gmail.com (Todd V Rovito) Date: Sun, 18 Aug 2013 20:48:25 -0400 Subject: [Idle-dev] Missing unittest.mock in Python2 world be problem in making unitest for IDLE. In-Reply-To: References: Message-ID: Tomoki, This summer we are making great progress on unit tests. For a good example I would look at the unit tests for format paragraph from the latest repository. You can still "mock" an object with out the mock module. For next year's GSoC we will evaluate current progress and see what we have left but at this point nobody has decided to do another effort for unit tests in IDLE. Sent from my iPhone On Apr 19, 2013, at 8:17 PM, Tomoki Imai wrote: > Hi. > > I'm a student thinking of participating in Google Summer of Code. > And I'm looking for a guidance. > The proposal that I want to make is "Unit Test framework for IDLE". > http://wiki.python.org/moin/SummerOfCode/2013/python-core > > I emailed to Todd Rovito and read idlelib for a while,read following link. > http://bugs.python.org/issue15392 > > Using unittest.mock seemed to be good way to test GUI. > But there is a problem. > There is no unittest.mock in Python2. > http://docs.python.org/2/library/unittest.html > > I think using third party mock seemed to be ok, but not best way. > https://pypi.python.org/pypi/mock > Because, IDLE is a part of official python. > I think relying on third party module is not good. > > Do you have any advice? > > Thanks. > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/mailman/listinfo/idle-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From arie.schlesinger at gmail.com Sun Aug 4 23:07:34 2013 From: arie.schlesinger at gmail.com (Arie Schlesinger) Date: Sun, 04 Aug 2013 21:07:34 -0000 Subject: [Idle-dev] Idle does not open on mac Message-ID: Hello, I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't open. It writes "IDLE's subprocess didnit make connection.." I need this version because I prepare a course using python. Is there any suggestion ? Thank you, Arie -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Thu Aug 22 03:55:15 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 21 Aug 2013 21:55:15 -0400 Subject: [Idle-dev] A little idea to improve IDLE visually. In-Reply-To: References: Message-ID: On 5/11/2013 5:09 PM, Alexandre Boulay wrote: > Maybe we could improve the efficiency of the scrollbar in IDLE : > > - The line shows beginning of the class/definition. > > - The dot shows the end of the class/definition. > > - The indentation (slice move on the right) of line/dot should represent > the insertion of a subclass in a class The is limited to about 4 indents, but I would be okay with that. > > - Showing where the definition or class begin > > - When you have a very long text, you may want to see the structure > of your code and its class. > > - The thickness of the coloured lines must be reduced proportionally > to the size of the scrollbar But not below one pixel. > I know that IDLE is configured whith TKinter so I don't know where the > modifications will happen. I am interested in this. Please share the code either on a tracker issue or here (where I can copy it). -- Terry Jan Reedy From tjreedy at udel.edu Thu Aug 22 04:02:18 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 21 Aug 2013 22:02:18 -0400 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: On 8/4/2013 5:07 PM, Arie Schlesinger wrote: > Hello, > I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't open. > It writes "IDLE's subprocess didnit make connection.." We currently have the most trouble with this on Macs. What tcl/tk are you using? Did you follow the instructions on this page? http://www.python.org/download/mac/tcltk/ > I need this version because I prepare a course using python. Latest version, the best one to use. > Is there any suggestion ? If the instructions on the page above do not work, try starting with the -n option. -- Terry Jan Reedy From tjreedy at udel.edu Thu Aug 22 04:17:15 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Wed, 21 Aug 2013 22:17:15 -0400 Subject: [Idle-dev] A bug report In-Reply-To: References: Message-ID: On 4/2/2013 2:08 AM, Marek Koter wrote: > Clicking on any branch in File->Path Browser kills the program on > Windows Vista/7. I have never used this but will now. It works great on 64 bit 3.3.2 and 32 bit 2.7.5 on my 64 Win7 machine. Thanks for getting me to try it ;-). Bug reports require exact Python version and perhaps machine/OS details. Bugs should be tested with one of the latest releases. One can also search bugs.python.org. Searching Idle isssues for PathBrowser shows http://bugs.python.org/issue16226 "IDLE crashes on *File / Path browser*". This was fixed last November. -- Terry Jan Reedy From ronaldoussoren at mac.com Thu Aug 22 09:44:03 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 22 Aug 2013 09:44:03 +0200 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: On 4 Aug, 2013, at 23:07, Arie Schlesinger wrote: > Hello, > I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't open. > It writes "IDLE's subprocess didnit make connection.." > > I need this version because I prepare a course using python. > > Is there any suggestion ? Do you have a firewall turned on? How did you start IDLE, from the command line or through IDLE.app? If the latter, could you start using the command "/Applicatons/Python 3.3/IDLE.app/Contents/MacOS/IDLE" in the terminal? That should print any error messages to the terminal, which might give more information on why the subprocess wasn't started properly. Ronald > > Thank you, > Arie > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/mailman/listinfo/idle-dev From tjreedy at udel.edu Fri Aug 23 03:44:40 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Thu, 22 Aug 2013 21:44:40 -0400 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: On 8/21/2013 10:02 PM, Terry Reedy wrote: > On 8/4/2013 5:07 PM, Arie Schlesinger wrote: >> Hello, >> I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't >> open. >> It writes "IDLE's subprocess didnit make connection.." You might try to run python -m test test_socket test_subprocess and report the result. -- Terry Jan Reedy From andrew.svetlov at gmail.com Fri Aug 23 03:54:16 2013 From: andrew.svetlov at gmail.com (Andrew Svetlov) Date: Fri, 23 Aug 2013 04:54:16 +0300 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: I think this is a firewall issue. Probably the proper solution would use pipes instead of sockets. On Fri, Aug 23, 2013 at 4:44 AM, Terry Reedy wrote: > On 8/21/2013 10:02 PM, Terry Reedy wrote: >> >> On 8/4/2013 5:07 PM, Arie Schlesinger wrote: >>> >>> Hello, >>> I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't >>> open. >>> It writes "IDLE's subprocess didnit make connection.." > > > You might try to run > python -m test test_socket test_subprocess > and report the result. > > > > -- > Terry Jan Reedy > > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/mailman/listinfo/idle-dev -- Thanks, Andrew Svetlov From ronaldoussoren at mac.com Fri Aug 23 07:43:12 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 23 Aug 2013 07:43:12 +0200 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> On 23 Aug, 2013, at 3:54, Andrew Svetlov wrote: > I think this is a firewall issue. I don't think it is. I have the local firewall enabled on my machine and can use IDLE just fine. Arie could have a 3th-party firewall that blocks connections on the loopback device, but AFAIK most users don't use such tools. > Probably the proper solution would use pipes instead of sockets. I agree that using pipes (or even socketpair() sockets) would be cleaner than the current solution, but would that work on Windows? The current solution has the advantage of working on Linux, Windows and OSX without having separate implementations for some of the platforms. Ronald > > On Fri, Aug 23, 2013 at 4:44 AM, Terry Reedy wrote: >> On 8/21/2013 10:02 PM, Terry Reedy wrote: >>> >>> On 8/4/2013 5:07 PM, Arie Schlesinger wrote: >>>> >>>> Hello, >>>> I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't >>>> open. >>>> It writes "IDLE's subprocess didnit make connection.." >> >> >> You might try to run >> python -m test test_socket test_subprocess >> and report the result. >> >> >> >> -- >> Terry Jan Reedy >> >> _______________________________________________ >> IDLE-dev mailing list >> IDLE-dev at python.org >> http://mail.python.org/mailman/listinfo/idle-dev > > > > -- > Thanks, > Andrew Svetlov > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/mailman/listinfo/idle-dev From ronaldoussoren at mac.com Fri Aug 23 07:53:11 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 23 Aug 2013 07:53:11 +0200 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: Message-ID: <32731A08-0753-4697-8E14-F6EDAAD1C700@mac.com> On 23 Aug, 2013, at 3:44, Terry Reedy wrote: > On 8/21/2013 10:02 PM, Terry Reedy wrote: >> On 8/4/2013 5:07 PM, Arie Schlesinger wrote: >>> Hello, >>> I try to work with python 3.3.2 on macbook-air 10.8, but IDLE won't >>> open. >>> It writes "IDLE's subprocess didnit make connection.." > > You might try to run > python -m test test_socket test_subprocess > and report the result. Why? Running IDLE from the command-line is IMHO more interesting, both with: $ idle3.3 # located in /Library/Framework/Python.framework/Versions/3.3/bin and $ "/Applications/Python 3.3/IDLE.app/Contents/MacOS/IDLE" The first command starts IDLE the same way as on other platforms, the latter is the command used to start IDLE from the OSX GUI. Another command to try: $ python3.3 -c 'import idlelib.run; idlelib.run.main()' 900 That is basicly how IDLE starts its subprocess (900 is a random port number). This should print that IDLE cannot cannot connect to the main proces, on my machine followed by a hard hang that requires a force quit because the child process tries to use Tk from a thread that isn't the main thread: IDLE Subprocess: socket error: Connection refused, retrying.... IDLE Subprocess: socket error: Connection refused, retrying.... IDLE Subprocess: socket error: Connection refused, retrying.... IDLE Subprocess: Connection to IDLE GUI failed, exiting. 2013-08-23 07:49:04.670 Python[3793:1803] NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Break on void _NSAlertWarnUnsafeBackgroundThreadUsage() to debug. This will be logged only once. This may break in the future. (The last line is acompanied by a small white empty window) Ronald > > > -- > Terry Jan Reedy > > _______________________________________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/mailman/listinfo/idle-dev From tjreedy at udel.edu Fri Aug 23 17:46:36 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Fri, 23 Aug 2013 11:46:36 -0400 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> References: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> Message-ID: On 8/23/2013 1:43 AM, Ronald Oussoren wrote: > > On 23 Aug, 2013, at 3:54, Andrew Svetlov wrote: >> Probably the proper solution would use pipes instead of sockets. > > I agree that using pipes (or even socketpair() sockets) would be cleaner than the current solution, but would that work on Windows? The current solution has the advantage of working on Linux, Windows and OSX without having separate implementations for some of the platforms. I presume that subprocess.Popen.communicate 'works' on Windows, as the docs say nothing otherwise. But I do not know if there are (still) latency issues. -- Terry Jan Reedy From guido at python.org Fri Aug 23 20:13:16 2013 From: guido at python.org (Guido van Rossum) Date: Fri, 23 Aug 2013 11:13:16 -0700 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> Message-ID: I would recommend trying to use the subprocess module. I don't believe it existed when I first designed this part of IDLE. However I would not use communicate(), which is meant as a simplified API for sending one input string and waiting for the subprocess to exit. There is a low-level API to let you send multiple strings and receive output back as it becomes available. (You may have to create threads to read stdout and stderr.) On Fri, Aug 23, 2013 at 8:46 AM, Terry Reedy wrote: > On 8/23/2013 1:43 AM, Ronald Oussoren wrote: > >> >> On 23 Aug, 2013, at 3:54, Andrew Svetlov >> wrote: >> > > Probably the proper solution would use pipes instead of sockets. >>> >> >> I agree that using pipes (or even socketpair() sockets) would be cleaner >> than the current solution, but would that work on Windows? The current >> solution has the advantage of working on Linux, Windows and OSX without >> having separate implementations for some of the platforms. >> > > I presume that subprocess.Popen.communicate 'works' on Windows, as the > docs say nothing otherwise. But I do not know if there are (still) latency > issues. > > > -- > Terry Jan Reedy > > ______________________________**_________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/**mailman/listinfo/idle-dev > -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Fri Aug 23 22:41:54 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Fri, 23 Aug 2013 16:41:54 -0400 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> Message-ID: <5217C912.1090105@udel.edu> On 8/23/2013 2:13 PM, Guido van Rossum wrote: > I would recommend trying to use the subprocess module. Rev 71746, 2011-8-3, switched subprocess startup from os.spawnv to subprocess for 3.2 +, but not for 2.7 ;-(. > I don't believe > it existed when I first designed this part of IDLE. The 2.x startup line was last revised 2003-8-14 and must date from earlier. Subprocess arrived in 2.4, 2004 Nov 30. > However I would not > use communicate(), which is meant as a simplified API for sending one > input string and waiting for the subprocess to exit. Or at least get whatever output is ready. > There is a low-level API to let you send multiple strings > and receive output back as it becomes available. Right, Popen.stdin/out/err are the 'file' objects. os.popen3 also makes these available, but was unix, windows only. I presume that excludes classic Macs. Is that why sockets were used instead? Switching from sockets, which do not always connect, to pipes established as part of the popen call should also make it more feasible to always run user code in a subprocess and eliminate the -n option. http://bugs.python.org/issue16123 and thereby simplify some sections of code. Amaury suggested the switch on that issue. > (You may have to create threads to read stdout and stderr.) I hope not ;-). -- Terry Jan Reedy From guido at python.org Fri Aug 23 23:15:15 2013 From: guido at python.org (Guido van Rossum) Date: Fri, 23 Aug 2013 14:15:15 -0700 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: <5217C912.1090105@udel.edu> References: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> <5217C912.1090105@udel.edu> Message-ID: I think that classic Macs were already dead and buried when I designed this -- in my recollection I really only cared about UNIX (which includes OSX) and Windows. On Fri, Aug 23, 2013 at 1:41 PM, Terry Reedy wrote: > On 8/23/2013 2:13 PM, Guido van Rossum wrote: > >> I would recommend trying to use the subprocess module. >> > > Rev 71746, 2011-8-3, switched subprocess startup from os.spawnv to > subprocess for 3.2 +, but not for 2.7 ;-(. > > > I don't believe >> it existed when I first designed this part of IDLE. >> > > The 2.x startup line was last revised 2003-8-14 and must date from > earlier. Subprocess arrived in 2.4, 2004 Nov 30. > > > However I would not >> use communicate(), which is meant as a simplified API for sending one >> input string and waiting for the subprocess to exit. >> > > Or at least get whatever output is ready. > > > There is a low-level API to let you send multiple strings >> > > and receive output back as it becomes available. > > Right, Popen.stdin/out/err are the 'file' objects. > > os.popen3 also makes these available, but was unix, windows only. I > presume that excludes classic Macs. Is that why sockets were used instead? > > Switching from sockets, which do not always connect, to pipes established > as part of the popen call should also make it more feasible to always run > user code in a subprocess and eliminate the -n option. > http://bugs.python.org/**issue16123 > and thereby simplify some sections of code. Amaury suggested the switch on > that issue. > > > (You may have to create threads to read stdout and stderr.) >> > > I hope not ;-). > > > -- > Terry Jan Reedy > > ______________________________**_________________ > IDLE-dev mailing list > IDLE-dev at python.org > http://mail.python.org/**mailman/listinfo/idle-dev > -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjreedy at udel.edu Sat Aug 24 01:36:07 2013 From: tjreedy at udel.edu (Terry Reedy) Date: Fri, 23 Aug 2013 19:36:07 -0400 Subject: [Idle-dev] Idle does not open on mac In-Reply-To: References: <1F79D22A-8BEE-4A21-B08B-A3EC2EEF4564@mac.com> Message-ID: On 8/23/2013 2:13 PM, Guido van Rossum wrote: > I would recommend trying to use the subprocess module. http://bugs.python.org/issue18823 Help is needed. -- Terry Jan Reedy