[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)
Steve Purcell added the comment: Hi Brian; The module is intended for test suites where the unit tests are written to be independent of each other, which is the standard way to do things. Note, for instance, that there is no convenient support for changing the order in which tests run. When tests are written like that, you can interrupt a bulk test run at any point, and you can run a single test to reproduce and then debug a failure. Given your test suite, I can see how this '--one' option is helpful to you, but I don't believe it should be made standard. (I've never seen it in any XP-inspired test framework or related IDE UI.) However, you can easily write a custom TestRunner that provides this fast abort behaviour that you want, and then hook it into unittest as follows: unittest.main(testRunner=MyCustomTestRunner()) (BTW, regarding the implementation, it's not ideal to pass the 'onlyOne' parameter down and through to the run() method; much better would be to initialise a TestResult subclass with the 'onlyOne' option, so that it could then abort when 'addError' or 'addFailure' is called. You can use that trick in any custom test runner you might write.) Best wishes, -Steve -- assignee: - purcell resolution: - rejected status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2241 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1725737] Distutils default exclude doesn't match top level .svn
Ralf Schmitt added the comment: _svn might also be a candidate. it is used on windows when SVN_ASP_DOT_NET_HACK is set. (see http://svn.collab.net/repos/svn/trunk/notes/asp-dot-net-hack.txt). But, I don't care enough to provide a patch. What do you thinkm about excluding *~ and .*# ? _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1725737 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2240] setitimer, getitimer wrapper
Guilherme Polo added the comment: Thanks for the review, corrections and suggestions Georg. For the first three items: I will be working on this later today. For the last item: which is one of those three new constants added. I believe if you pass something else setitimer/getitimer might raise an error (not tested). I still have to write doc and tests. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2240 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2243] urllib2. strange behavior for getting chuncked transfer-ecnoded data
New submission from begemoth: Through urllib2 open web pages from some sites (www.rbc.ru, www.rambler.ru, www.yandex.ru). Their servers send data in chuncked transfer-encoding. httplib (which is used by urllib2) unchunk data but I recieve transfer-encoding: chuncked in response header nevertheless. It seems to me that this key in header need to be removed from the header if httplib unchuncked the data. -- components: Library (Lib) messages: 63316 nosy: begemoth severity: normal status: open title: urllib2. strange behavior for getting chuncked transfer-ecnoded data type: behavior versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2243 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2240] setitimer, getitimer wrapper
Guilherme Polo added the comment: I'm attaching another patch, this should be applied after the other ones have been applied. It fixes what Georg mentioned. I have chosen to let ItimerError inherit from IOError, and improved the docstring of setitimer. Added file: http://bugs.python.org/file9619/setitimer_getitimer_wrapper_fixes.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2240 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails
Martin Wilck added the comment: The recipe in its current form doesn't work with urllib2 in python 2.5 The reason it fails is that the HTTPConnection.request() method isn't passed the request itself (with the proxy host and port info). No easy solution to be seen. -- nosy: +mwilck _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1424152 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2240] setitimer, getitimer wrapper
Guilherme Polo added the comment: Updated Doc/library/signal.rst, follows a patch. Added file: http://bugs.python.org/file9620/setitimer_getitimer_wrapper_doc.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2240 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)
Amaury Forgeot d'Arc added the comment: Actually, py.test and nose both have the -x option for this purpose. I use it very often during development, mostly during a refactoring phase: failures are easy to correct, and I don't want to wait for the complete suite to complete and display tons of tracebacks. Even while developing on core python, this option would have helped me a couple of times. Please, reopen this item! -- nosy: +amaury.forgeotdarc __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2241 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2179] with should be as fast as try/finally
Amaury Forgeot d'Arc added the comment: What's strange is that calling __enter__ and __exit__ in a try/finally block brings the speed back to the faster 'with' speed, even though they call the same C functions Looking carefully at the code, there are two reasons for this: - LockType has no methods! try dir(thread.LockType). Instead, LockType defines a tp_getattr which does a *linear* search in a PyMethodDef array. First items are served faster... - After converting this to use the usual tp_methods slot, there is still a performance difference, due to the fact that release() is a METH_NOARGS method, while __exit__() uses METH_VARARGS. Phew. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2179 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2244] urllib and urllib2 decode userinfo multiple times
New submission from Carl Meyer: Both urllib and urllib2 call urllib.unquote() multiple times on data in the userinfo section of an FTP URL. One call occurs at the end of the urllib.splituser() function. In urllib, the other call appears in URLOpener.open_ftp(). In urllib2, the other two occur in FTPHandler.ftp_open() and Request.get_host(). The effect of this is that if the userinfo section of an FTP url should need to contain a literal % sign followed by two digits, the % sign must be double-encoded as %2525 (for urllib) or triple-encoded as %252525 (for urllib2) in order for the URL to be accessed. The proper behavior would be to only ever unquote a given data segment once. The W3's URI: Generic Syntax RFC (http://gbiv.com/protocols/uri/rfc/rfc3986.html) addresses this very issue in section 2.4 (When to Encode or Decode): Implementations must not percent-encode or decode the same string more than once, as decoding an already decoded string might lead to misinterpreting a percent data octet as the beginning of a percent-encoding, or vice versa in the case of percent-encoding an already percent-encoded string. The solution would be to standardize where in urllib and urllib2 the unquoting happens, and then make sure it happens nowhere else. I'm not familiar enough with the libraries to know where it should be removed without possibly breaking other behavior. It seems that just removing the map/unquote call in urllib.splituser() would fix the problem in urllib. I would guess the call in urllib2 Request.get_host() should also be removed, as the RFC referenced above says clearly that only individual data segments of the URL should be decoded, not larger portions that might contain delimiters (: and @). I've attached a patchset for these suggested changes. Very superficial testing suggests that the patch doesn't break anything obvious, but I make no guarantees. -- components: Library (Lib) files: urllib-issue.patch keywords: patch messages: 63324 nosy: carljm severity: normal status: open title: urllib and urllib2 decode userinfo multiple times type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file9621/urllib-issue.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2244 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2240] setitimer, getitimer wrapper
Changes by Guilherme Polo: Added file: http://bugs.python.org/file9622/setitimer_getitimer_wrapper_doc_update.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2240 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2240] setitimer, getitimer wrapper
Guilherme Polo added the comment: I've done some tests for getitimer/setitimer, diff is attached. Added file: http://bugs.python.org/file9623/setitimer_getitimer_wrapper_test.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2240 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2245] aifc cannot handle unrecognised chunk type CHAN
New submission from Oki Mikito: When aifc tries to open an AIFF audio file, it collects the file's chunk information. Apparently some AIFF files contain a chunk type string CHAN, and the module just won't open the files... Here's a captured error message: import os os.getcwd() 'C:¥¥Documents and Settings¥¥loki' import aifc f=aifc.open('tr_04.aif','r') Traceback (most recent call last): File interactive input, line 1, in module File C:¥Python25¥lib¥aifc.py, line 928, in open return Aifc_read(f) File C:¥Python25¥lib¥aifc.py, line 341, in __init__ self.initfp(f) File C:¥Python25¥lib¥aifc.py, line 320, in initfp raise Error, 'unrecognized chunk type '+chunk.chunkname Error: unrecognized chunk type CHAN Solution: Add 'CHAN' in the list of _skiplist item, in lib/aifc.py, line 147 -- components: Library (Lib) messages: 63326 nosy: loki_dePlume severity: normal status: open title: aifc cannot handle unrecognised chunk type CHAN type: feature request versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2245 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1725737] Distutils default exclude doesn't match top level .svn
Martin v. Löwis added the comment: -1 on including anything that is a temporary file of some program. It's the job of the packager to clean the directory before packaging. I personally don't want to spend any more time on this issue. _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1725737 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2242] Decoding UTF-7 with ignore warnings crashes Python on Windows Vista
Chris Palmer added the comment: You could also fix the problem by using iswalnum function instead of isalnum. Sorry I didn't mention this in the original report. http://msdn2.microsoft.com/en-us/library/k84c0490(VS.71).aspx __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2242 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Jamie Bliss added the comment: Sure, I'll do that. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2211 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1227748] subprocess: inheritance of std descriptors inconsistent
Mads Kiilerich added the comment: Note to others searching for a solution to this and similar problems: http://svn.python.org/view/python/trunk/Lib/subprocess.py?rev=60115view=auto shows that this now (for 2.6?) has been changed so that close_fds now controls inheritance through the CreateProcess parameter bInheritHandles Thanks! -- nosy: +kiilerix _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1227748 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1714] ConfigParser.py do not allow leading (and trailing) space in values.
Changes by Raghuram Devarakonda: -- nosy: +draghuram __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1714 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1524825] ConfigParser: accept leading whitespace on options+comments
Changes by Raghuram Devarakonda: -- nosy: +draghuram _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1524825 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2211] Cookie.Morsel interface needs update
Jamie Bliss added the comment: * Should be backwards compatible with people who actually use Morsel * Didn't even attempt to document it * Instead of having the Morsel dict being filled initially, unset attributes are, well, unset * .key, .value, and .coded_value are now property()s * .value is considered the actual value (eg, .coded_value is ignore for __eq__()) __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2211 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
New submission from Jeroen Ruigrok van der Werven: Quoting from my email to Raymond: In the Trac/Genshi community we've been tracking a bit obscure memory leak that causes us a lot of problems. Please see http://trac.edgewall.org/ticket/6614 and then http://genshi.edgewall.org/ticket/190 for background. We reduced the case to the following Python only code and believe it is a bug within itertool's groupby. As Armin Ronacher explains in Genshi ticket 190: Looks like genshi is not to blame. itertools.groupby has a grouper with a reference to the groupby type but no traverse func. As soon as a circular reference ends up in the groupby (which happens thanks to the func_globals in our lambda) genshi leaks. This can be demonstrated with the following code (testcase attachment present with this issue): import gc from itertools import groupby def run(): keyfunc = lambda x: x for i, j in groupby(range(100), key=keyfunc): keyfunc.x = j for x in xrange(20): gc.collect() run() print len(gc.get_objects()) On executing this in will show numerical output of the garbage collector, but every iteration will be +4 from the previous, as Armin specifies: a frame, a grouper, a keyfunc and a groupby object We have been unable to come up with a decent patch and thus I am logging this issue now. -- files: testcase.py messages: 63332 nosy: asmodai, rhettinger severity: normal status: open title: itertools.groupby() leaks memory with circular reference type: resource usage versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0 Added file: http://bugs.python.org/file9624/testcase.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1533486] long - Py_ssize_t (C/API 1.2.1)
Changes by Martin v. Löwis: -- assignee: - georg.brandl components: +None nosy: +georg.brandl _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1533486 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1533486] long - Py_ssize_t (C/API 1.2.1)
Changes by Martin v. Löwis: -- components: -None _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1533486 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2247] Test auto-assignment
Changes by Martin v. Löwis: -- assignee: georg.brandl components: Documentation tools (Sphinx) nosy: georg.brandl, loewis severity: normal status: open title: Test auto-assignment __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2247 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2247] Test auto-assignment
Changes by Martin v. Löwis: -- resolution: - invalid status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2247 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)
Steve Purcell added the comment: Hi Brian - thanks for going into some details of your rationale! You might be surprised to hear that it's indeed possible to make all of your unit tests mutually independent; check out the area of 'mock objects'. It turns out to be possible, and indeed desirable once the zen of the technique clicks, to test every class in isolation without referring to other neighbouring classes. I was surprised by the enormous effectiveness of this somewhat hardcore technique when I was forced into it by working with one of the original Mock Object paper authors. Having already spent years coaching developers in XP techniques, I thought I was already a testing whiz. In most real-world cases, though, a class under test will be tested using its interaction with other separately-tested classes in the system, and the associated unit tests therefore bear some relation to one another. It's usually not helpful to divide those classes into layers that can be tested in order from the lowest layer to the highest, because classes tend to form clumps rather than layers. When a big suite of tests is run, failures therefore form clumps too, and often the underlying programming error is easier to see by looking at the clump rather than just the first failure. I think this explains why most people get by without an option like '-o'. Of course, it often makes sense to have separate test suites for different areas of the system under test so that they can be run in isolation. Rather than relying on test naming, you might consider explicitly building TestSuites that run your test cases in the desired order. As for preparing an updated patch, I'll get to it if I get a few minutes. All the best from this Brit in Germany. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2241 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Alexander Belopolsky added the comment: With the following patch: === --- Lib/test/test_itertools.py (revision 61284) +++ Lib/test/test_itertools.py (working copy) @@ -707,6 +707,12 @@ a = [] self.makecycle(takewhile(bool, [1, 0, a, a]), a) +def test_issue2246(self): +n = 10 +keyfunc = lambda x: x +for i, j in groupby(xrange(n), key=keyfunc): +keyfunc.__dict__.setdefault('x',[]).append(j) + def R(seqn): 'Regular generator' for i in seqn: $ ./python Lib/test/regrtest.py -R :: test_itertools reports n*3 + 13 reference leaks. This should give a clue ... -- nosy: +belopolsky __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Changes by Armin Ronacher: -- nosy: +aronacher __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Alexander Belopolsky added the comment: It looks like the problem is that the internal grouper object becomes a part of a cycle: keyfunc - grouper(x) - keyfunc(tgtkey), but its type does not support GC. I will try to come up with a patch. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Raymond Hettinger added the comment: No need. I'm already working on adding GC to the grouper. -- assignee: - rhettinger __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Alexander Belopolsky added the comment: Oops. Here is my patch anyways. -- keywords: +patch Added file: http://bugs.python.org/file9625/groupby-leak.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2246] itertools.groupby() leaks memory with circular reference
Paul Pogonyshev added the comment: Damn, I wrote a patch too ;) -- nosy: +_doublep __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2246 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2196] Fix hasattr's exception problems
Benjamin Peterson added the comment: I suppose another way we could do this is propagate any exception which doesn't inherit Exception. I, however, like just having just those 2 specific exceptions continue. -- assignee: - georg.brandl __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2196 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1725737] Distutils default exclude doesn't match top level .svn
Ralf Schmitt added the comment: then close this one and also http://bugs.python.org/issue1095784 _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1725737 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1095784] exclude CVS conflict files in sdist command
Ralf Schmitt added the comment: related issue: http://bugs.python.org/issue1725737 -- nosy: +schmir _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1095784 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1533486] long - Py_ssize_t (C/API 1.2.1)
Alexander Belopolsky added the comment: I think it should be changed to because sizeof(Py_ssize_t) == sizeof(void*) -- nosy: +belopolsky _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1533486 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1193577] add server.shutdown() method to SocketServer
Jeffrey Yasskin added the comment: Hearing no objections, I've submitted this as r61289. _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1193577 _ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com