[issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame'
New submission from Abael He : /opt/conda/lib/python3.8/site-packages/prompt_toolkit/shortcuts/prompt.py in prompt(self, message, editing_mode, refresh_interval, vi_mode, lexer, completer, complete_in_thread, is_password, key_bindings, bottom_toolbar, style, color_depth, include_default_pygments_style, style_transformation, swap_light_and_dark_colors, rprompt, multiline, prompt_continuation, wrap_lines, enable_history_search, search_ignore_case, complete_while_typing, validate_while_typing, complete_style, auto_suggest, validator, clipboard, mouse_support, input_processors, reserve_space_for_menu, enable_system_prompt, enable_suspend, enable_open_in_editor, tempfile_suffix, tempfile, default, accept_default, pre_run, set_exception_handler) 992 return get_event_loop().run_until_complete(self._dumb_prompt(self.message)) 993 --> 994 return self.app.run(set_exception_handler=set_exception_handler) 995 996 async def _dumb_prompt(self, message: AnyFormattedText = "") -> _T: /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in run(self, pre_run, set_exception_handler) 809 set_event_loop(loop) 810 --> 811 return loop.run_until_complete( 812 self.run_async(pre_run=pre_run, set_exception_handler=set_exception_handler) 813 ) /opt/conda/lib/python3.8/asyncio/base_events.py in run_until_complete(self, future) 614 raise RuntimeError('Event loop stopped before Future completed.') 615 --> 616 return future.result() 617 618 def stop(self): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in run_async(self, pre_run, set_exception_handler) 776 loop.set_exception_handler(previous_exc_handler) 777 --> 778 return await _run_async2() 779 780 def run( /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in _run_async2() 764 # `KeyboardInterrupt`, we still want to wait for the 765 # background tasks. --> 766 await self.cancel_and_wait_for_background_tasks() 767 768 # Set the `_is_running` flag to `False`. Normally this /opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py in cancel_and_wait_for_background_tasks(self) 865 for task in self.background_tasks: 866 try: --> 867 await task 868 except CancelledError: 869 pass /opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in new_coroutine(*a, **kw) 1852 while True: 1853 try: -> 1854 await coroutine(*a, **kw) 1855 except _Retry: 1856 continue /opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in async_completer(select_first, select_last, insert_common_part, complete_event) 1681 return self.complete_state == complete_state 1682 -> 1683 async for completion in self.completer.get_completions_async( 1684 document, complete_event 1685 ): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in get_completions_async(self, document, complete_event) 267 completer = self.get_completer() or DummyCompleter() 268 --> 269 async for completion in completer.get_completions_async( 270 document, complete_event 271 ): /opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in get_completions_async(self, document, complete_event) 194 Asynchronous generator of :class:`.Completion` objects. 195 """ --> 196 for item in self.get_completions(document, complete_event): 197 yield item 198 /opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in get_completions(self, document, complete_event) 114 except Exception as e: 115 from traceback import print_tb --> 116 print_tb(e) 117 118 @staticmethod /opt/conda/lib/python3.8/traceback.py in print_tb(tb, limit, file) 51 method. 52 """ ---> 53 print_list(extract_tb(tb, limit=limit), file=file) 54 55 def format_tb(tb, limit=None): /opt/conda/lib/python3.8/traceback.py in extract_tb(tb, limit) 70 whitespace stripped; if the source is not available it is None. 71 """ ---> 72 return StackSummary.extract(walk_tb(tb), limit=limit) 73 74 # /opt/conda/lib/python3.8/traceback.py in extract(klass, frame_gen, limit, lookup_lines, capture_locals) 345 result
[issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame'
Abael He added the comment: This is a bug caused by IPython: /opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in get_completions(self, document, complete_event) 114 except Exception as e: 115 from traceback import print_tb --> 116 print_tb(e) 117 118 @staticmethod ## # Simulation investigation for above KeyError: In [3]: def fun(): ...: try: ...: s = {} ...: k = s['0'] ...: except Exception as e: ...: import sys ...: from traceback import print_tb ...: exc_type, exc_value, exc_traceback = sys.exc_info() ...: print_tb(exc_traceback) ...: In [4]: fun() File "", line 4, in fun k = s['0'] -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue41612> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41693] AttributeError: 'str' object has no attribute '__cause__' (python3.8/traceback.py", line 479, in __init__)
New submission from Abael He : Abaels-MBP:notebook-myfork abaelhe$ pip install jupyterlab_powerpoint Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://mirror.baidu.com/pypi/simple Collecting jupyterlab_powerpoint Downloading https://pypi.tuna.tsinghua.edu.cn/packages/67/b3/7c65696326b35c2cf62f7203ddc6915518769b3281297762505496c02cbb/jupyterlab_powerpoint-0.1.0-py2.py3-none-any.whl (22 kB) Collecting python-pptx>=0.6.0 …… Building wheels for collected packages: python-pptx Building wheel for python-pptx (setup.py) ... done Created wheel for python-pptx: filename=python_pptx-0.6.18-py3-none-any.whl size=275703 sha256=2cc60bf3fd5d8de7909a47cf2318248fe7f966f64da1014be413db2274abd19c Stored in directory: /Users/abaelhe/Library/Caches/pip/wheels/2c/92/3f/c614b86f8f18dc83f377a94e76a2f2fb1a1b6d5d74d438d2f4 Successfully built python-pptx Installing collected packages: lxml, XlsxWriter, python-pptx, jupyterlab-powerpoint Successfully installed XlsxWriter-1.3.3 jupyterlab-powerpoint-0.1.0 lxml-4.5.2 python-pptx-0.6.18 Abaels-MBP:notebook-myfork abaelhe$ jupyter labextension install jupyterlab_powerpoint jupyter serverextension enable --py jupyterlab_powerpointjupyter serverextension enable --py jupyterlab_powerpointjupyter serverextension enable --py jupyterlab_powerpointBuilding jupyterlab assets (build:prod:minimize) --- Logging error --- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 670, in _rmtree_safe_fd os.unlink(entry.name, dir_fd=topfd) PermissionError: [Errno 13] Permission denied: '403.html' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/__init__.py", line 1081, in emit msg = self.format(record) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/__init__.py", line 925, in format return fmt.format(record) File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/traitlets/config/application.py", line 117, in format return super(LevelFormatter, self).format(record) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/__init__.py", line 672, in format record.exc_text = self.formatException(record.exc_info) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/logging/__init__.py", line 622, in formatException traceback.print_exception(ei[0], ei[1], tb, None, sio) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/traceback.py", line 103, in print_exception for line in TracebackException( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/traceback.py", line 479, in __init__ if (exc_value and exc_value.__cause__ is not None AttributeError: 'str' object has no attribute '__cause__' Call stack: File "/Users/abaelhe/Library/Python/3.8/bin/jupyter-labextension", line 8, in sys.exit(main()) File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyter_core/application.py", line 270, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/traitlets/config/application.py", line 664, in launch_instance app.start() File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/labextensions.py", line 308, in start super(LabExtensionApp, self).start() File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyter_core/application.py", line 259, in start self.subapp.start() File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/labextensions.py", line 104, in start build(clean_staging=self.should_clean, File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/commands.py", line 459, in build return handler.build(name=name, version=version, static_url=static_url, File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/commands.py", line 640, in build self._populate_staging( File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/commands.py", line 1100, in _populate_staging _rmtree(templates, self.logger) File "/Users/abaelhe/Library/Python/3.8/lib/python/site-packages/jupyterlab/commands.py", line 1824, in _rmtree shutil.rmtree(path, onerror=onerror) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 715, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/Libr
[issue41693] AttributeError: 'str' object has no attribute '__cause__' (python3.8/traceback.py", line 479, in __init__)
Change by Abael He : -- versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41693] AttributeError: 'str' object has no attribute '__cause__' (python3.8/traceback.py", line 479, in __init__)
Abael He added the comment: "traceback.py" exception occurred During handling of the jupyter exception; that denotes we need more robust "traceback.py"; i have submit PR: https://github.com/python/cpython/pull/22064 -- ___ Python tracker <https://bugs.python.org/issue41693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41693] AttributeError: 'str' object has no attribute '__cause__' (python3.8/traceback.py", line 479, in __init__)
Abael He added the comment: jupyterlab bug -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue41693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com