[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-17 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: Is anything blocking this patch's submission? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15836

[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread Daniel Wagner-Hall
New submission from Daniel Wagner-Hall: Importing the same module twice should only execute its code once, and should only lead to one copy of the classes defined in the module's file. If a subdirectory of $PWD is on $PYTHONPATH, and a package is imported both relative to $PWD and relative

[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: That is indeed the behaviour I'm talking about. In particular I came across this where two libraries imported an exception type using different sys.path traversals, which both led to the same file, and a try-catch didn't catch the exception because it had

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-03 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: Cool, my contributor agreement has been received, please merge if happy! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15836

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-08-31 Thread Daniel Wagner-Hall
New submission from Daniel Wagner-Hall: The following code in a unittest test is a no-op: self.assertRaises(lambda: 1) I would expect this to fail the test, because I naively assumed omitting the exception class would act as: self.assertRaises(BaseException, lambda: 1) verifying that *any

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-08-31 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: I seem to be getting exceptions why trying to upload a new patch to rietveld, either by the web interface (in several browsers), or by upload.py - attaching new patchset here Also, if I wanted to backport to 2.7 including an isinstance(e, types.ClassType

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-08-31 Thread Daniel Wagner-Hall
Daniel Wagner-Hall added the comment: Added patch for 2.7. I'll sign the contributor form just as soon as I can get to a printer. Thanks for taking me through my first contribution. -- versions: +Python 2.7 Added file: http://bugs.python.org/file27081/issue15836-2.7.patch

[issue13139] multiprocessing.map skips finally blocks

2011-10-09 Thread Daniel Wagner-Hall
Daniel Wagner-Hall dawag...@gmail.com added the comment: Explanation of behaviour at http://stackoverflow.com/questions/7700929/python-multiprocessing-map-if-one-thread-raises-an-exception-why-arent-other tl;dr SIGTERM kills subprocesses and finally blocks aren't called. I still consider

[issue13139] multiprocessing.map skips finally blocks

2011-10-08 Thread Daniel Wagner-Hall
New submission from Daniel Wagner-Hall dawag...@gmail.com: import random from multiprocessing import Pool from time import sleep def Process(x): try: print x sleep(random.random()) raise Exception('Exception: ' + x) finally: print 'Finally: ' + x Pool(3).map(Process, ['1