[issue21873] Tuple comparisons with NaNs are broken
Change by Andreas Kloeckner : -- nosy: +inducer ___ Python tracker <https://bugs.python.org/issue21873> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21161] list comprehensions don't see local variables in pdb in python3
Change by Andreas Kloeckner : -- nosy: +inducer ___ Python tracker <https://bugs.python.org/issue21161> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20131] warnings module offers no documented, programmatic way to reset seen-warning flag
New submission from Andreas Kloeckner: For tests and doctests, it is often desirable to show or verify that a certain warning occurs. Unfortunately, if the warning has been hit previously, it will not be issued again. It would be great if there were a documented, unified way to reset this 'seen' flag. Related stackoverflow posts showing that I'm not the first person to have this need: * https://stackoverflow.com/questions/19428761/python-showing-once-warnings-again-resetting-all-warning-registries * https://stackoverflow.com/questions/2418570/testing-warnings-with-doctest Neither of these has a satisfactory solution. -- components: Library (Lib) messages: 207372 nosy: inducer priority: normal severity: normal status: open title: warnings module offers no documented, programmatic way to reset seen-warning flag versions: Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20131 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20131] warnings module offers no documented, programmatic way to reset seen-warning flag
Changes by Andreas Kloeckner inf...@tiker.net: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20131 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17687] Undeclared symbol in _struct.c
New submission from Andreas Kloeckner: This line in the _struct module references a PyStructType that isn't declared anywhere. This is only apparent when the file is compiled without -DNDEBUG. http://hg.python.org/cpython/file/1410b7790de6/Modules/_struct.c#l43 -- components: Extension Modules messages: 186501 nosy: inducer priority: normal severity: normal status: open title: Undeclared symbol in _struct.c type: compile error versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17687 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17687] Undeclared symbol in _struct.c
Andreas Kloeckner added the comment: Whoops. I'm an idiot. Forget I said anything. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17687 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17687] Undeclared symbol in _struct.c
Andreas Kloeckner added the comment: (Forgot to say: sorry.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17687 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17413] format_exception() breaks on exception tuples from trace function
Andreas Kloeckner added the comment: Thanks for the suggestion. Since 3.2 and 3.3 will be with us for a while, I've implemented the workaround you've suggested. Works, too. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17413 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17413] format_exception() breask on exception tuples from trace function
New submission from Andreas Kloeckner: traceback.format_exception() used to work properly with the 'arg' value passed to a tracing function set up via sys.settrace for an 'exception' event. In Python 3.x, this is no longer the case. Below you'll find what the attached test produces for a variety of interpreter versions. If this is not intended to work, I would be much obliged for a hint on how to achieve the desired effect--i.e. get a formatted exception traceback for the exception tuple 'arg' passed to the trace function. Thanks! See also: https://github.com/inducer/pudb/issues/61 # Python 2.7 # ZZ call ZZ line ZZ line ZZ exception exception (type 'exceptions.AttributeError', 'int' object has no attribute 'invalid', traceback object at 0x1951fc8) --- Traceback (most recent call last): File exc-bug.py, line 20, in f x.invalid AttributeError: 'int' object has no attribute 'invalid' --- ZZ return Traceback (most recent call last): File exc-bug.py, line 22, in module f() File exc-bug.py, line 20, in f x.invalid AttributeError: 'int' object has no attribute 'invalid' ZZ call ZZ call # # Python 3.2 # ZZ call ZZ line ZZ line ZZ exception exception (class 'AttributeError', 'int' object has no attribute 'invalid', traceback object at 0x7f4cf42e5f80) --- Traceback (most recent call last): File exc-bug.py, line 22, in module f() File exc-bug.py, line 20, in f x.invalid File exc-bug.py, line 9, in trace print(.join(format_exception(*arg))) File /usr/lib/python3.2/traceback.py, line 180, in format_exception for value, tb in values: File /usr/lib/python3.2/traceback.py, line 122, in _iter_chain cause = exc.__cause__ AttributeError: 'str' object has no attribute '__cause__' # # Python 3.3 # ZZ call ZZ line ZZ line ZZ exception exception (class 'AttributeError', 'int' object has no attribute 'invalid', traceback object at 0x7f47383acb00) --- Traceback (most recent call last): File exc-bug.py, line 22, in module f() File exc-bug.py, line 20, in f x.invalid File exc-bug.py, line 9, in trace print(.join(format_exception(*arg))) File /usr/lib/python3.3/traceback.py, line 181, in format_exception for value, tb in values: File /usr/lib/python3.3/traceback.py, line 122, in _iter_chain context = exc.__context__ AttributeError: 'str' object has no attribute '__context__' # -- components: Interpreter Core files: exc-bug.py messages: 184122 nosy: inducer priority: normal severity: normal status: open title: format_exception() breask on exception tuples from trace function type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file29403/exc-bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17413 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4949] Constness in PyErr_NewException
Andreas Kloeckner inf...@tiker.net added the comment: ping? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10129] Curious 'name not defined error' with 'python -m'
New submission from Andreas Kloeckner inf...@tiker.net: $ python3.1 -m a b.py results in Traceback (most recent call last): File /usr/lib/python3.1/runpy.py, line 128, in _run_module_as_main __main__, fname, loader, pkg_name) File /usr/lib/python3.1/runpy.py, line 34, in _run_code exec(code, run_globals) File /home/andreas/tmp/python-mbug/a.py, line 6, in module main() File /home/andreas/tmp/python-mbug/a.py, line 3, in main exec(compile(open(sys.argv[1]).read(), sys.argv[1], 'exec')) File b.py, line 8, in module sys.exit(main()) File b.py, line 5, in main argv = sys.argv[1:] NameError: global name 'sys' is not defined a.py -- def main(): import sys exec(compile(open(sys.argv[1]).read(), sys.argv[1], 'exec')) if __name__=='__main__': main() --- b.py -- import sys def main(): sys.argv[1:] if __name__ == __main__: main() --- -- components: Interpreter Core messages: 118913 nosy: inducer priority: normal severity: normal status: open title: Curious 'name not defined error' with 'python -m' type: behavior versions: Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10129 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4949] Constness in PyErr_NewException
Andreas Kloeckner inf...@tiker.net added the comment: ping? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1530559] struct.pack raises TypeError where it used to convert
Andreas Kloeckner inf...@tiker.net added the comment: The fix breaks my package PyCUDA, which relies on handing struct something that can be cast to long. (i.e. not a float, but something representing a memory address on a GPU) Am I out of luck? -- nosy: +inducer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1530559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1530559] struct.pack raises TypeError where it used to convert
Andreas Kloeckner inf...@tiker.net added the comment: AFAICS, __index__ would be fine. To make sure I understand your proposed solution correctly: You'd go through the argument list beforehand and cast everything that's not a number type or str to int by means of __index__? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1530559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1530559] struct.pack raises TypeError where it used to convert
Andreas Kloeckner inf...@tiker.net added the comment: Thanks for the clarification of 'beforehand'--I had understood from your description that this would be some sort of preprocessing step. I agree that the TypeError is a bit much, though I'm biased of course. If you'd like my input on things you come up with, please don't hesitate to ping me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1530559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6323] Py3.1 pdb doesn't deal well with syntax errors
Andreas Kloeckner inf...@tiker.net added the comment: Vladislav: The behavior you find funny is actually correct. pass is a statement and as such not allowed in a lambda. (only expressions are) Your posting is unrelated to this bug report. If you're still confused, please ask on comp.lang.python. -- components: +Library (Lib) -Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6323 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1652] subprocess should have an option to restore SIGPIPE to default action
Changes by Andreas Kloeckner inf...@tiker.net: -- nosy: +inducer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1652 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4949] Constness in PyErr_NewException
Changes by Andreas Kloeckner inf...@tiker.net: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6322] Pdb breakpoints don't work on lines without bytecode
New submission from Andreas Kloeckner inf...@tiker.net: Take this program: 8 --- print START a = [ 1 for i in range(10)] 8 --- as a.py, run python -m pdb a.py, say b 3 to set a breakpoint on line 3. Say c to start execution. Watch the program finish without ever hitting the breakpoint. The problem is that line 3 has no bytecode generated for it, so there's nothing to break on. Pdb should provide feedback in this case. I'm the author of PuDB, and I've written code to check for this condition Please feel free to steal that code, here: http://is.gd/19fvD -- components: Library (Lib) messages: 89597 nosy: inducer severity: normal status: open title: Pdb breakpoints don't work on lines without bytecode type: behavior versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6323] Py3.1 pdb doesn't deal well with syntax errors
New submission from Andreas Kloeckner inf...@tiker.net: Steps to reprdocue: 1) Debug a program with a syntax error in pdb. 2) Get the SyntaxError traceback. 3) Hit q to quit. 4) Another SyntaxError traceback, and you're back at the Pdb prompt. -- components: Library (Lib) messages: 89599 nosy: inducer severity: normal status: open title: Py3.1 pdb doesn't deal well with syntax errors type: behavior versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6323 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6246] Python bebugger ignores exception if instructed to return from generator
New submission from Andreas Kloeckner inf...@tiker.net: I get this debugger session with the attached file. Note that even though a NameError occurs, no indication of that error is visible on the debugger conosle. 8 - $ python -m pdb pdb_bug.py /home/andreas/tmp/pdb_bug.py(1)module() - def f(): (Pdb) n /home/andreas/tmp/pdb_bug.py(6)module() - list(f()) (Pdb) s --Call-- /home/andreas/tmp/pdb_bug.py(1)f() - def f(): (Pdb) n /home/andreas/tmp/pdb_bug.py(2)f() - print BLAH (Pdb) r BLAH --Return-- /home/andreas/tmp/pdb_bug.py(3)f()-None - bogus (Pdb) -- components: Library (Lib) files: pdb_bug.py messages: 89123 nosy: inducer severity: normal status: open title: Python bebugger ignores exception if instructed to return from generator type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file14239/pdb_bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6246 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6246] Python debugger ignores exception if instructed to return from generator
Changes by Andreas Kloeckner inf...@tiker.net: -- title: Python bebugger ignores exception if instructed to return from generator - Python debugger ignores exception if instructed to return from generator ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6246 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4949] Constness in PyErr_NewException
New submission from Andreas Kloeckner inf...@tiker.net: The name argument to PyErr_NewException() should be changed from char * to const char *. Since the rest of pyerrors.h is const-correct, this seems like an omission. -- components: Interpreter Core messages: 79868 nosy: inducer severity: normal status: open title: Constness in PyErr_NewException versions: Python 2.5, Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4949 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3828] Bound methods compare 'successfully' with ints
New submission from Andreas Kloeckner [EMAIL PROTECTED]: Check out this transcript: 8 --- Python 2.5.2 (r252:60911, Aug 8 2008, 09:22:44) [GCC 4.3.1] on linux2 Type help, copyright, credits or license for more information. class A(object): ... def b(self): ... pass ... a = A() a.b 0 False 8 --- I would argue that the 'successful' comparison of a bound method with an int is undesirable. This especially bad when you're refactoring a class property into a class method and the property used to get used in comparisons. Instead of the expected exceptions, you get weird behavior. -- components: Interpreter Core messages: 72961 nosy: inducer severity: normal status: open title: Bound methods compare 'successfully' with ints type: behavior versions: Python 2.5 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3828 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1381] cmath is numerically unsound
New submission from Andreas Kloeckner: This here basically says it all: import cmath;[cmath.asinh(i*1e-17).real for i in range(0,20)] [4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16, 4.4408920985006257e-16] The boost.math toolkit at [2] is an implementation that does better in the above (real-only) aspect. [2] http://freespace.virgin.net/boost.regex/toolkit/html/index.html Tim Peters remarks in [1] that basically all of cmath is unsound. http://mail.python.org/pipermail/python-bugs-list/2001-February/004126.html I just wanted to make sure that this issue remains on the radar. -- components: Library (Lib) messages: 57088 nosy: inducer severity: normal status: open title: cmath is numerically unsound type: behavior versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1381 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1381] cmath is numerically unsound
Andreas Kloeckner added the comment: On Samstag 03 November 2007, Martin v. Löwis wrote: Martin v. Löwis added the comment: Can you propose a patch? Other than point at how boost.math does things, I don't have the time to work on this right now, sorry. Andreas __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1381 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1045] Performance regression in 2.5
New submission from Andreas Kloeckner: The attached program uncovers a two-fold performance regression in Python 2.5 with respect to Python 2.4. Below, the element-wise case goes from 2.5 seconds in 2.4 to about 4 in 2.5. Since that's a pretty serious increase, I thought I'd point it out. $ python2.5 periodic_test.py elwise 3.91989398003 collective 1.21577095985 $ python2.4 periodic_test.py elwise 2.50014710426 tuplewise 1.35589385033 -- components: Interpreter Core, Library (Lib) files: periodic_test.py messages: 55366 nosy: inducer severity: normal status: open title: Performance regression in 2.5 type: behavior versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1045 __This benchmark informs the decision whether to do matching of periodic face pairs by lookup of tuples of vertices or each vertex separately. At the time of this writing, and under Python 2.5, tuplewise lookup has about a 1-to-4 advantage. def main(): from random import choice from time import time N = 50 base_set = range(N) # generate correspondence corr = dict((b, choice(base_set)) for b in base_set) # generate tuples TS = 3 N_TUP = 50 tups = [tuple(choice(base_set) for i in range(TS)) for j in range(N_TUP)] tup_corr = {} for tup in tups: mapped = tuple(corr[t] for t in tup) tup_corr[tup] = mapped ITER = 50 start = time() for i in xrange(ITER): tup = choice(tups) mapped = tuple(corr[t] for t in tup) print elwise, time()-start start = time() for i in xrange(ITER): tup = choice(tups) mapped = tup_corr[tup] print tuplewise, time()-start if __name__ == __main__: main() ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com