From noreply at sourceforge.net Wed Dec 1 06:44:58 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Dec 1 06:45:07 2004 Subject: [Patches] [ python-Patches-1075928 ] AUTH PLAIN in smtplib Message-ID: Patches item #1075928, was opened at 2004-11-30 11:27 Message generated for change (Comment added) made by flyingboy You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1075928&group_id=5470 Category: Library (Lib) Group: None Status: Open Resolution: None Priority: 5 Submitted By: James Lan (flyingboy) Assigned to: Johannes Gijsbers (jlgijsbers) Summary: AUTH PLAIN in smtplib Initial Comment: smtplib can not log in to some server using command AUTH PLAIN, it sends ``user\0user\0pass'' to the server, but ``\0user\0pass'' has better compatibility. ---------------------------------------------------------------------- >Comment By: James Lan (flyingboy) Date: 2004-12-01 05:44 Message: Logged In: YES user_id=222344 Some freemail servers in China :-( If you could read chinese, you can try registering an account at www.126.com :-) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-11-30 12:13 Message: Logged In: YES user_id=469548 Assigning to me for commit after the trunk opens again, as it shouldn't be harmful. James, I'm just wondering what servers are so broken that they can't handle the first form? ---------------------------------------------------------------------- Comment By: James Lan (flyingboy) Date: 2004-11-30 11:33 Message: Logged In: YES user_id=222344 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. In addition, even if you *did* check this checkbox, a bug in SourceForge prevents attaching a file when *creating* an issue. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1075928&group_id=5470 From noreply at sourceforge.net Wed Dec 1 15:03:19 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Dec 1 15:03:25 2004 Subject: [Patches] [ python-Patches-1071755 ] raise error for common mistake with subprocess Message-ID: Patches item #1071755, was opened at 2004-11-23 15:35 Message generated for change (Comment added) made by astrand You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071755&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Nick Craig-Wood (ncw) Assigned to: Nobody/Anonymous (nobody) Summary: raise error for common mistake with subprocess Initial Comment: subprocess has a very easy to mistake error in it - forgetting to pass the command as a list. Eg >>> import subprocess >>> subprocess.call("ls") BaseHTTPServer.py dummy_threading.py pickletools.py socket.py Bastion.py email pipes.py sre.py [...] dummy_thread.py pickle.pyc sndhdr.py zipfile.py 0 >>> subprocess.call("ls", "-l") BaseHTTPServer.py dummy_threading.py pickletools.py socket.py Bastion.py email pipes.py sre.py [...] dummy_thread.py pickle.pyc sndhdr.py zipfile.py 0 >>> # Note no error, warning or anything, but no "ls -l" either And with the patch... >>> subprocess.call("ls", "-l") Traceback (most recent call last): File "", line 1, in ? File "subprocess.py", line 428, in call return Popen(*args, **kwargs).wait() File "subprocess.py", line 508, in __init__ raise TypeError("bufsize must be an integer - " TypeError: bufsize must be an integer - did you forget to pass your arguments in a list? >>> ---------------------------------------------------------------------- >Comment By: Peter ?strand (astrand) Date: 2004-12-01 15:03 Message: Logged In: YES user_id=344921 Should be applied to the 2.4 branch as well. ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-11-30 22:55 Message: Logged In: YES user_id=344921 I've applied the patch (slightly modified) on the CVS trunk: subprocess.py 1.10 test_subprocess.py 1.16 I've not committed the patch to the 2.4 branch, however. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071755&group_id=5470 From noreply at sourceforge.net Wed Dec 1 15:04:39 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Dec 1 15:04:43 2004 Subject: [Patches] [ python-Patches-1071764 ] a new subprocess.call which raises an error on non-zero rc Message-ID: Patches item #1071764, was opened at 2004-11-23 15:45 Message generated for change (Comment added) made by astrand You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Nick Craig-Wood (ncw) Assigned to: Nobody/Anonymous (nobody) Summary: a new subprocess.call which raises an error on non-zero rc Initial Comment: The attached patch introduces a 3rd utility function - xcall() to the subprocess module. This function acts just like call but raises errors if the command had a non-zero return code. This saves writing if call(...): raise OSError(...) It is most useful for shell script replacement programming. Checking the return codes of commands called is often forgotten in shell programming. When you've moved up to python because shell is too limiting (usually about 10 lines of shell in my case ;-) you want to make sure that all your commands work so you write robust code. I consider raising an exception to be much more pythonic than checking a return code (ie "Errors should never pass silently" from Zen of Python) Eg # An easy to miss error >>> subprocess.call(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory 1 >>> # user forgot to check non-zero return code # becomes an impossible to miss exception >>> subprocess.xcall(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory Traceback (most recent call last): File "", line 1, in ? File "subprocess.py", line 462, in xcall raise CalledProcessError(rc, "Command %s returned non zero exit status" % args[0]) subprocess.CalledProcessError: [Errno 1] Command ['mkdir', 'a/b'] returned non zero exit status >>> See attached patch for more! Its been tested under python 2.3 on windows and linux. ---------------------------------------------------------------------- >Comment By: Peter ?strand (astrand) Date: 2004-12-01 15:04 Message: Logged In: YES user_id=344921 Since this is a new feature, the patch will go into trunk, but not the 2.4 maint branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 From noreply at sourceforge.net Wed Dec 1 16:32:13 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Dec 1 16:32:14 2004 Subject: [Patches] [ python-Patches-1076826 ] readline does not need termcap Message-ID: Patches item #1076826, was opened at 2004-12-01 16:32 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: readline does not need termcap Initial Comment: Readline doesn't need -ltermcap (at least on some systems), so configure check should deal with this. Attached patch completely removes -ltermcap, however better might be to check both possibilities. Patch is against 2.3.3, however it applies to 2.4 also. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 From canadianpublications at bigstring.com Wed Dec 1 23:50:05 2004 From: canadianpublications at bigstring.com (info) Date: Thu Dec 2 00:36:27 2004 Subject: [Patches] Press release patches@python.org Message-ID: <200412012250.iB1MoK932462@smtpauthproxy.prontonetworks.com> patches@python.org Canadian Subsidy Directory 4865 Hwy. 138 St-Andrews west Ontario K0C 2A0 CANADIAN SUBSIDY DIRECTORY YEAR 2004 EDITION PRESS RELEASE Legal Deposit-National Library of Canada ISBN 2-922870-05-7 The revised edition of the Canadian Subsidy Directory is available. The most complete and affordable reference for anyone looking for financial support. It is deemed to be the perfect tool for new or existing businesses, individual ventures, foundations and associations. This Publication contains more than 2600 direct and indirect financial subsidies, grants and loans offered by government departments and agencies, foundations, associations and organizations. In this 2004 edition all programs are well described. The Canadian Subsidy Directory is sold $ 69.95, to obtain a copy please call: Canadian Publications toll free at: 1 - 8 6 6 - 3 2 2 - 3 3 7 6 From noreply at sourceforge.net Thu Dec 2 07:57:06 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Dec 2 07:57:09 2004 Subject: [Patches] [ python-Patches-1077353 ] add key= argument to min and max Message-ID: Patches item #1077353, was opened at 2004-12-01 23:57 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 Category: Core (C code) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Steven Bethard (bediviere) Assigned to: Nobody/Anonymous (nobody) Summary: add key= argument to min and max Initial Comment: Adds a key= keyword argument to the builtin functions min and max. This argument works just like key for list.sort and sorted, so that the values compared by the min/max routine are produced by applying the key= function to the item under consideration. Note that key= is *only* a keyword argument and cannot be accessed as a positional argument so as not to interfere with the max(a, b, c, ...) form of the functions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 From noreply at sourceforge.net Thu Dec 2 07:59:28 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Dec 2 07:59:34 2004 Subject: [Patches] [ python-Patches-1077353 ] add key= argument to min and max Message-ID: Patches item #1077353, was opened at 2004-12-01 23:57 Message generated for change (Settings changed) made by bediviere You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 Category: Core (C code) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Steven Bethard (bediviere) >Assigned to: Raymond Hettinger (rhettinger) Summary: add key= argument to min and max Initial Comment: Adds a key= keyword argument to the builtin functions min and max. This argument works just like key for list.sort and sorted, so that the values compared by the min/max routine are produced by applying the key= function to the item under consideration. Note that key= is *only* a keyword argument and cannot be accessed as a positional argument so as not to interfere with the max(a, b, c, ...) form of the functions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 From noreply at sourceforge.net Thu Dec 2 23:41:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Dec 2 23:41:36 2004 Subject: [Patches] [ python-Patches-1077979 ] Simple webbrowser fix for netscape -remote Message-ID: Patches item #1077979, was opened at 2004-12-02 17:41 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077979&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Josh Cherry (jlcherry) Assigned to: Nobody/Anonymous (nobody) Summary: Simple webbrowser fix for netscape -remote Initial Comment: This patch simply removes a space in a netscape -remote command that is executed by webbrowser. This space caused problems with certain urls, at least with netscape 7.2. For example, webbrowser.open_new('http://www.python.org') would file, though webbrowser.open_new('http://www.python.org/') would work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077979&group_id=5470 From noreply at sourceforge.net Fri Dec 3 09:31:36 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Fri Dec 3 09:31:39 2004 Subject: [Patches] [ python-Patches-1077353 ] add key= argument to min and max Message-ID: Patches item #1077353, was opened at 2004-12-02 01:57 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 Category: Core (C code) Group: Python 2.5 >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Steven Bethard (bediviere) Assigned to: Raymond Hettinger (rhettinger) Summary: add key= argument to min and max Initial Comment: Adds a key= keyword argument to the builtin functions min and max. This argument works just like key for list.sort and sorted, so that the values compared by the min/max routine are produced by applying the key= function to the item under consideration. Note that key= is *only* a keyword argument and cannot be accessed as a positional argument so as not to interfere with the max(a, b, c, ...) form of the functions. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2004-12-03 03:31 Message: Logged In: YES user_id=80475 Added various fixups (arg handliing, error handling, ref counts, more tests, docs, news item, and acknowledgement). Accepted and applied. See: Python/bltinmodule.c 2.319 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077353&group_id=5470 From MICHAEL at MCPS-NY.COM Fri Dec 3 21:48:08 2004 From: MICHAEL at MCPS-NY.COM (MICHAEL) Date: Fri Dec 3 23:04:17 2004 Subject: [Patches] FW: Please forward this email to your Purchasing Office, Thanks! Message-ID: <20041203213429.TIYF1365.out004.verizon.net@michael> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: SPY_CAM_Price_List_3_110804.doc Type: application/msword Size: 2480128 bytes Desc: not available Url : http://mail.python.org/pipermail/patches/attachments/20041203/d56dcb30/SPY_CAM_Price_List_3_110804-0001.doc From noreply at sourceforge.net Sat Dec 4 11:14:31 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Dec 4 11:14:35 2004 Subject: [Patches] [ python-Patches-1071911 ] Add support for db 4.3 Message-ID: Patches item #1071911, was opened at 2004-11-24 02:11 Message generated for change (Comment added) made by suzuki_hisao You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071911&group_id=5470 Category: Modules Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: Add support for db 4.3 Initial Comment: Hi, attached patch adds support for db 4.3. It doens't cover almost no new constants (only one that was at least in 4.2), but just allows compiling. ---------------------------------------------------------------------- Comment By: SUZUKI Hisao (suzuki_hisao) Date: 2004-12-04 19:14 Message: Logged In: YES user_id=495142 Your patch works well, except for "has_key()". It results False always. This is because an API of DB has changed slightly: DB->get() returns DB_BUFFER_SMALL instead of ENOMEM now. For Modules/_bsddb.c, we need: @@ -2536,7 +2552,11 @@ err = self->db->get(self->db, txn, &key, &data, 0); MYDB_END_ALLOW_THREADS; FREE_DBT(key); +#if (DBVER >= 43) + return PyInt_FromLong((err == DB_BUFFER_SMALL) || (err == 0)); +#else return PyInt_FromLong((err == ENOMEM) || (err == 0)); +#endif } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071911&group_id=5470 From noreply at sourceforge.net Sun Dec 5 07:56:17 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Dec 5 07:56:20 2004 Subject: [Patches] [ python-Patches-1068277 ] os.path.exists returns False if no permission Message-ID: Patches item #1068277, was opened at 2004-11-17 16:20 Message generated for change (Comment added) made by fdrake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1068277&group_id=5470 Category: Documentation Group: Python 2.5 Status: Open >Resolution: Accepted Priority: 5 Submitted By: Robert Brewer (aminusfu) Assigned to: Nobody/Anonymous (nobody) Summary: os.path.exists returns False if no permission Initial Comment: A single new sentence for os.path.exists description, which makes it clear that it may return False even if the path actually exists. ---------------------------------------------------------------------- >Comment By: Fred L. Drake, Jr. (fdrake) Date: 2004-12-05 01:56 Message: Logged In: YES user_id=3066 This should be committed on the trunk and release24-maint branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1068277&group_id=5470 From noreply at sourceforge.net Sun Dec 5 19:59:09 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Dec 5 19:59:14 2004 Subject: [Patches] [ python-Patches-1076826 ] readline does not need termcap Message-ID: Patches item #1076826, was opened at 2004-12-01 16:32 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 Category: Library (Lib) Group: Python 2.4 >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: readline does not need termcap Initial Comment: Readline doesn't need -ltermcap (at least on some systems), so configure check should deal with this. Attached patch completely removes -ltermcap, however better might be to check both possibilities. Patch is against 2.3.3, however it applies to 2.4 also. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-12-05 19:59 Message: Logged In: YES user_id=21627 The patch is incorrect. As you suggest yourself, readline *does* need -ltermcap on some systems; this patch breaks these systems. Rejecting the patch. If you can come up with a patch that performs an autoconf test first, please submit a new patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 From noreply at sourceforge.net Sun Dec 5 21:05:58 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Dec 5 21:06:04 2004 Subject: [Patches] [ python-Patches-1071755 ] raise error for common mistake with subprocess Message-ID: Patches item #1071755, was opened at 2004-11-23 15:35 Message generated for change (Comment added) made by astrand You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071755&group_id=5470 Category: Library (Lib) Group: Python 2.4 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nick Craig-Wood (ncw) Assigned to: Nobody/Anonymous (nobody) Summary: raise error for common mistake with subprocess Initial Comment: subprocess has a very easy to mistake error in it - forgetting to pass the command as a list. Eg >>> import subprocess >>> subprocess.call("ls") BaseHTTPServer.py dummy_threading.py pickletools.py socket.py Bastion.py email pipes.py sre.py [...] dummy_thread.py pickle.pyc sndhdr.py zipfile.py 0 >>> subprocess.call("ls", "-l") BaseHTTPServer.py dummy_threading.py pickletools.py socket.py Bastion.py email pipes.py sre.py [...] dummy_thread.py pickle.pyc sndhdr.py zipfile.py 0 >>> # Note no error, warning or anything, but no "ls -l" either And with the patch... >>> subprocess.call("ls", "-l") Traceback (most recent call last): File "", line 1, in ? File "subprocess.py", line 428, in call return Popen(*args, **kwargs).wait() File "subprocess.py", line 508, in __init__ raise TypeError("bufsize must be an integer - " TypeError: bufsize must be an integer - did you forget to pass your arguments in a list? >>> ---------------------------------------------------------------------- >Comment By: Peter ?strand (astrand) Date: 2004-12-05 21:05 Message: Logged In: YES user_id=344921 Now applied to 2.4-branch: subprocess.py: 1.8.2.2 test_subprocess.py: 1.15.2.1 ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-12-01 15:03 Message: Logged In: YES user_id=344921 Should be applied to the 2.4 branch as well. ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-11-30 22:55 Message: Logged In: YES user_id=344921 I've applied the patch (slightly modified) on the CVS trunk: subprocess.py 1.10 test_subprocess.py 1.16 I've not committed the patch to the 2.4 branch, however. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071755&group_id=5470 From noreply at sourceforge.net Sun Dec 5 22:20:42 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Dec 5 22:20:45 2004 Subject: [Patches] [ python-Patches-1071764 ] a new subprocess.call which raises an error on non-zero rc Message-ID: Patches item #1071764, was opened at 2004-11-23 15:45 Message generated for change (Comment added) made by astrand You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Nick Craig-Wood (ncw) Assigned to: Nobody/Anonymous (nobody) Summary: a new subprocess.call which raises an error on non-zero rc Initial Comment: The attached patch introduces a 3rd utility function - xcall() to the subprocess module. This function acts just like call but raises errors if the command had a non-zero return code. This saves writing if call(...): raise OSError(...) It is most useful for shell script replacement programming. Checking the return codes of commands called is often forgotten in shell programming. When you've moved up to python because shell is too limiting (usually about 10 lines of shell in my case ;-) you want to make sure that all your commands work so you write robust code. I consider raising an exception to be much more pythonic than checking a return code (ie "Errors should never pass silently" from Zen of Python) Eg # An easy to miss error >>> subprocess.call(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory 1 >>> # user forgot to check non-zero return code # becomes an impossible to miss exception >>> subprocess.xcall(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory Traceback (most recent call last): File "", line 1, in ? File "subprocess.py", line 462, in xcall raise CalledProcessError(rc, "Command %s returned non zero exit status" % args[0]) subprocess.CalledProcessError: [Errno 1] Command ['mkdir', 'a/b'] returned non zero exit status >>> See attached patch for more! Its been tested under python 2.3 on windows and linux. ---------------------------------------------------------------------- >Comment By: Peter ?strand (astrand) Date: 2004-12-05 22:20 Message: Logged In: YES user_id=344921 My suggested name is "check_call". ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-12-01 15:04 Message: Logged In: YES user_id=344921 Since this is a new feature, the patch will go into trunk, but not the 2.4 maint branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 From noreply at sourceforge.net Mon Dec 6 05:05:58 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 05:06:01 2004 Subject: [Patches] [ python-Patches-1079729 ] Make cgi.py use logging module Message-ID: Patches item #1079729, was opened at 2004-12-05 20:05 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079729&group_id=5470 Category: Library (Lib) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Josh Hoyt (joshhoyt) Assigned to: Nobody/Anonymous (nobody) Summary: Make cgi.py use logging module Initial Comment: The attached patch makes the CGI module use the logging module for logging. There is no change in behaviour for the old idioms of using the cgi module's built-in logging facility, but this allows users to use the logging framework to direct and format log messages. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079729&group_id=5470 From noreply at sourceforge.net Mon Dec 6 05:22:10 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 05:22:13 2004 Subject: [Patches] [ python-Patches-1079734 ] Make cgi.py use email instead of rfc822 or mimetools Message-ID: Patches item #1079734, was opened at 2004-12-05 20:22 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079734&group_id=5470 Category: Library (Lib) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Josh Hoyt (joshhoyt) Assigned to: Nobody/Anonymous (nobody) Summary: Make cgi.py use email instead of rfc822 or mimetools Initial Comment: Remove dependencies on (deprecated) rfc822 and mimetools modules, replacing with email. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079734&group_id=5470 From noreply at sourceforge.net Mon Dec 6 11:33:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 11:33:49 2004 Subject: [Patches] [ python-Patches-1079734 ] Make cgi.py use email instead of rfc822 or mimetools Message-ID: Patches item #1079734, was opened at 2004-12-05 23:22 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079734&group_id=5470 Category: Library (Lib) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Josh Hoyt (joshhoyt) >Assigned to: Barry A. Warsaw (bwarsaw) Summary: Make cgi.py use email instead of rfc822 or mimetools Initial Comment: Remove dependencies on (deprecated) rfc822 and mimetools modules, replacing with email. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1079734&group_id=5470 From noreply at sourceforge.net Mon Dec 6 11:38:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 11:38:53 2004 Subject: [Patches] [ python-Patches-1070218 ] Add BLANK_LINE to token.py Message-ID: Patches item #1070218, was opened at 2004-11-20 16:58 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1070218&group_id=5470 Category: Library (Lib) Group: None Status: Open Resolution: None Priority: 5 Submitted By: logistix (logistix) >Assigned to: Jeremy Hylton (jhylton) Summary: Add BLANK_LINE to token.py Initial Comment: The parser module generates an ast node number 54 for an entirely blank line. These lines are apparently ignored by the real parser, and don't have a real definition in include\token.h. Presumably because of that they don't have an entry in token.py. However, this broke an app where I hardcoded the number and recent language features have changed the mapping of numbers to token names. I think there should be a BLANK_LINE defined in token.py so that it can be referred to by name, even if it's not used in the real parser. While dealing with parsermodule generated ast-trees, "symbol.sym_name[node] or token.tok_name[node]" should always be true. ---------------------------------------------------------------------- Comment By: logistix (logistix) Date: 2004-11-21 19:41 Message: Logged In: YES user_id=699438 A few clarifications: On further review, the node number 54 comes from tokenize.py, not the parsermodule. I also meant to say that "symbol.sym_name.has_key(node) or token.tok_name.has_key(node)" should always be true. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1070218&group_id=5470 From noreply at sourceforge.net Mon Dec 6 12:09:28 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 12:09:32 2004 Subject: [Patches] [ python-Patches-1071911 ] Add support for db 4.3 Message-ID: Patches item #1071911, was opened at 2004-11-23 18:11 Message generated for change (Comment added) made by nijel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071911&group_id=5470 Category: Modules Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: Add support for db 4.3 Initial Comment: Hi, attached patch adds support for db 4.3. It doens't cover almost no new constants (only one that was at least in 4.2), but just allows compiling. ---------------------------------------------------------------------- >Comment By: Michal Čihař (nijel) Date: 2004-12-06 12:09 Message: Logged In: YES user_id=192186 Yes, you're right I missed that (or better to say: I looked just at compile time errors). Updated patch with included your hunk. ---------------------------------------------------------------------- Comment By: SUZUKI Hisao (suzuki_hisao) Date: 2004-12-04 11:14 Message: Logged In: YES user_id=495142 Your patch works well, except for "has_key()". It results False always. This is because an API of DB has changed slightly: DB->get() returns DB_BUFFER_SMALL instead of ENOMEM now. For Modules/_bsddb.c, we need: @@ -2536,7 +2552,11 @@ err = self->db->get(self->db, txn, &key, &data, 0); MYDB_END_ALLOW_THREADS; FREE_DBT(key); +#if (DBVER >= 43) + return PyInt_FromLong((err == DB_BUFFER_SMALL) || (err == 0)); +#else return PyInt_FromLong((err == ENOMEM) || (err == 0)); +#endif } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071911&group_id=5470 From noreply at sourceforge.net Mon Dec 6 12:18:31 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 12:18:35 2004 Subject: [Patches] [ python-Patches-1076826 ] readline does not need termcap Message-ID: Patches item #1076826, was opened at 2004-12-01 16:32 Message generated for change (Comment added) made by nijel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 Category: Library (Lib) Group: Python 2.4 >Status: Open >Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: readline does not need termcap Initial Comment: Readline doesn't need -ltermcap (at least on some systems), so configure check should deal with this. Attached patch completely removes -ltermcap, however better might be to check both possibilities. Patch is against 2.3.3, however it applies to 2.4 also. ---------------------------------------------------------------------- >Comment By: Michal Čihař (nijel) Date: 2004-12-06 12:18 Message: Logged In: YES user_id=192186 Okay, here is IMHO correct patch, which does more or less same as setup.py does for finding needed libraries. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-12-05 19:59 Message: Logged In: YES user_id=21627 The patch is incorrect. As you suggest yourself, readline *does* need -ltermcap on some systems; this patch breaks these systems. Rejecting the patch. If you can come up with a patch that performs an autoconf test first, please submit a new patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 From noreply at sourceforge.net Mon Dec 6 18:15:26 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 18:15:29 2004 Subject: [Patches] [ python-Patches-1080078 ] list sort is not "in place" Message-ID: Patches item #1080078, was opened at 2004-12-06 19:15 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 Category: Documentation Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Heikki Orsila (shd) Assigned to: Nobody/Anonymous (nobody) Summary: list sort is not "in place" Initial Comment: list sort method says the sort algorithm is "in place", but it is not. It requires O(N) extra memory at worst case. A patch is attached that corrects the documentation in Objects/listobjects.c. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 From noreply at sourceforge.net Mon Dec 6 18:48:54 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 18:48:59 2004 Subject: [Patches] [ python-Patches-1080078 ] list sort is not "in place" Message-ID: Patches item #1080078, was opened at 2004-12-06 12:15 Message generated for change (Settings changed) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 Category: Documentation Group: Python 2.4 >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Heikki Orsila (shd) >Assigned to: Tim Peters (tim_one) Summary: list sort is not "in place" Initial Comment: list sort method says the sort algorithm is "in place", but it is not. It requires O(N) extra memory at worst case. A patch is attached that corrects the documentation in Objects/listobjects.c. ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2004-12-06 12:48 Message: Logged In: YES user_id=31435 Sorry, I'm rejecting this. Of course it's "in place": x.sort() does not return a new list. Its only visible effect is to permute the elements of x. That's what "in place" means. That the current implementation may require temp memory is irrelevant to that, and *because* it's an internal implementation detail, doesn't belong in the docstring. The "in place" was added to the docstring because many newcomers believed x.sort() left x alone, and returned a new list in sorted order (which is what the new-in-2.4 sorted() builtin does). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 From noreply at sourceforge.net Mon Dec 6 18:49:31 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 18:49:35 2004 Subject: [Patches] [ python-Patches-1080078 ] list sort is not "in place" Message-ID: Patches item #1080078, was opened at 2004-12-06 12:15 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 Category: Documentation Group: Python 2.4 >Status: Open Resolution: Rejected Priority: 5 Submitted By: Heikki Orsila (shd) >Assigned to: Nobody/Anonymous (nobody) Summary: list sort is not "in place" Initial Comment: list sort method says the sort algorithm is "in place", but it is not. It requires O(N) extra memory at worst case. A patch is attached that corrects the documentation in Objects/listobjects.c. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2004-12-06 12:49 Message: Logged In: YES user_id=80475 Sorry, the patch is not right. In-place is meant to communicate thet the original list is mutated. Contrast that with the behavior of sorted() which leaves the original intact. Perhaps you are thinking in terms of heapsort which is in-place and requires no additional auxiliary storage. While that is not true for the current algorithm, we do not document or make promises about the memory requirements -- that is considered to be an implementation detail that is subject to change. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-12-06 12:48 Message: Logged In: YES user_id=31435 Sorry, I'm rejecting this. Of course it's "in place": x.sort() does not return a new list. Its only visible effect is to permute the elements of x. That's what "in place" means. That the current implementation may require temp memory is irrelevant to that, and *because* it's an internal implementation detail, doesn't belong in the docstring. The "in place" was added to the docstring because many newcomers believed x.sort() left x alone, and returned a new list in sorted order (which is what the new-in-2.4 sorted() builtin does). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 From noreply at sourceforge.net Mon Dec 6 18:49:46 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 18:49:52 2004 Subject: [Patches] [ python-Patches-1080078 ] list sort is not "in place" Message-ID: Patches item #1080078, was opened at 2004-12-06 12:15 Message generated for change (Settings changed) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 Category: Documentation Group: Python 2.4 >Status: Closed Resolution: Rejected Priority: 5 Submitted By: Heikki Orsila (shd) Assigned to: Nobody/Anonymous (nobody) Summary: list sort is not "in place" Initial Comment: list sort method says the sort algorithm is "in place", but it is not. It requires O(N) extra memory at worst case. A patch is attached that corrects the documentation in Objects/listobjects.c. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-12-06 12:49 Message: Logged In: YES user_id=80475 Sorry, the patch is not right. In-place is meant to communicate thet the original list is mutated. Contrast that with the behavior of sorted() which leaves the original intact. Perhaps you are thinking in terms of heapsort which is in-place and requires no additional auxiliary storage. While that is not true for the current algorithm, we do not document or make promises about the memory requirements -- that is considered to be an implementation detail that is subject to change. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-12-06 12:48 Message: Logged In: YES user_id=31435 Sorry, I'm rejecting this. Of course it's "in place": x.sort() does not return a new list. Its only visible effect is to permute the elements of x. That's what "in place" means. That the current implementation may require temp memory is irrelevant to that, and *because* it's an internal implementation detail, doesn't belong in the docstring. The "in place" was added to the docstring because many newcomers believed x.sort() left x alone, and returned a new list in sorted order (which is what the new-in-2.4 sorted() builtin does). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 From noreply at sourceforge.net Mon Dec 6 22:26:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 22:26:06 2004 Subject: [Patches] [ python-Patches-1075928 ] AUTH PLAIN in smtplib Message-ID: Patches item #1075928, was opened at 2004-11-30 12:27 Message generated for change (Comment added) made by jlgijsbers You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1075928&group_id=5470 Category: Library (Lib) Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: James Lan (flyingboy) Assigned to: Johannes Gijsbers (jlgijsbers) Summary: AUTH PLAIN in smtplib Initial Comment: smtplib can not log in to some server using command AUTH PLAIN, it sends ``user\0user\0pass'' to the server, but ``\0user\0pass'' has better compatibility. ---------------------------------------------------------------------- >Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-12-06 22:26 Message: Logged In: YES user_id=469548 Checked in on HEAD as rev 1.66 of smtplib.py. ---------------------------------------------------------------------- Comment By: James Lan (flyingboy) Date: 2004-12-01 06:44 Message: Logged In: YES user_id=222344 Some freemail servers in China :-( If you could read chinese, you can try registering an account at www.126.com :-) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-11-30 13:13 Message: Logged In: YES user_id=469548 Assigning to me for commit after the trunk opens again, as it shouldn't be harmful. James, I'm just wondering what servers are so broken that they can't handle the first form? ---------------------------------------------------------------------- Comment By: James Lan (flyingboy) Date: 2004-11-30 12:33 Message: Logged In: YES user_id=222344 There's no uploaded file! You have to check the checkbox labeled "Check to Upload & Attach File" when you upload a file. In addition, even if you *did* check this checkbox, a bug in SourceForge prevents attaching a file when *creating* an issue. Please try again. (This is a SourceForge annoyance that we can do nothing about. :-( ) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1075928&group_id=5470 From noreply at sourceforge.net Mon Dec 6 22:35:23 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 22:35:32 2004 Subject: [Patches] [ python-Patches-736962 ] Port tests to unittest (Part 2) Message-ID: Patches item #736962, was opened at 2003-05-13 12:45 Message generated for change (Comment added) made by jlgijsbers You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=736962&group_id=5470 Category: Tests Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter D?rwald (doerwalter) Assigned to: Nobody/Anonymous (nobody) Summary: Port tests to unittest (Part 2) Initial Comment: Here are the next test scripts ported to PyUnit: test_winsound and test_array. For test_array many additional tests have been added (code coverage is at 91%) ---------------------------------------------------------------------- >Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-12-06 22:35 Message: Logged In: YES user_id=469548 Just reviewed my test_inspect conversion again and didn't find any faults. Does anyone have the time to review it or should I just check it in? http://python.org/sf/1011890 is waiting on this conversion, so I'm aching to go. :) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-09-24 23:42 Message: Logged In: YES user_id=469548 Checked in as rev 1.8 of test_unpack.py. Thanks for the review! ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-09-22 20:36 Message: Logged In: YES user_id=89016 test_unpack_doctest.py looks good. Please check it in (as test_unpack.py) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-09-08 17:37 Message: Logged In: YES user_id=469548 Yeah, bug #1023798 reported that and Brett fixed it. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-09-07 22:34 Message: Logged In: YES user_id=89016 I'm getting the following error from the new test__locale: test test__locale failed -- Traceback (most recent call last): File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/test/test__locale.py", line 37, in test_lc_numeric "%r != %r (%s); " File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/locale.py", line 363, in getlocale return _parse_localename(localename) File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/locale.py", line 278, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: lv_LV BTW, could someone have a look at Johannes' test_doctest and test_inspect patches? ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-09-07 04:32 Message: Logged In: YES user_id=357491 OK, test__locale has been checked in. ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-30 13:00 Message: Logged In: YES user_id=469548 Brett: that's just one of the drawbacks of doing data-driven testing with unittest. I don't think it's terribly important, so the test is OK to me. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-08-27 05:44 Message: Logged In: YES user_id=357491 Just attached a new version of test__locale. Since it is so small of a file and the change so drastic I just uploaded the whole file. Only drawback is before the test kept testing all locales when there was a failure while my implementation stops at the first failure discovered. Don't know if it is important to test all locales. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-08-24 18:59 Message: Logged In: YES user_id=80475 Walter, I'm afraid I don't have time for these right now. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-08-20 18:39 Message: Logged In: YES user_id=89016 Raymond, can you take a look at the patches? ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-20 17:06 Message: Logged In: YES user_id=469548 Another one: ported test_inspect to unittest and moved out the inspect fodder out into two modules instead of using the ugly imp.load_source and TESTFN. I also did a bit of rearrangement so that the TestCase classes mostly match the sections in the library docs. I used a separate module (inspect_fodder2) and class for the decorators tests. Those are kind of small now, but I'll check in http://python.org/sf/1011890 after this port and let it grow without having to update test_getfunctions(). ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-19 17:14 Message: Logged In: YES user_id=469548 Hum yes, that was me trying out how doctest fails. The expected outcome should have been True. Can you try the corrected version? Test_zipfile has been checked in as rev 1.11. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-08-18 21:29 Message: Logged In: YES user_id=89016 doctest tests should be OK. The error tests in test_unpack can be done with PyUnit too, you either use self.assertRaises(ValueError, eval, "a,b = Seq()") or try: a,b = Seq() except ValueError: pass else: self.fail("failed") test_zipfile_unittest.py looks OK, but should of course be named test_zipfile.py when you check it in. test_unpack_doctest.py gives me: ********************************************** ************************ Failure in example: a == 4 and b == 5 and c == 6 from line #14 of test.test_unpack_doctest.doctests in /home/walter/Achtung/Python- test/dist/src/Lib/test/test_unpack_doctest.pyc Expected: False Got: True ********************************************** ************************ 1 items had failures: 1 of 28 in test.test_unpack_doctest.doctests ***Test Failed*** 1 failures. Traceback (most recent call last): File "Lib/test/test_unpack_doctest.py", line 133, in ? test_main(verbose=True) File "Lib/test/test_unpack_doctest.py", line 130, in test_main test_support.run_doctest(test_unpack_doctest, verbose) File "/home/walter/Achtung/Python- test/dist/src/Lib/test/test_support.py", line 318, in run_doctest raise TestFailed("%d of %d doctests failed" % (f, t)) test.test_support.TestFailed: 1 of 28 doctests failed ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-18 15:23 Message: Logged In: YES user_id=469548 Is there any problem with porting test scripts to doctest instead of unittest? doctest is just perfect for test_unpack (doctest version attached). I've also ported test_zipfile to unittest (attached as well). ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-31 18:31 Message: Logged In: YES user_id=89016 OK, checked in as: Lib/test/mapping_tests.py 1.1 Lib/test/test_os.py 1.22 Lib/test/test_shelve.py 1.7 Lib/test/test_types.py 1.60 Lib/test/test_userdict.py 1.19 Lib/test/test_weakref.py 1.39 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-29 01:02 Message: Logged In: YES user_id=80475 Looks good. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-28 22:59 Message: Logged In: YES user_id=89016 OK, I've updated the docstring for dict.update() (Object/dictobject.c 2.160) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-27 21:04 Message: Logged In: YES user_id=89016 dict_diff.txt is a patch that tries to share tests between test_dict, test_userdict, test_os, test_shelve and test_weakref. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-05-25 22:29 Message: Logged In: YES user_id=31435 Don't really care myself. Would be nice if the docstring for dict.update() matched the new realities, though . BTW, there is a reliable and conventional way to detect whether the 'dict' argument was passed to UserDict.update: use a unique marker object instead of the universally visible None. Like _marker = object() at module level, and ...(self, dict=_marker, ...) in the method defn. That can't be fooled without deliberate intent to deceive. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-25 22:21 Message: Logged In: YES user_id=80475 IMO, it is fine as is. I would be suprised if some code were relying on UserDict.update(None) raising an exception. This sort of thing also comes up also in places like the string and random modules whereever a function or method with an optional argument gets wrapped by another function. The only way around this is to use *args and then you break code that used the unfortunately named "dict" argument as a keyword. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-25 21:32 Message: Logged In: YES user_id=89016 Merging test_dict and test_userdict revealed a difference between dict and UserDict.UserDict: >>> import UserDict >>> d = UserDict.UserDict() >>> d.update(None) >>> d {} >>> d = {} >>> d.update(None) Traceback (most recent call last): File "", line 1, in ? TypeError: iteration over non-sequence Should we do anything about this? ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-20 18:03 Message: Logged In: YES user_id=80475 test_dict is fine. Consider beefing up the tests for update(). As of Py2.4, it now takes all the same argument possibilites as dict(): d.update(a=1, b=2) d.update([('a', 1), ('b', 2)]) Also, try to link in: from test_userdict import TestMappingProtocol This was supposed to provide tests common to all mappings. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-04-03 13:06 Message: Logged In: YES user_id=89016 The attached test_dict.py moves the dict tests from test_types.py to a new PyUnit test script. Code coverage for dictobject.c is at 90.76% (up from 89.51%) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-03-15 13:17 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/output/test_binascii delete Lib/test/test_binascii.py 1.17 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-13 21:26 Message: Logged In: YES user_id=80475 Okay, this one is fine. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-19 00:49 Message: Logged In: YES user_id=89016 Here's the next one: test_binascii.py. Code coverage in binascii.c is at 92% (could be improved by enhancing test_binhex.py). ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-13 23:46 Message: Logged In: YES user_id=33168 Looked good to me, test_future_pyunit.diff checked in as: * Lib/test/badsyntax_future3.py 1.2 * Lib/test/badsyntax_future4.py 1.2 * Lib/test/badsyntax_future5.py 1.2 * Lib/test/badsyntax_future6.py 1.2 * Lib/test/badsyntax_future7.py 1.2 * Lib/test/badsyntax_future8.py 1.1 * Lib/test/badsyntax_future9.py 1.1 * Lib/test/test_future.py 1.7 * Lib/test/test_future1.py 1.3 * Lib/test/test_future2.py 1.2 * Lib/test/output/test_future 1.4 ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-13 22:47 Message: Logged In: YES user_id=33168 Walter, I didn't get a mail from SF either. After you do a cvs add, you need to use -N to cvs diff. For example, cvs diff -N new_file_added_to_cvs_but_not_committed. If you look carefully, you can see this in the patch on the diff line for each file. I'll take a look at the patch. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-13 21:18 Message: Logged In: YES user_id=89016 Here is a version of test_future ported to PyUnit (test_future_pyunit.diff). If this makes sense to you Neal, please check it in. (BTW, how did you convince CVS to include badsyntax_future8.py and badsyntax_future9.py in the diff? Doing a "cvs add" only results in " Lib/test/badsyntax_future8.py is a new entry, no comparison available") ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-11 13:36 Message: Logged In: YES user_id=89016 md5/weakref patch checked in as: Lib/test/test_weakref.py 1.33 Lib/test/test_md5.py 1.5 Lib/test/output/test_md5 remove ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-11 07:05 Message: Logged In: YES user_id=33168 Improve coverage for test_future too. I'm not sure if test future can be ported to PyUnit. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-11 06:52 Message: Logged In: YES user_id=33168 Attached are two tests (in one file, I'm being lazy, sorry) to improve test coverage for md5c.c and _weakref.c. test_md5 was ported to unittest, weakref, just adds two little tests to get coverage up to 100%. If you like, just go ahead and check in. You will need to remove Lib/test/output/test_md5 ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-08 12:42 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/list_tests.py 1.1 Lib/test/seq_tests.py 1.1 Lib/test/test_list.py 1.1 Lib/test/test_tuple.py 1.1 Lib/test/test_types.py 1.56 Lib/test/test_userlist.py 1.11 Lib/test/output/test_types 1.3 Next will be test_binascii.py before I continue with test_types.py. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-12-08 00:49 Message: Logged In: YES user_id=80475 Looks good. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-11-27 20:48 Message: Logged In: YES user_id=89016 Here the first part of the test_types port: list and tuple tests have been moved to their own scripts: test_tuple.py and test_list.py. Common tests for tuple, list and UserList are shared (in seq_test.py and list_test.py) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-02 03:53 Message: Logged In: YES user_id=80475 Applied as: Lib/test/test_slice.py 1.5. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 01:52 Message: Logged In: YES user_id=80475 Looks good. I added a couple of minor tests. Revised patch attached. Okay to apply. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-31 21:49 Message: Logged In: YES user_id=89016 Thanks! Here's another one: test_slice.py ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-31 01:04 Message: Logged In: YES user_id=80475 Done. See: Lib/test/test_longexp.py 1.9; previous revision: 1.8 Lib/test/test_pep263.py 1.3; previous revision: 1.2 Lib/test/test_sets.py 1.27; previous revision: 1.26 Lib/test/test_structseq.py 1.5; previous revision: 1.4 Lib/test/output/test_longexp delete; previous revision: 1.3 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-30 19:10 Message: Logged In: YES user_id=80475 Will do! ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-30 19:06 Message: Logged In: YES user_id=89016 Here's test_structse.py converted with a few additional tests. If all three scripts are OK, could you check them in Raymond, as I'll be on vacation for three weeks? ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-09 17:47 Message: Logged In: YES user_id=89016 Here are two simple ones: test_pep263 and test_longexp. I can't think of any additional tests to add. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-23 15:38 Message: Logged In: YES user_id=80475 Fixed Walter's review comments and committed as Lib/test/test_compile.py 1.19 ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-23 13:49 Message: Logged In: YES user_id=89016 Are you sure, that the code path is the same in the new test_argument_handling() as in the old test? I.e. is "eval('lambda a,a: 0')" the same as "exec 'def f(a, a): pass'"? The print statement in test_float_literals should be changed to a comment. Should the imports in test_unary_minus() be moved to the start of the script? Otherwise the test looks (and runs) OK. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-20 21:26 Message: Logged In: YES user_id=80475 Here's one for you: test_compile.py is ready. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-19 11:46 Message: Logged In: YES user_id=89016 Maybe test_types.py should be split into several scripts: test_dict, test_tuple, test_list, test_int, test_long etc. Some of them already exist (like test_long), some don't. The constructor tests from test_builtin should probably be moved to the new test scripts as well. Furthermore we should try to share as much testing functionality as possible (e.g. between test_int and test_long, or between test_list and test_userlist) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-18 21:48 Message: Logged In: YES user_id=80475 Great! Can I suggest that test_types.py be next. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-18 16:27 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/test_builtin.py 1.21 Lib/test/test_complex.py 1.10 (I've moved the constructor tests from test_builtin to test_complex) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-18 01:49 Message: Logged In: YES user_id=80475 I added a few tests. If they are fine with you, go ahead and commit. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-17 23:36 Message: Logged In: YES user_id=89016 Here's the next one: text_complex.py. There one test that's currently commented out, because it crashes Python on Alpha (see http://www.python.org/sf/756093. The old test scripts states that tests for the constructor are in test_builtin, but I've added many tests to this script, so this is no longer true. We could move the tests to test_builtin, but IMHO that doesn't make sense, we'd better move the rest of the constructor tests from test_builtin to test_complex. I'd like to have a version of assertAlmostEqual() in unittest.py that can cope with complex numbers, but this would have to be coordinated with the standalone version of PyUnit (and it would probably have to wait until the 2.4 cycle starts) (I noticed that there is no assertAlmostEqual in the code on pyunit.sf.net anyway.) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-17 14:06 Message: Logged In: YES user_id=89016 I'd like to keep this patch open, as it is an ongoing task (the next test scripts to be converted will be test_complex and then maybe test_marshal) ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-16 23:55 Message: Logged In: YES user_id=357491 OK, all tests pass cleanly. Applied as revision 1.6. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 21:51 Message: Logged In: YES user_id=89016 The joys of unittesting: Breaking code to make it better! ;) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 21:41 Message: Logged In: YES user_id=80475 Okay, it runs fine here. Once Brett confirms that it runs on the Mac, go ahead and load it. P.S. Your improved test_mimetools.py helped detect a latent error in mimetools.py when it was run under Windows. Tim made the fix this weekend. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 21:33 Message: Logged In: YES user_id=89016 Strange, I didn't get this failure here, but I got it on my laptop at home. I've removed the comparison with the getatime() value from test_time(). I hope this fixes it. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 21:09 Message: Logged In: YES user_id=80475 Walter, there is one failure left: ====================================== ================================ FAIL: test_time (__main__.PosixPathTest) ------------------------------------------------------------------- --- Traceback (most recent call last): File "test_posixpath.py", line 125, in test_time self.assert_( File "C:\PY23\lib\unittest.py", line 268, in failUnless if not expr: raise self.failureException, msg AssertionError Brett, after Walter revises the patch, just load the patch and make sure the test runs on the Mac. Between the three of us, we can validate the suite on three different platforms. Cheers. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-16 20:20 Message: Logged In: YES user_id=357491 Just wanting to work me like a dog, huh, Raymond? =) And to clarify for my and Walter's benefit, when you say guards, you mean that the tests don't crap out and say they failed on Windows, right? I thought posixpath was not meant to work under Windows. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 20:09 Message: Logged In: YES user_id=89016 I didn't realize that test_posixpath must work on Windows too. Here's a new version. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 18:04 Message: Logged In: YES user_id=80475 The previous comment applied to another patch. It should have said: Assigning to Brett to make sure the patch runs on the Mac. Don't accept this one until it has guards that allow the tests to run on Windows. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 17:59 Message: Logged In: YES user_id=80475 Assigning to Brett to give experience doing a detail review on this type of change. * examine every line of the diff and consider whether there is any semantic change (exceptions raised, etc). * apply the diff and run the test suite * in the interactive mode, call-up each function and make sure it behaves as expected (this is necessary because the test coverage is very low). * verify that the whitespace has been cleaned up. * look for missing changes (such as use of +=) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 17:44 Message: Logged In: YES user_id=80475 The test file now has dependencies that do not apply to windows. The failure messages are attached. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 14:48 Message: Logged In: YES user_id=89016 Here's the next one: test_posixpath.py with many additional tests. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-22 19:33 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/output/test_mimetools delete Lib/test/test_mimetools.py 1.4 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-22 18:18 Message: Logged In: YES user_id=80475 test_mimetools.py is ready. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-22 17:05 Message: Logged In: YES user_id=89016 I've attached a third version of test_mimetools.py that does some checks for the mimetools.Message class. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-21 15:04 Message: Logged In: YES user_id=80475 Attaching a slightly modified test_mimetools which covers more encodings and has a stronger set test. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-19 01:46 Message: Logged In: YES user_id=89016 Agreed, this is too much magic for too little gain. Back to business: Here is test_mimetools ported to PyUnit. Tests for mimetools.Message are still missing. If you can think of any tests please add them. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 05:18 Message: Logged In: YES user_id=80475 Get the module with sys.modules: tests = test_support.findtestclasses(sys.modules [__name__]) test_support.unittest(*tests) Yeah, the inheritance thing is a problem. I was trying to avoid having to modify unittest.TestCase to have a metaclass. The control of the module is kept in a separate SF project and one of its goals is to be backward compatible through 1.5.2 (meaning no metaclasses). A possible workaround is to define a modified testcase in test_support so that people don't import unittest directly anymore: test_support.py ------------------------- import unittest class SmartTestCase(unittest.TestCase): __metaclass__ = autotracktests pass test_sets.py ------------------ class TestBasicOps(test_support.SmartTestCase): run = False . . . class TestBasicOpsEmpty(TestBasicOps): def setUp(self): . . . Still, this is starting to seem a bit magical and tricky. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 04:52 Message: Logged In: YES user_id=89016 But how do I pass the module object from inside the module? And skipping abstract classes seems to be more work in this version: If skipping is done via a class attribute, derived classes have to explicitely reset this flag because of interitance. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 03:59 Message: Logged In: YES user_id=80475 Good call. Instead of using metaclasses, perhaps add a module introspector function to test_support: def findtestclasses(mod): tests = [] for elem in dir(mod): member = getattr(mod, elem) if type(member) != type: continue if issubclass(member, unittest.TestCase): tests.append(member) return tests ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 03:45 Message: Logged In: YES user_id=89016 But this can be solved with a special non-inheritable class attribute: class BaseTest(unittest.TestCase): run = False Then the metaclass can do the following: def __new__(cls, name, bases, dict): if "run" not in dict: dict["run"] = True cls = type.__new__(cls, name, bases, dict) if cls.run: tests.append(cls) return cls ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 03:04 Message: Logged In: YES user_id=80475 I don't think metaclasses or module introspection would help whenever there are classes that derive from TestCase but are not meant to be run directly (their subclasses have the setup/teardown/or class data). test_sets.py has examples of that kind of thing. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 02:50 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/test_array.py 1.20 Lib/test/test_winsound.py 1.5 Lib/test/output/test_winsound delete > The approach of using tests.append() is elegant and > makes it easier to verify that no tests are being omitted. The most elegant approach would probably be a metaclass that collects all TestCase subclasses that get defined. Classes that only serve as a base class could be skipped by specifying a certain class attribute. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 01:35 Message: Logged In: YES user_id=80475 The approach of using tests.append() is elegant and makes it easier to verify that no tests are being omitted. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=736962&group_id=5470 From noreply at sourceforge.net Mon Dec 6 22:48:11 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 22:48:15 2004 Subject: [Patches] [ python-Patches-1062060 ] fix for 1016880 urllib.urlretrieve silently truncates dwnld Message-ID: Patches item #1062060, was opened at 2004-11-07 21:15 Message generated for change (Comment added) made by jlgijsbers You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1062060&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Irmen de Jong (irmen) Assigned to: Nobody/Anonymous (nobody) Summary: fix for 1016880 urllib.urlretrieve silently truncates dwnld Initial Comment: The patch makes urllib.urlretrieve raise an IOError if the actual download size is different from the expected size (taken from the content-length header). ---------------------------------------------------------------------- >Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-12-06 22:48 Message: Logged In: YES user_id=469548 Sorry Irmen, I'm a bit late with this, but now is the time to get new "features" checked into the trunk. Could you add a doc patch that explains the behavior as you did in your previous message and a tests patch? I can check it in then. ---------------------------------------------------------------------- Comment By: Irmen de Jong (irmen) Date: 2004-11-07 21:54 Message: Logged In: YES user_id=129426 NOTE: urllib.patch2 may be a bit better. It fixes a misspelling, and also is more relaxed about a 'wrong' download size. To be more precise: it treats content-length as a lower bound (just like wget and firefox appear to do). So if there's more data to read, it reads more data, but if less data is available, it gives an IOError ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1062060&group_id=5470 From noreply at sourceforge.net Mon Dec 6 23:29:44 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 23:29:48 2004 Subject: [Patches] [ python-Patches-1076826 ] readline does not need termcap Message-ID: Patches item #1076826, was opened at 2004-12-01 16:32 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: readline does not need termcap Initial Comment: Readline doesn't need -ltermcap (at least on some systems), so configure check should deal with this. Attached patch completely removes -ltermcap, however better might be to check both possibilities. Patch is against 2.3.3, however it applies to 2.4 also. ---------------------------------------------------------------------- >Comment By: Martin v. L?wis (loewis) Date: 2004-12-06 23:29 Message: Logged In: YES user_id=21627 This patch is still incorrect. It breaks on systems where readline requires termcap, e.g. Solaris. ---------------------------------------------------------------------- Comment By: Michal Čihař (nijel) Date: 2004-12-06 12:18 Message: Logged In: YES user_id=192186 Okay, here is IMHO correct patch, which does more or less same as setup.py does for finding needed libraries. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-12-05 19:59 Message: Logged In: YES user_id=21627 The patch is incorrect. As you suggest yourself, readline *does* need -ltermcap on some systems; this patch breaks these systems. Rejecting the patch. If you can come up with a patch that performs an autoconf test first, please submit a new patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 From noreply at sourceforge.net Mon Dec 6 23:48:44 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Mon Dec 6 23:48:48 2004 Subject: [Patches] [ python-Patches-1076826 ] readline does not need termcap Message-ID: Patches item #1076826, was opened at 2004-12-01 16:32 Message generated for change (Comment added) made by nijel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 Category: Library (Lib) Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michal Čihař (nijel) Assigned to: Nobody/Anonymous (nobody) Summary: readline does not need termcap Initial Comment: Readline doesn't need -ltermcap (at least on some systems), so configure check should deal with this. Attached patch completely removes -ltermcap, however better might be to check both possibilities. Patch is against 2.3.3, however it applies to 2.4 also. ---------------------------------------------------------------------- >Comment By: Michal Čihař (nijel) Date: 2004-12-06 23:48 Message: Logged In: YES user_id=192186 Ooops, I should better read what I write, there shouldn't be twice ncurses, once it should be termcap.... Sorry. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-12-06 23:29 Message: Logged In: YES user_id=21627 This patch is still incorrect. It breaks on systems where readline requires termcap, e.g. Solaris. ---------------------------------------------------------------------- Comment By: Michal Čihař (nijel) Date: 2004-12-06 12:18 Message: Logged In: YES user_id=192186 Okay, here is IMHO correct patch, which does more or less same as setup.py does for finding needed libraries. ---------------------------------------------------------------------- Comment By: Martin v. L?wis (loewis) Date: 2004-12-05 19:59 Message: Logged In: YES user_id=21627 The patch is incorrect. As you suggest yourself, readline *does* need -ltermcap on some systems; this patch breaks these systems. Rejecting the patch. If you can come up with a patch that performs an autoconf test first, please submit a new patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1076826&group_id=5470 From noreply at sourceforge.net Tue Dec 7 00:36:21 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Dec 7 00:36:28 2004 Subject: [Patches] [ python-Patches-736962 ] Port tests to unittest (Part 2) Message-ID: Patches item #736962, was opened at 2003-05-13 12:45 Message generated for change (Comment added) made by doerwalter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=736962&group_id=5470 Category: Tests Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Walter D?rwald (doerwalter) >Assigned to: Johannes Gijsbers (jlgijsbers) Summary: Port tests to unittest (Part 2) Initial Comment: Here are the next test scripts ported to PyUnit: test_winsound and test_array. For test_array many additional tests have been added (code coverage is at 91%) ---------------------------------------------------------------------- >Comment By: Walter D?rwald (doerwalter) Date: 2004-12-07 00:36 Message: Logged In: YES user_id=89016 What I can say is that the test script passes on my box, so if you're feeling confident just check it in. Now that Python 2.4 is out the door a problem in the test shouldn't be critical. ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-12-06 22:35 Message: Logged In: YES user_id=469548 Just reviewed my test_inspect conversion again and didn't find any faults. Does anyone have the time to review it or should I just check it in? http://python.org/sf/1011890 is waiting on this conversion, so I'm aching to go. :) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-09-24 23:42 Message: Logged In: YES user_id=469548 Checked in as rev 1.8 of test_unpack.py. Thanks for the review! ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-09-22 20:36 Message: Logged In: YES user_id=89016 test_unpack_doctest.py looks good. Please check it in (as test_unpack.py) ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-09-08 17:37 Message: Logged In: YES user_id=469548 Yeah, bug #1023798 reported that and Brett fixed it. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-09-07 22:34 Message: Logged In: YES user_id=89016 I'm getting the following error from the new test__locale: test test__locale failed -- Traceback (most recent call last): File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/test/test__locale.py", line 37, in test_lc_numeric "%r != %r (%s); " File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/locale.py", line 363, in getlocale return _parse_localename(localename) File "/home/walter/Achtung/Python-codec- small/dist/src/Lib/locale.py", line 278, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: lv_LV BTW, could someone have a look at Johannes' test_doctest and test_inspect patches? ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-09-07 04:32 Message: Logged In: YES user_id=357491 OK, test__locale has been checked in. ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-30 13:00 Message: Logged In: YES user_id=469548 Brett: that's just one of the drawbacks of doing data-driven testing with unittest. I don't think it's terribly important, so the test is OK to me. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2004-08-27 05:44 Message: Logged In: YES user_id=357491 Just attached a new version of test__locale. Since it is so small of a file and the change so drastic I just uploaded the whole file. Only drawback is before the test kept testing all locales when there was a failure while my implementation stops at the first failure discovered. Don't know if it is important to test all locales. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-08-24 18:59 Message: Logged In: YES user_id=80475 Walter, I'm afraid I don't have time for these right now. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-08-20 18:39 Message: Logged In: YES user_id=89016 Raymond, can you take a look at the patches? ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-20 17:06 Message: Logged In: YES user_id=469548 Another one: ported test_inspect to unittest and moved out the inspect fodder out into two modules instead of using the ugly imp.load_source and TESTFN. I also did a bit of rearrangement so that the TestCase classes mostly match the sections in the library docs. I used a separate module (inspect_fodder2) and class for the decorators tests. Those are kind of small now, but I'll check in http://python.org/sf/1011890 after this port and let it grow without having to update test_getfunctions(). ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-19 17:14 Message: Logged In: YES user_id=469548 Hum yes, that was me trying out how doctest fails. The expected outcome should have been True. Can you try the corrected version? Test_zipfile has been checked in as rev 1.11. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-08-18 21:29 Message: Logged In: YES user_id=89016 doctest tests should be OK. The error tests in test_unpack can be done with PyUnit too, you either use self.assertRaises(ValueError, eval, "a,b = Seq()") or try: a,b = Seq() except ValueError: pass else: self.fail("failed") test_zipfile_unittest.py looks OK, but should of course be named test_zipfile.py when you check it in. test_unpack_doctest.py gives me: ********************************************** ************************ Failure in example: a == 4 and b == 5 and c == 6 from line #14 of test.test_unpack_doctest.doctests in /home/walter/Achtung/Python- test/dist/src/Lib/test/test_unpack_doctest.pyc Expected: False Got: True ********************************************** ************************ 1 items had failures: 1 of 28 in test.test_unpack_doctest.doctests ***Test Failed*** 1 failures. Traceback (most recent call last): File "Lib/test/test_unpack_doctest.py", line 133, in ? test_main(verbose=True) File "Lib/test/test_unpack_doctest.py", line 130, in test_main test_support.run_doctest(test_unpack_doctest, verbose) File "/home/walter/Achtung/Python- test/dist/src/Lib/test/test_support.py", line 318, in run_doctest raise TestFailed("%d of %d doctests failed" % (f, t)) test.test_support.TestFailed: 1 of 28 doctests failed ---------------------------------------------------------------------- Comment By: Johannes Gijsbers (jlgijsbers) Date: 2004-08-18 15:23 Message: Logged In: YES user_id=469548 Is there any problem with porting test scripts to doctest instead of unittest? doctest is just perfect for test_unpack (doctest version attached). I've also ported test_zipfile to unittest (attached as well). ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-31 18:31 Message: Logged In: YES user_id=89016 OK, checked in as: Lib/test/mapping_tests.py 1.1 Lib/test/test_os.py 1.22 Lib/test/test_shelve.py 1.7 Lib/test/test_types.py 1.60 Lib/test/test_userdict.py 1.19 Lib/test/test_weakref.py 1.39 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-29 01:02 Message: Logged In: YES user_id=80475 Looks good. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-28 22:59 Message: Logged In: YES user_id=89016 OK, I've updated the docstring for dict.update() (Object/dictobject.c 2.160) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-27 21:04 Message: Logged In: YES user_id=89016 dict_diff.txt is a patch that tries to share tests between test_dict, test_userdict, test_os, test_shelve and test_weakref. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-05-25 22:29 Message: Logged In: YES user_id=31435 Don't really care myself. Would be nice if the docstring for dict.update() matched the new realities, though . BTW, there is a reliable and conventional way to detect whether the 'dict' argument was passed to UserDict.update: use a unique marker object instead of the universally visible None. Like _marker = object() at module level, and ...(self, dict=_marker, ...) in the method defn. That can't be fooled without deliberate intent to deceive. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-25 22:21 Message: Logged In: YES user_id=80475 IMO, it is fine as is. I would be suprised if some code were relying on UserDict.update(None) raising an exception. This sort of thing also comes up also in places like the string and random modules whereever a function or method with an optional argument gets wrapped by another function. The only way around this is to use *args and then you break code that used the unfortunately named "dict" argument as a keyword. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-05-25 21:32 Message: Logged In: YES user_id=89016 Merging test_dict and test_userdict revealed a difference between dict and UserDict.UserDict: >>> import UserDict >>> d = UserDict.UserDict() >>> d.update(None) >>> d {} >>> d = {} >>> d.update(None) Traceback (most recent call last): File "", line 1, in ? TypeError: iteration over non-sequence Should we do anything about this? ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-05-20 18:03 Message: Logged In: YES user_id=80475 test_dict is fine. Consider beefing up the tests for update(). As of Py2.4, it now takes all the same argument possibilites as dict(): d.update(a=1, b=2) d.update([('a', 1), ('b', 2)]) Also, try to link in: from test_userdict import TestMappingProtocol This was supposed to provide tests common to all mappings. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-04-03 13:06 Message: Logged In: YES user_id=89016 The attached test_dict.py moves the dict tests from test_types.py to a new PyUnit test script. Code coverage for dictobject.c is at 90.76% (up from 89.51%) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2004-03-15 13:17 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/output/test_binascii delete Lib/test/test_binascii.py 1.17 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-03-13 21:26 Message: Logged In: YES user_id=80475 Okay, this one is fine. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-19 00:49 Message: Logged In: YES user_id=89016 Here's the next one: test_binascii.py. Code coverage in binascii.c is at 92% (could be improved by enhancing test_binhex.py). ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-13 23:46 Message: Logged In: YES user_id=33168 Looked good to me, test_future_pyunit.diff checked in as: * Lib/test/badsyntax_future3.py 1.2 * Lib/test/badsyntax_future4.py 1.2 * Lib/test/badsyntax_future5.py 1.2 * Lib/test/badsyntax_future6.py 1.2 * Lib/test/badsyntax_future7.py 1.2 * Lib/test/badsyntax_future8.py 1.1 * Lib/test/badsyntax_future9.py 1.1 * Lib/test/test_future.py 1.7 * Lib/test/test_future1.py 1.3 * Lib/test/test_future2.py 1.2 * Lib/test/output/test_future 1.4 ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-13 22:47 Message: Logged In: YES user_id=33168 Walter, I didn't get a mail from SF either. After you do a cvs add, you need to use -N to cvs diff. For example, cvs diff -N new_file_added_to_cvs_but_not_committed. If you look carefully, you can see this in the patch on the diff line for each file. I'll take a look at the patch. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-13 21:18 Message: Logged In: YES user_id=89016 Here is a version of test_future ported to PyUnit (test_future_pyunit.diff). If this makes sense to you Neal, please check it in. (BTW, how did you convince CVS to include badsyntax_future8.py and badsyntax_future9.py in the diff? Doing a "cvs add" only results in " Lib/test/badsyntax_future8.py is a new entry, no comparison available") ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-11 13:36 Message: Logged In: YES user_id=89016 md5/weakref patch checked in as: Lib/test/test_weakref.py 1.33 Lib/test/test_md5.py 1.5 Lib/test/output/test_md5 remove ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-11 07:05 Message: Logged In: YES user_id=33168 Improve coverage for test_future too. I'm not sure if test future can be ported to PyUnit. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-12-11 06:52 Message: Logged In: YES user_id=33168 Attached are two tests (in one file, I'm being lazy, sorry) to improve test coverage for md5c.c and _weakref.c. test_md5 was ported to unittest, weakref, just adds two little tests to get coverage up to 100%. If you like, just go ahead and check in. You will need to remove Lib/test/output/test_md5 ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-12-08 12:42 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/list_tests.py 1.1 Lib/test/seq_tests.py 1.1 Lib/test/test_list.py 1.1 Lib/test/test_tuple.py 1.1 Lib/test/test_types.py 1.56 Lib/test/test_userlist.py 1.11 Lib/test/output/test_types 1.3 Next will be test_binascii.py before I continue with test_types.py. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-12-08 00:49 Message: Logged In: YES user_id=80475 Looks good. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-11-27 20:48 Message: Logged In: YES user_id=89016 Here the first part of the test_types port: list and tuple tests have been moved to their own scripts: test_tuple.py and test_list.py. Common tests for tuple, list and UserList are shared (in seq_test.py and list_test.py) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-02 03:53 Message: Logged In: YES user_id=80475 Applied as: Lib/test/test_slice.py 1.5. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-09-01 01:52 Message: Logged In: YES user_id=80475 Looks good. I added a couple of minor tests. Revised patch attached. Okay to apply. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-31 21:49 Message: Logged In: YES user_id=89016 Thanks! Here's another one: test_slice.py ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-31 01:04 Message: Logged In: YES user_id=80475 Done. See: Lib/test/test_longexp.py 1.9; previous revision: 1.8 Lib/test/test_pep263.py 1.3; previous revision: 1.2 Lib/test/test_sets.py 1.27; previous revision: 1.26 Lib/test/test_structseq.py 1.5; previous revision: 1.4 Lib/test/output/test_longexp delete; previous revision: 1.3 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-08-30 19:10 Message: Logged In: YES user_id=80475 Will do! ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-30 19:06 Message: Logged In: YES user_id=89016 Here's test_structse.py converted with a few additional tests. If all three scripts are OK, could you check them in Raymond, as I'll be on vacation for three weeks? ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-08-09 17:47 Message: Logged In: YES user_id=89016 Here are two simple ones: test_pep263 and test_longexp. I can't think of any additional tests to add. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-23 15:38 Message: Logged In: YES user_id=80475 Fixed Walter's review comments and committed as Lib/test/test_compile.py 1.19 ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-23 13:49 Message: Logged In: YES user_id=89016 Are you sure, that the code path is the same in the new test_argument_handling() as in the old test? I.e. is "eval('lambda a,a: 0')" the same as "exec 'def f(a, a): pass'"? The print statement in test_float_literals should be changed to a comment. Should the imports in test_unary_minus() be moved to the start of the script? Otherwise the test looks (and runs) OK. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-20 21:26 Message: Logged In: YES user_id=80475 Here's one for you: test_compile.py is ready. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-19 11:46 Message: Logged In: YES user_id=89016 Maybe test_types.py should be split into several scripts: test_dict, test_tuple, test_list, test_int, test_long etc. Some of them already exist (like test_long), some don't. The constructor tests from test_builtin should probably be moved to the new test scripts as well. Furthermore we should try to share as much testing functionality as possible (e.g. between test_int and test_long, or between test_list and test_userlist) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-18 21:48 Message: Logged In: YES user_id=80475 Great! Can I suggest that test_types.py be next. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-18 16:27 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/test_builtin.py 1.21 Lib/test/test_complex.py 1.10 (I've moved the constructor tests from test_builtin to test_complex) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-18 01:49 Message: Logged In: YES user_id=80475 I added a few tests. If they are fine with you, go ahead and commit. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-17 23:36 Message: Logged In: YES user_id=89016 Here's the next one: text_complex.py. There one test that's currently commented out, because it crashes Python on Alpha (see http://www.python.org/sf/756093. The old test scripts states that tests for the constructor are in test_builtin, but I've added many tests to this script, so this is no longer true. We could move the tests to test_builtin, but IMHO that doesn't make sense, we'd better move the rest of the constructor tests from test_builtin to test_complex. I'd like to have a version of assertAlmostEqual() in unittest.py that can cope with complex numbers, but this would have to be coordinated with the standalone version of PyUnit (and it would probably have to wait until the 2.4 cycle starts) (I noticed that there is no assertAlmostEqual in the code on pyunit.sf.net anyway.) ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-17 14:06 Message: Logged In: YES user_id=89016 I'd like to keep this patch open, as it is an ongoing task (the next test scripts to be converted will be test_complex and then maybe test_marshal) ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-16 23:55 Message: Logged In: YES user_id=357491 OK, all tests pass cleanly. Applied as revision 1.6. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 21:51 Message: Logged In: YES user_id=89016 The joys of unittesting: Breaking code to make it better! ;) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 21:41 Message: Logged In: YES user_id=80475 Okay, it runs fine here. Once Brett confirms that it runs on the Mac, go ahead and load it. P.S. Your improved test_mimetools.py helped detect a latent error in mimetools.py when it was run under Windows. Tim made the fix this weekend. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 21:33 Message: Logged In: YES user_id=89016 Strange, I didn't get this failure here, but I got it on my laptop at home. I've removed the comparison with the getatime() value from test_time(). I hope this fixes it. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 21:09 Message: Logged In: YES user_id=80475 Walter, there is one failure left: ====================================== ================================ FAIL: test_time (__main__.PosixPathTest) ------------------------------------------------------------------- --- Traceback (most recent call last): File "test_posixpath.py", line 125, in test_time self.assert_( File "C:\PY23\lib\unittest.py", line 268, in failUnless if not expr: raise self.failureException, msg AssertionError Brett, after Walter revises the patch, just load the patch and make sure the test runs on the Mac. Between the three of us, we can validate the suite on three different platforms. Cheers. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2003-06-16 20:20 Message: Logged In: YES user_id=357491 Just wanting to work me like a dog, huh, Raymond? =) And to clarify for my and Walter's benefit, when you say guards, you mean that the tests don't crap out and say they failed on Windows, right? I thought posixpath was not meant to work under Windows. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 20:09 Message: Logged In: YES user_id=89016 I didn't realize that test_posixpath must work on Windows too. Here's a new version. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 18:04 Message: Logged In: YES user_id=80475 The previous comment applied to another patch. It should have said: Assigning to Brett to make sure the patch runs on the Mac. Don't accept this one until it has guards that allow the tests to run on Windows. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 17:59 Message: Logged In: YES user_id=80475 Assigning to Brett to give experience doing a detail review on this type of change. * examine every line of the diff and consider whether there is any semantic change (exceptions raised, etc). * apply the diff and run the test suite * in the interactive mode, call-up each function and make sure it behaves as expected (this is necessary because the test coverage is very low). * verify that the whitespace has been cleaned up. * look for missing changes (such as use of +=) ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-06-16 17:44 Message: Logged In: YES user_id=80475 The test file now has dependencies that do not apply to windows. The failure messages are attached. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-06-16 14:48 Message: Logged In: YES user_id=89016 Here's the next one: test_posixpath.py with many additional tests. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-22 19:33 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/output/test_mimetools delete Lib/test/test_mimetools.py 1.4 ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-22 18:18 Message: Logged In: YES user_id=80475 test_mimetools.py is ready. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-22 17:05 Message: Logged In: YES user_id=89016 I've attached a third version of test_mimetools.py that does some checks for the mimetools.Message class. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-21 15:04 Message: Logged In: YES user_id=80475 Attaching a slightly modified test_mimetools which covers more encodings and has a stronger set test. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-19 01:46 Message: Logged In: YES user_id=89016 Agreed, this is too much magic for too little gain. Back to business: Here is test_mimetools ported to PyUnit. Tests for mimetools.Message are still missing. If you can think of any tests please add them. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 05:18 Message: Logged In: YES user_id=80475 Get the module with sys.modules: tests = test_support.findtestclasses(sys.modules [__name__]) test_support.unittest(*tests) Yeah, the inheritance thing is a problem. I was trying to avoid having to modify unittest.TestCase to have a metaclass. The control of the module is kept in a separate SF project and one of its goals is to be backward compatible through 1.5.2 (meaning no metaclasses). A possible workaround is to define a modified testcase in test_support so that people don't import unittest directly anymore: test_support.py ------------------------- import unittest class SmartTestCase(unittest.TestCase): __metaclass__ = autotracktests pass test_sets.py ------------------ class TestBasicOps(test_support.SmartTestCase): run = False . . . class TestBasicOpsEmpty(TestBasicOps): def setUp(self): . . . Still, this is starting to seem a bit magical and tricky. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 04:52 Message: Logged In: YES user_id=89016 But how do I pass the module object from inside the module? And skipping abstract classes seems to be more work in this version: If skipping is done via a class attribute, derived classes have to explicitely reset this flag because of interitance. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 03:59 Message: Logged In: YES user_id=80475 Good call. Instead of using metaclasses, perhaps add a module introspector function to test_support: def findtestclasses(mod): tests = [] for elem in dir(mod): member = getattr(mod, elem) if type(member) != type: continue if issubclass(member, unittest.TestCase): tests.append(member) return tests ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 03:45 Message: Logged In: YES user_id=89016 But this can be solved with a special non-inheritable class attribute: class BaseTest(unittest.TestCase): run = False Then the metaclass can do the following: def __new__(cls, name, bases, dict): if "run" not in dict: dict["run"] = True cls = type.__new__(cls, name, bases, dict) if cls.run: tests.append(cls) return cls ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 03:04 Message: Logged In: YES user_id=80475 I don't think metaclasses or module introspection would help whenever there are classes that derive from TestCase but are not meant to be run directly (their subclasses have the setup/teardown/or class data). test_sets.py has examples of that kind of thing. ---------------------------------------------------------------------- Comment By: Walter D?rwald (doerwalter) Date: 2003-05-18 02:50 Message: Logged In: YES user_id=89016 Checked in as: Lib/test/test_array.py 1.20 Lib/test/test_winsound.py 1.5 Lib/test/output/test_winsound delete > The approach of using tests.append() is elegant and > makes it easier to verify that no tests are being omitted. The most elegant approach would probably be a metaclass that collects all TestCase subclasses that get defined. Classes that only serve as a base class could be skipped by specifying a certain class attribute. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2003-05-18 01:35 Message: Logged In: YES user_id=80475 The approach of using tests.append() is elegant and makes it easier to verify that no tests are being omitted. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=736962&group_id=5470 From noreply at sourceforge.net Tue Dec 7 12:23:35 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Dec 7 12:23:41 2004 Subject: [Patches] [ python-Patches-754022 ] Enhanced webbrowser.py Message-ID: Patches item #754022, was opened at 2003-06-13 19:24 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=754022&group_id=5470 Category: Library (Lib) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Oleg Broytmann (phd) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: Enhanced webbrowser.py Initial Comment: The patch enhances webbrowser.py. First, all calls to os.system return result code, and the inverse of the code (it is ok/fail status) passed through all higher-level routines up to top-level call to open(url). This allows to check if a browser was really started. Second, the very open() modified so it is now trying to run all registered browsers in order until a browser returns 1. Third, the file can be used as a program: webbrowser.py url. Optional parameters -n allows to open the url in a new window. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2004-12-07 14:23 Message: Logged In: YES user_id=4799 Applied the patch from http://python.org/sf/1077979. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-10-20 10:11 Message: Logged In: YES user_id=80475 Too late for Py2.4. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2004-10-07 11:48 Message: Logged In: YES user_id=4799 And don't forget to make it executable. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=754022&group_id=5470 From noreply at sourceforge.net Tue Dec 7 12:26:49 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Dec 7 12:26:53 2004 Subject: [Patches] [ python-Patches-1077979 ] Simple webbrowser fix for netscape -remote Message-ID: Patches item #1077979, was opened at 2004-12-03 01:41 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077979&group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Josh Cherry (jlcherry) Assigned to: Nobody/Anonymous (nobody) Summary: Simple webbrowser fix for netscape -remote Initial Comment: This patch simply removes a space in a netscape -remote command that is executed by webbrowser. This space caused problems with certain urls, at least with netscape 7.2. For example, webbrowser.open_new('http://www.python.org') would file, though webbrowser.open_new('http://www.python.org/') would work. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2004-12-07 14:26 Message: Logged In: YES user_id=4799 Yes, I can confirm the problem with Mozilla. I updated my big patch for webbrowser.py at http://python.org/sf/754022. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1077979&group_id=5470 From noreply at sourceforge.net Tue Dec 7 14:39:51 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Dec 7 14:39:55 2004 Subject: [Patches] [ python-Patches-1080078 ] list sort is not "in place" Message-ID: Patches item #1080078, was opened at 2004-12-06 19:15 Message generated for change (Comment added) made by shd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 Category: Documentation Group: Python 2.4 Status: Closed Resolution: Rejected Priority: 5 Submitted By: Heikki Orsila (shd) Assigned to: Nobody/Anonymous (nobody) Summary: list sort is not "in place" Initial Comment: list sort method says the sort algorithm is "in place", but it is not. It requires O(N) extra memory at worst case. A patch is attached that corrects the documentation in Objects/listobjects.c. ---------------------------------------------------------------------- >Comment By: Heikki Orsila (shd) Date: 2004-12-07 15:39 Message: Logged In: YES user_id=6941 My bad. Sorry for misunderstanding the meaning of in-place. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2004-12-06 19:49 Message: Logged In: YES user_id=80475 Sorry, the patch is not right. In-place is meant to communicate thet the original list is mutated. Contrast that with the behavior of sorted() which leaves the original intact. Perhaps you are thinking in terms of heapsort which is in-place and requires no additional auxiliary storage. While that is not true for the current algorithm, we do not document or make promises about the memory requirements -- that is considered to be an implementation detail that is subject to change. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2004-12-06 19:48 Message: Logged In: YES user_id=31435 Sorry, I'm rejecting this. Of course it's "in place": x.sort() does not return a new list. Its only visible effect is to permute the elements of x. That's what "in place" means. That the current implementation may require temp memory is irrelevant to that, and *because* it's an internal implementation detail, doesn't belong in the docstring. The "in place" was added to the docstring because many newcomers believed x.sort() left x alone, and returned a new list in sorted order (which is what the new-in-2.4 sorted() builtin does). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080078&group_id=5470 From noreply at sourceforge.net Tue Dec 7 16:26:45 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Dec 7 16:26:48 2004 Subject: [Patches] [ python-Patches-1080684 ] repair typo Message-ID: Patches item #1080684, was opened at 2004-12-08 00:26 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080684&group_id=5470 Category: Documentation Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Nobody/Anonymous (nobody) Summary: repair typo Initial Comment: The attached patch fixes these typos: - Doc/lib/libbase64.tex s/algorith/algorithm - Doc/lib/libpickle.tex s/interchangable/interchangeable - Doc/lib/libxmlrpclib.tex s/{_cmp__}/{__cmp__} leading underscore needs to be double, not single. - Doc/ref/ref6.tex 0/1 => False/True __debug__ variable is a boolean value since Python 2.3. I formatted the text width to 72, so the diff part might look a bit large. But basically, the change is only values of __debug__. Thanks in advance. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1080684&group_id=5470 From office at omtel.de Wed Dec 8 19:17:15 2004 From: office at omtel.de (office@omtel.de) Date: Wed Dec 8 23:04:42 2004 Subject: [Patches] E nderuara Kompani! Message-ID: A non-text attachment was scrubbed... Name: not available Type: text Size: 1571 bytes Desc: not available Url : http://mail.python.org/pipermail/patches/attachments/20041208/624e808a/attachment.ksh From office at omtel.de Wed Dec 8 19:17:19 2004 From: office at omtel.de (office@omtel.de) Date: Thu Dec 9 01:32:01 2004 Subject: [Patches] E nderuara Kompani! Message-ID: A non-text attachment was scrubbed... Name: not available Type: text Size: 1571 bytes Desc: not available Url : http://mail.python.org/pipermail/patches/attachments/20041208/552928dd/attachment.ksh From office at omtel.de Wed Dec 8 19:17:13 2004 From: office at omtel.de (office@omtel.de) Date: Thu Dec 9 02:53:03 2004 Subject: [Patches] E nderuara Kompani! Message-ID: A non-text attachment was scrubbed... Name: not available Type: text Size: 1571 bytes Desc: not available Url : http://mail.python.org/pipermail/patches/attachments/20041208/07c66237/attachment.ksh From noreply at sourceforge.net Thu Dec 9 23:09:18 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Dec 9 23:09:23 2004 Subject: [Patches] [ python-Patches-1071764 ] a new subprocess.call which raises an error on non-zero rc Message-ID: Patches item #1071764, was opened at 2004-11-23 15:45 Message generated for change (Settings changed) made by astrand You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 Category: Library (Lib) >Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Nick Craig-Wood (ncw) >Assigned to: Peter ?strand (astrand) Summary: a new subprocess.call which raises an error on non-zero rc Initial Comment: The attached patch introduces a 3rd utility function - xcall() to the subprocess module. This function acts just like call but raises errors if the command had a non-zero return code. This saves writing if call(...): raise OSError(...) It is most useful for shell script replacement programming. Checking the return codes of commands called is often forgotten in shell programming. When you've moved up to python because shell is too limiting (usually about 10 lines of shell in my case ;-) you want to make sure that all your commands work so you write robust code. I consider raising an exception to be much more pythonic than checking a return code (ie "Errors should never pass silently" from Zen of Python) Eg # An easy to miss error >>> subprocess.call(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory 1 >>> # user forgot to check non-zero return code # becomes an impossible to miss exception >>> subprocess.xcall(["mkdir", "a/b"]) mkdir: cannot create directory `a/b': No such file or directory Traceback (most recent call last): File "", line 1, in ? File "subprocess.py", line 462, in xcall raise CalledProcessError(rc, "Command %s returned non zero exit status" % args[0]) subprocess.CalledProcessError: [Errno 1] Command ['mkdir', 'a/b'] returned non zero exit status >>> See attached patch for more! Its been tested under python 2.3 on windows and linux. ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-12-05 22:20 Message: Logged In: YES user_id=344921 My suggested name is "check_call". ---------------------------------------------------------------------- Comment By: Peter ?strand (astrand) Date: 2004-12-01 15:04 Message: Logged In: YES user_id=344921 Since this is a new feature, the patch will go into trunk, but not the 2.4 maint branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1071764&group_id=5470 From noreply at sourceforge.net Sun Dec 12 02:38:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Dec 12 02:38:37 2004 Subject: [Patches] [ python-Patches-1043356 ] Enhancing '-m' to support packages (PEP 338) Message-ID: Patches item #1043356, was opened at 2004-10-09 07:44 Message generated for change (Comment added) made by ncoghlan You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1043356&group_id=5470 Category: None Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Nick Coghlan (ncoghlan) Assigned to: Nobody/Anonymous (nobody) >Summary: Enhancing '-m' to support packages (PEP 338) Initial Comment: Thomas Heller posted "python -m pychecker.checker