[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: Adding Georg, who is listed as an expert for the traceback module (https://docs.python.org/devguide/experts.html). -- nosy: +georg.brandl ___ Python tracker <http://bugs.python.org/issue29

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: For your convenience, here is a possible patch fixing these issues. It modifies the format_exception_only function in the traceback module to follow the behavior of the interpreter a little more closely for SyntaxError's. Feel free to use, in whole, in

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: Two other minor discrepancies between the way traceback and the interpreter format SyntaxError's, in 2.7.13: 1. >>> e = SyntaxError("some message", ("myfile.py", None, None, None)) >>> raise e Traceback (mo

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-29 Thread Naftali Harris
New submission from Naftali Harris: The traceback documentation states that it "exactly mimics the behavior of the Python interpreter when it prints a stack trace." Here's a small case where it doesn't, on 2.7.13: ~/repos/Python-2.7.13$ cat example.py def f(x): glo

[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Naftali Harris
Naftali Harris added the comment: Oh, ok, that makes a lot of sense. Thanks for the clear and patient explanation, Tim! Sorry to have bothered the Python bug tracker with this. --Naftali -- resolution: -> invalid status: open -> closed ___

[issue20775] Modifications to global variables ignored after instantiating multiprocessing.Pool

2014-02-25 Thread Naftali Harris
New submission from Naftali Harris: Hi everyone, It appears that if you use a global variable in a function that you pass to Pool.map, but modify that global variable after instantiating the Pool, then the modification will not be reflected when Pool.map calls that function. Here's a