[issue10128] multiprocessing.Pool throws exception with __main__.py

2010-10-17 Thread Michael Olson
Michael Olson added the comment: I wrapped the offending assertion in a if main_name != '__main__'. I considered not checking the module_name against built-in modules but that seemed likely to be the sort of thing being guarded against, so I left it at an exception for __main__.

[issue10128] multiprocessing.Pool throws exception with __main__.py

2010-10-19 Thread Michael Olson
Michael Olson added the comment: Sorry about that, yes, this is on Windows XP and 7, 32 bit. And with the if statement it seems to work fine. v/r -- Michael Olson -- ___ Python tracker <http://bugs.python.org/issue10

[issue10128] multiprocessing.Pool throws exception with __main__.py

2010-10-20 Thread Michael Olson
Michael Olson added the comment: Ummm, I think I've been unclear on where I was making changes, I changed lib\multiprocessing\forking.py to fix the issue. Patch attached. -- keywords: +patch resolution: invalid -> status: closed -> open Added file: http://bugs.python.or

[issue10128] multiprocessing.Pool throws exception with __main__.py

2010-10-20 Thread Michael Olson
Michael Olson added the comment: As a note, I didn't attach a patch at first because I was fairly sure I was kludging it into submission, but at least this makes it clear as to what I did. v/r -- Michael Olson -- ___ Python tracker

[issue10161] unittest: use ascii() instead of repr() to display values on error

2010-10-24 Thread Michael Foord
Michael Foord added the comment: Although this is still a real issue for other users of unittest. If I get time to think about it properly I may reopen. -- ___ Python tracker <http://bugs.python.org/issue10

[issue7911] unittest.TestCase.longMessage should default to True in Python 3.2

2010-10-29 Thread Michael Foord
Michael Foord added the comment: I intend to. -- ___ Python tracker <http://bugs.python.org/issue7911> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-10-31 Thread Michael Foord
Changes by Michael Foord : -- assignee: rhettinger -> michael.foord ___ Python tracker <http://bugs.python.org/issue10242> ___ ___ Python-bugs-list mai

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-10-31 Thread Michael Foord
Michael Foord added the comment: As this has been released in 2.7 (and unittest2) I don't think it can be just removed in 3.2 - it would make porting code from Python 2 to 3 more painful. Very happy for you to fix in Python 2.7. Please let me know when it goes in so that I can keep unit

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-31 Thread Michael Foord
Michael Foord added the comment: David - would you get a good approximation of what you want simply with: self.assertEqual(ascii(first), ascii(second)) (This actually returns "b'first'" "b'second'" so you may want a convenience function that chops

[issue10273] Clean-up Unittest API

2010-10-31 Thread Michael Foord
Michael Foord added the comment: In general *none* of this should be done until there is clear consensus on Python-dev and it isn't clear that this is the case. * On the deocumenting: barry warsaw objects to public apis that aren't documented and gregory smith asserts (natch) th

[issue10278] add time.wallclock() method

2010-11-01 Thread Michael Foord
Michael Foord added the comment: +1 -- nosy: +michael.foord ___ Python tracker <http://bugs.python.org/issue10278> ___ ___ Python-bugs-list mailing list Unsub

[issue9926] Wrapped TestSuite subclass does not get __call__ executed

2010-11-01 Thread Michael Foord
Michael Foord added the comment: Committed to py3k in revision 86101. Needs porting to Python 2.7 (and unittest2). -- ___ Python tracker <http://bugs.python.org/issue9

[issue9926] Wrapped TestSuite subclass does not get __call__ executed

2010-11-01 Thread Michael Foord
Michael Foord added the comment: Committed to release27-maint in revision 86104. -- resolution: -> accepted stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-01 Thread Michael Foord
Michael Foord added the comment: On Python-dev Nick Coghlan suggests a fix for the fast-path that would allow us to keep it whilst fixing this bug (not tested yet but adding this note not to lose it). The issue of the name of this method is in 10273. Looking at assertItemsEqual, I'

[issue10273] Clean-up Unittest API

2010-11-02 Thread Michael Foord
Michael Foord added the comment: @Ezio Good catch. Even though several of us (including myself) prefer assertRegex over assertRegexp it is probably better to have consistent APIs otherwise people will never remember which methods have the 'p' and w

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2010-11-03 Thread Michael Foord
Michael Foord added the comment: assertElementCountEqual is good name and I like your implementation suggestion. I'll put this in. I think the implementation fix can go into 2.7 as well but not the rename/aliasing. -- ___ Python tracker

[issue10273] Clean-up Unittest API

2010-11-03 Thread Michael Foord
Michael Foord added the comment: Renaming and aliasing methods has a cost. It confuses users of the old names (including future users - the current API is now baked into django 1.3 unless I can get an update done in time for them to change the version they're using). People wh

[issue9732] Addition of getattr_static for inspect module

2010-11-03 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file18699/static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list mailin

[issue9732] Addition of getattr_static for inspect module

2010-11-03 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file18701/test_static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list m

[issue9732] Addition of getattr_static for inspect module

2010-11-03 Thread Michael Foord
Michael Foord added the comment: Updated implementation that handles instances with inherited __slots__ members and attributes from C descriptors correctly. I think is both "good enough" and useful enough to add to inspect. (The remaining constraints are rare or pa

[issue9732] Addition of getattr_static for inspect module

2010-11-03 Thread Michael Foord
Changes by Michael Foord : Added file: http://bugs.python.org/file19484/test_static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list m

[issue6058] Add cp65001 to encodings/aliases.py

2010-11-03 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue6058> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9732] Addition of getattr_static for inspect module

2010-11-04 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file19483/static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list mailin

[issue9732] Addition of getattr_static for inspect module

2010-11-04 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file19484/test_static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list m

[issue9732] Addition of getattr_static for inspect module

2010-11-04 Thread Michael Foord
Michael Foord added the comment: Further updated implementation. Now handles data descriptors correctly but removes the code that resolves the builtin descriptors (calling __get__ on slot and attribute descriptors). As it was resolving some descriptors but not all, and resolving getset

[issue9732] Addition of getattr_static for inspect module

2010-11-04 Thread Michael Foord
Changes by Michael Foord : Added file: http://bugs.python.org/file19490/test_static.py ___ Python tracker <http://bugs.python.org/issue9732> ___ ___ Python-bugs-list m

[issue10326] Can't pickle unittest.TestCase instances

2010-11-05 Thread Michael Foord
New submission from Michael Foord : In Python 2.7 a change was introduced to TestCase which involves storing a dictionary of method objects on TestCase instances. This makes them unpickleable. unittest2 stores strings (method names) instead of method objects (a fix to make TestCase instances

[issue10228] Refleak run of test_dbm fails when several dbm modules are available

2010-11-08 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue10228> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10353] 2to3 and places argument in unitests assertAlmostEqual

2010-11-08 Thread Michael Foord
Michael Foord added the comment: It's fixed in release31-maint as well. -- ___ Python tracker <http://bugs.python.org/issue10353> ___ ___ Python-bugs-list m

[issue10360] _weakrefset.WeakSet.__contains__ should not propagate TypeErrors

2010-11-08 Thread Michael Foord
Changes by Michael Foord : -- nosy: +michael.foord ___ Python tracker <http://bugs.python.org/issue10360> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-12 Thread Michael Hoffman
New submission from Michael Hoffman : If you create a Pdb instance with an stdin argument, the default behavior is for commands to be retrieved using raw_input(), which uses sys.stdin instead, thereby causing the stdin argument to be without effect. You can work around this by setting the

[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-12 Thread Michael Hoffman
Changes by Michael Hoffman : Added file: http://bugs.python.org/file19581/expected_behavior.py ___ Python tracker <http://bugs.python.org/issue10396> ___ ___ Python-bug

[issue2571] cmd.py always uses raw_input, even when another stdin is specified

2010-11-13 Thread Michael Hoffman
Changes by Michael Hoffman : -- nosy: +hoffman ___ Python tracker <http://bugs.python.org/issue2571> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-13 Thread Michael Hoffman
Michael Hoffman added the comment: As always, it seems a bit more complicated than I originally expected. Since it's too late for a Python 2.x feature addition, I'll wait until I upgrade to 3.x to work on that. You are correct, technically this is not a docs bug but I think the

[issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2010-11-16 Thread Michael Foord
Michael Foord added the comment: The issue is with a non-ascii character in a *Unicode* docstring. Python has to encode the string to write it to the terminal; the encode is implicit and so fails. The problem doesn't happen with Python 3 unless you run on an ascii ter

[issue7900] posix.getgroups() failure on Mac OS X

2010-11-16 Thread Michael Foord
Changes by Michael Foord : -- nosy: -michael.foord ___ Python tracker <http://bugs.python.org/issue7900> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes
New submission from Michael Hughes : We use the Python interpreter embedded in our application, and would prefer to not block an exit of our application waiting for non-daemon threads to finish. I would like a mechanism exposed that queries for whether or not to wait. -- components

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes
Michael Hughes added the comment: I have a patch here. It is to allow for a callback to be set on the main thread which gets called when there are non-daemon threads still alive on exit. The callback returns True or False indicating whether or not it wants to block. By default, the whole

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes
Changes by Michael Hughes : Removed file: http://bugs.python.org/file19625/threadingchange.patch ___ Python tracker <http://bugs.python.org/issue10444> ___ ___ Python-bug

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes
Michael Hughes added the comment: Scratch that last patch. It was missing part of the fix. I've removed the old patch now, and submitted the proper one. -- Added file: http://bugs.python.org/file19626/real.patch ___ Python tracker

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes
Michael Hughes added the comment: To use the callback, you can do this: import threading def threadendcallback(): # return False to indicate that we don't # want to wait for any threads before exiting return False threading.currentThread().waitForThreadsOnExitFunc = threadendcal

[issue11298] unittest discovery needs better explanation

2011-02-23 Thread Michael Foord
Michael Foord added the comment: Sounds like a good change to the docs. Care to provide a patch? -- nosy: +michael.foord ___ Python tracker <http://bugs.python.org/issue11

[issue11298] unittest discovery needs better explanation

2011-02-23 Thread Michael Foord
Michael Foord added the comment: Thanks blokely, looks good. Needs applying to 2.7 / 3.2 and 3.3 branches. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11298] unittest discovery needs better explanation

2011-02-23 Thread Michael Foord
Michael Foord added the comment: Hey, blokeley the same patch will apply cleanly against 3.2 / 3.3 so no worries. -- ___ Python tracker <http://bugs.python.org/issue11

[issue9878] Avoid parsing pyconfig.h and Makefile by autogenerating extension module

2011-02-23 Thread Michael Foord
Michael Foord added the comment: And also issue 10764. This issue affects alternative implementations of Python. -- nosy: +michael.foord ___ Python tracker <http://bugs.python.org/issue9

[issue11282] 3.3 unittest document not kept consist with code

2011-02-25 Thread Michael Foord
Michael Foord added the comment: Actually I think these methods are going back in and staying deprecated, so hold off for a bit. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11282] 3.3 unittest document not kept consist with code

2011-02-25 Thread Michael Foord
Changes by Michael Foord : -- assignee: docs@python -> michael.foord ___ Python tracker <http://bugs.python.org/issue11282> ___ ___ Python-bugs-list mai

[issue11298] unittest discovery needs better explanation

2011-02-26 Thread Michael Foord
Michael Foord added the comment: No, tests as top level modules work fine too. Importability is the only requirement. (Projects themselves are not typically packages but contain packages - so the wording needs to change slightly but I like the rest

[issue11385] TextTestRunner methods are not documented

2011-03-04 Thread Michael Foord
Michael Foord added the comment: Except the former is incorrect as the responsibility for printing results as they occur is with the TestResult and not the runner. I'll look at this and improve the docs for the runner. (And yes unittest.main() creates and uses a runner under the hood.

[issue11389] unittest: no way to control verbosity of doctests from cmd

2011-03-04 Thread Michael Foord
Michael Foord added the comment: If the verbosity parameter isn't sufficient (which needs documenting but that is issue 11385) then it would need to be a feature request on DocFileSuite (part of doctest). -- ___ Python tracker

[issue11385] TextTestRunner methods are not documented

2011-03-04 Thread Michael Foord
Michael Foord added the comment: TextTestRunner was more meant to be an *example* of a test runner. It just turned out to be the only one and widely used. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11407] unittest.TestCase.run should return result

2011-03-05 Thread Michael Foord
New submission from Michael Foord : If you call TestCase.run without an argument it will create a default TestResult and use it to execute the test. It should return the result so that you can introspect it. -- assignee: michael.foord messages: 130120 nosy: michael.foord priority

[issue11389] unittest: no way to control verbosity of doctests from cmd

2011-03-06 Thread Michael Foord
Michael Foord added the comment: Anatoly, does the verbosity parameter work for you? If not then any feature request / change needs to be for the DocFileSuite as the information is coming from there rather than unittest itself. -- assignee: docs@python -> versions: +Python

[issue11298] unittest discovery needs better explanation

2011-03-07 Thread Michael Foord
Michael Foord added the comment: Sounds good to me. -- ___ Python tracker <http://bugs.python.org/issue11298> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Michael Foord
New submission from Michael Foord : It is valid in CPython to create a new type with non-string keys in the dict. This is a problem for other implementations (neither pypy nor jython support it). This should raise a warning. -- components: Interpreter Core messages: 130462 nosy

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Michael Foord
Michael Foord added the comment: Note that other implementations not supporting this has been agreed by Guido. The language spec says that the class dict is a namespace and should have string keys. -- ___ Python tracker <http://bugs.python.

[issue11282] 3.3 unittest document not kept consist with code

2011-03-14 Thread Michael Foord
Michael Foord added the comment: Those methods should *not* have been removed. I thought we had discussed this. It is my fault for allowing the error in the 3.2 docs to remain. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11554] Port email module's test_email_codecs.py to Python 3

2011-03-15 Thread Michael Henry
New submission from Michael Henry : test_email_codecs.py in the email module should be ported to Python 3. The attached patch ports test_email_codecs.py and hooks it into the email test suite. -- components: Library (Lib) files: port-test_email_codecs.py.patch keywords: patch messages

[issue11555] email.Message.as_string no longer mangles "From " (doc fix)

2011-03-15 Thread Michael Henry
New submission from Michael Henry : The function email.Message.as_string has an out-of-date comment: """ This is a convenience method and may not generate the message exactly as you intend because by default it mangles lines that begin with "From ". For more fle

[issue11556] email.Message.get_payload can handle bytes payloads (minor doc fix)

2011-03-15 Thread Michael Henry
New submission from Michael Henry : In email.Message.get_payload, there is the following out-of-date comment: """ # payload can be bytes here, (I wonder if that is actually a bug?) """ The code can actually handle bytes payloads. -- components: Libra

[issue11558] Raise a more helpful exception in email.message.Message.attach after set_payload("some string")

2011-03-15 Thread Michael Henry
New submission from Michael Henry : The attached test program, test_email_attach_to_string.py, demonstrates the desire for email.message.Message.attach to raise a more helpful exception when the user incorrectly invokes attach() after setting the payload to a string. -- components

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file21125/test_posixpath_with_same_device.patch ___ Python tracker <http://bugs.python.org/issue11

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file21124/test_posixpath.patch ___ Python tracker <http://bugs.python.org/issue11503> ___ ___ Python-bug

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Changes by Michael Foord : Removed file: http://bugs.python.org/file21122/test_posixpath.patch ___ Python tracker <http://bugs.python.org/issue11503> ___ ___ Python-bug

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Michael Foord added the comment: The patch includes an unconditional "import posix" that will fail on Windows. posixpath is available on windows (although not *all* its functionality makes sense), so the whole test should not be skipped - but it is reasonable to skip just the new t

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Michael Foord added the comment: Note that instead of try finally constructs you can create a cleanup function and call self.addCleanup(...). This reduces extra levels of indentation in your test code. In the new code in "test_ismount", from "# Non-existent mountpoint" on

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Michael Foord added the comment: Scratch the comment about symlink - in test_mount. I see you already protect that code with "if support.can_symlink()". -- ___ Python tracker <http://bugs.python.o

[issue11503] Expand test coverage in posixpath

2011-03-15 Thread Michael Foord
Michael Foord added the comment: Will posixpath.sameopenfile work on Windows? That may need skipping. -- ___ Python tracker <http://bugs.python.org/issue11

[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread Michael Foord
Changes by Michael Foord : -- assignee: -> michael.foord ___ Python tracker <http://bugs.python.org/issue10775> ___ ___ Python-bugs-list mailing list Unsubscri

[issue11385] TextTestRunner methods are not documented

2011-03-15 Thread Michael Foord
Changes by Michael Foord : -- assignee: docs@python -> michael.foord ___ Python tracker <http://bugs.python.org/issue11385> ___ ___ Python-bugs-list mai

[issue11133] inspect.getattr_static code execution

2011-03-16 Thread Michael Foord
Michael Foord added the comment: Thanks Daniel (and sorry Andreas). Benjamin Peterson has fixed this. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11578] Increase test coverage for timeit.py

2011-03-16 Thread Michael Henry
New submission from Michael Henry : The timeit.py module has no specific tests. The attached patch adds Lib/test/test_timeit.py for unit testing, along with slight modifications to timeit.py to support predictable unit testing. -- components: Library (Lib) files: timeit_unit_test.patch

[issue5633] fix for timeit when the statment is a string and the setup is not (and tests)

2011-03-16 Thread Michael Henry
Michael Henry added the comment: Issue #11578 added unit tests for timeit.py. Because of this bug, two tests were omitted. In the attached patch are the previously withheld unit tests and an alternate method of fixing the bug (developed before Tim's fix was noticed). It's not c

[issue11578] Increase test coverage for timeit.py

2011-03-16 Thread Michael Henry
Michael Henry added the comment: Issue #5633 contains two additional unit tests that can't be added until that ticket's bug is fixed. -- nosy: +rhettinger resolution: accepted -> status: closed -> open ___ Python tracker <htt

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2011-03-16 Thread Michael Foord
Michael Foord added the comment: I need to check that the implementation has been backported to 2.7 completely / correctly. Raymond made some changes (output format and a bugfix) that may not have been backported yet. -- ___ Python tracker <h

[issue10242] unittest's assertItemsEqual() method makes too many assumptions about its input

2011-03-16 Thread Michael Foord
Michael Foord added the comment: Fixes backported to assertItemsEqual in 2.7. -- resolution: -> fixed stage: -> committed/rejected ___ Python tracker <http://bugs.python.org/i

[issue10979] setUpClass exception causes explosion with "-b"

2011-03-16 Thread Michael Foord
Changes by Michael Foord : -- versions: +Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue10979> ___ ___ Python-bugs-list mailing list Unsub

[issue10979] setUpClass exception causes explosion with "-b"

2011-03-16 Thread Michael Foord
Michael Foord added the comment: Thanks for finding this Brandon. The same problem probably exists for setupmodule and the teardown variants too. The issue is that the sys.stdout manipulation is done by result.startTest but setUpClass and setUpModule are executed by the suite outside the

[issue10535] Enable warnings by default in unittest

2011-03-16 Thread Michael Foord
Michael Foord added the comment: Does Brian's patch still need applying? (Can this be closed?) -- ___ Python tracker <http://bugs.python.org/issue10535> ___ ___

[issue11589] Unit test extensions for email module

2011-03-17 Thread Michael Henry
New submission from Michael Henry : The attached patch includes additional unit tests for the email module, and splits pre-existing test_header_encode() and test_decode() functions into individual test functions. -- components: Library (Lib) files: test_email_additional_tests.patch

[issue11590] email quoprimime.py patch for header_encode of empty string, decode with different eol

2011-03-17 Thread Michael Henry
New submission from Michael Henry : The attached patch adds unit tests and some minor fixes for the email module's quoprimime.py file. The header_encode() function did not properly return an empty string when given an empty string. The decode() function did not properly detect the

[issue11606] maxlinelen exceeded by email module's body_encode() function

2011-03-19 Thread Michael Henry
New submission from Michael Henry : The email module's body_encode() function (found in quoprimime.py) can generate oversized encoded lines that exceed the maximum line length specified by the maxlinelen parameter. The attached test case 'test_encode_trailing_space_at_maxlinelen

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2011-03-19 Thread Michael Hughes
Michael Hughes added the comment: Hey guys We don't always have control over all of the threads launched within our application. We might have inexperienced users writing basic scripts using threads, but they don't know enough about setting them to Daemon. Previous versions of

[issue11627] segfault raising an arbitrary object as an exception

2011-03-21 Thread Michael Foord
New submission from Michael Foord : Python 3.2 (r32:88452, Feb 20 2011, 10:19:59) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> class Foo(Exception): ... def _

[issue11627] segfault raising an arbitrary object as an exception

2011-03-21 Thread Michael Foord
Michael Foord added the comment: Personally I don't think this should be valid at all (it should ideally be an error at the raise point). It is the kind of thing that causes difficulties for the other implementations trying to match CPython behaviour (this code works in Python 2.7 - yo

[issue11627] segfault raising an arbitrary object as an exception

2011-03-21 Thread Michael Foord
Michael Foord added the comment: This: raise type('',(Exception,),{'__new__':lambda *a:object()}) Segfaults 3.2 but not 3.1. -- ___ Python tracker <http://bug

[issue11647] function decorated with a context manager can only be invoked once

2011-03-23 Thread Michael Foord
Michael Foord added the comment: The former sounds like fixing the bug, the latter like removing functionality. So yes, I prefer the former... -- ___ Python tracker <http://bugs.python.org/issue11

[issue11606] maxlinelen exceeded by email module's body_encode() function

2011-03-24 Thread Michael Henry
Michael Henry added the comment: David, Your patch looks fine to me. I like putting the logic is a separate class as you've done. I looked in itertools for something to perform the job of the each_last() generator I'd had in my patch, but I didn't see anything. I l

[issue11650] Faulty RESTART/EINTR handling in Parser/myreadline.c

2011-03-24 Thread Michael Hudson
Michael Hudson added the comment: To be clear, I have no idea why the patch for issue 960406 removed the continue from my_fgets. It may have been simply a mistake. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11647] function decorated with a context manager can only be invoked once

2011-03-25 Thread Michael Foord
Michael Foord added the comment: I'm strongly with Antoine on this. If you use context manager as a decorator you should be able to reuse it - and in general both generators and context managers can be reused and so I don't understand the phrase 'moral equivalent of the i

[issue11664] Add patch method to unittest.TestCase

2011-03-26 Thread Michael Foord
Michael Foord added the comment: I'd like to ponder this a bit. Note that the patch is incorrect - fetching the attribute should not be done with getattr (this will trigger descriptors instead of fetching the underlying member) and should not be reset unconditionally (if the origina

[issue11683] unittest discover should recurse into packages which are already in sys.path

2011-03-26 Thread Michael Foord
Michael Foord added the comment: Going into multiple directories on the path would make discovery more complex (but isn't out of the question). To be compatible with nose test discovery it is likely that we will special case an "src" directory anyway though (as it is a re

[issue11683] unittest discover should recurse into packages which are already in sys.path

2011-03-26 Thread Michael Foord
Changes by Michael Foord : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue11683> ___ ___ Python-bugs-list mailing list Unsub

[issue11683] unittest discover should recurse into packages which are already in sys.path

2011-03-26 Thread Michael Foord
Michael Foord added the comment: Discover does recurse into directories - but only packages, so the algorithm for importing them is trivial. You're suggesting enhancing that to multiple strategies (checking non package directories to see if they are on the path and then recursing into

[issue11683] unittest discover should recurse into packages which are already in sys.path

2011-03-26 Thread Michael Foord
Michael Foord added the comment: Calvin, note that the modification you suggest is not a *great* complication to the discovery algorithm (just "some" complication); so I'll consider it. -- ___ Python tracker <http://bugs.pyt

[issue11647] function decorated with a context manager can only be invoked once

2011-03-29 Thread Michael Foord
Michael Foord added the comment: I agree. copy is a separate protocol and shouldn't be involved here. -- ___ Python tracker <http://bugs.python.org/is

[issue11664] Add patch method to unittest.TestCase

2011-03-29 Thread Michael Foord
Michael Foord added the comment: Right, I helped with the writing of that at PyCon. The patch method would look very similar. test.support.patch is not something we want to make public (in that location). -- ___ Python tracker <h

[issue11740] difflib html diff takes extremely long

2011-04-01 Thread Michael O'Rourke
New submission from Michael O'Rourke : If you try to difference the attached files with difflib and a html difference it take 10 minutes or more. In comparison other differencing tools like windiff and araxis merge will show the diff within a second. Example code I'm using is:

[issue11759] assert for exception parameters

2011-04-04 Thread Michael Foord
Changes by Michael Foord : -- resolution: -> invalid stage: -> committed/rejected ___ Python tracker <http://bugs.python.org/issue11759> ___ ___ Pyth

[issue11763] assertEqual memory issues with large text inputs

2011-04-04 Thread Michael Foord
New submission from Michael Foord : >>> s = "x" * (2**29) >>> case.assertEqual(s + "a", s + "b") Traceback (most recent call last): File "", line 1, in File "/home/antoine/cpython/default/Lib/unittest/case.py", line 643

<    1   2   3   4   5   6   7   8   9   10   >