[issue30497] Line number of docstring in AST
Steven Myint added the comment: I think what you guys have brought up makes sense. Now that you mention it, I see that pyflakes gives the wrong line number if an escaped newline appears after the doctests. Though, it works fine if the escaped newline appears before it. https://github.com/PyCQA/pyflakes/blob/1af4f14ad4675bf5c61c47bbb7c2421b50d1cba4/pyflakes/checker.py#L842 This is a non-default feature in pyflakes anyway, so we can live with it. Thanks -- ___ Python tracker <http://bugs.python.org/issue30497> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30497] Line number of docstring in AST
New submission from Steven Myint: Since #29463, it is no longer obvious how to get the line number of a docstring in the AST: import ast x = ast.parse('''\ def foo(): """This is a docstring.""" ''') # In Python 3.6, the docstring and line number would be: print(x.body[0].body[0].value.s) print(x.body[0].body[0].value.lineno) # In Python 3.7, I don't know what the equivalent would be. print(x.body[0].docstring) # Line number? We use this feature in pyflakes (https://github.com/PyCQA/pyflakes/issues/271). -- components: Interpreter Core messages: 294654 nosy: myint priority: normal severity: normal status: open title: Line number of docstring in AST versions: Python 3.7 ___ Python tracker <http://bugs.python.org/issue30497> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt
Changes by Steven Myint : -- nosy: +myint ___ Python tracker <http://bugs.python.org/issue8296> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21540] PEP 8 should recommend "is not" and "not in"
Changes by Steven Myint : -- nosy: +myint ___ Python tracker <http://bugs.python.org/issue21540> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception
Steven Myint added the comment: This bug was introduced in #13831. -- versions: +Python 3.5 ___ Python tracker <http://bugs.python.org/issue20980> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception
Steven Myint added the comment: I didn't quite understand the multiprocessing test cases, but attached is a standalone test case that reproduces the problem. The problem only shows up when using ThreadPool. $ python thread_pool_exception_test.py Traceback (most recent call last): File "thread_pool_exception_test.py", line 7, in pool.map(exception, [1]) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/pool.py", line 255, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/pool.py", line 594, in get raise self._value TypeError: exceptions must derive from BaseException -- Added file: http://bugs.python.org/file34520/thread_pool_exception_test.py ___ Python tracker <http://bugs.python.org/issue20980> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20980] In multiprocessing.pool, ExceptionWithTraceback should derive from Exception
New submission from Steven Myint: In multiprocessing.pool, ExceptionWithTraceback is not derived from Exception. Thus when it is raised, we get the exception, "TypeError: exceptions must derive from BaseException". Attached is a patch that fixes this. See below example traceback that prompted me to notice this: Traceback (most recent call last): File "/Users/myint/Library/Python/3.4/bin/yolk", line 9, in load_entry_point('yolk3k==0.7.3', 'console_scripts', 'yolk')() File "/Users/myint/Library/Python/3.4/lib/python/site-packages/yolk/cli.py", line 1123, in main my_yolk.run() File "/Users/myint/Library/Python/3.4/lib/python/site-packages/yolk/cli.py", line 208, in run return getattr(self, action)() File "/Users/myint/Library/Python/3.4/lib/python/site-packages/yolk/cli.py", line 240, in show_updates for (project_name, version, newest) in _updates(pkg_list, self.pypi): File "/Users/myint/Library/Python/3.4/lib/python/site-packages/yolk/cli.py", line 1104, in _updates names): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/pool.py", line 255, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/pool.py", line 594, in get raise self._value TypeError: exceptions must derive from BaseException -- components: Library (Lib) files: exception_with_traceback.diff keywords: patch messages: 214101 nosy: myint priority: normal severity: normal status: open title: In multiprocessing.pool, ExceptionWithTraceback should derive from Exception type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file34518/exception_with_traceback.diff ___ Python tracker <http://bugs.python.org/issue20980> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com