This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Ricyteach, pitrou, serhiy.storchaka, yselivanov
Date 2018-04-22.05:45:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thank you for your report Rick. But I get the same error in 3.6.

An AttributeError is raised if the debugger runs at the interpreter shutdown stage (sys.is_finalizing() returns True). sys.path was set to None at the beginning of modules cleanup. The debugger traces the _ag() asynchronous generator in You can see some details when run Python with option -v.

$ ./python -v ../
import 'pdb' # <_frozen_importlib_external.SourceFileLoader object at 0x7f5b45debae8>
# extension module 'readline' loaded from '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug/'
# extension module 'readline' executed from '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug/'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f5b45d94608>

# clear builtins._
# clear sys.path
# clear sys.argv
# cleanup[3] wiping re
# destroy _locale
# destroy sre_compile
# destroy copyreg
# cleanup[3] wiping enum
# cleanup[3] wiping types
Exception ignored in: <async_generator object _ag at 0x7f6de03f0eb8>
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/", line 27, in _ag
  File "/home/serhiy/py/cpython/Lib/", line 90, in trace_dispatch
  File "/home/serhiy/py/cpython/Lib/", line 128, in dispatch_call
  File "/home/serhiy/py/cpython/Lib/", line 250, in break_anywhere
  File "/home/serhiy/py/cpython/Lib/", line 49, in canonic
AttributeError: 'NoneType' object has no attribute 'abspath'

Adding "del _ag" in fixes this issue. But there are open questions.

Is it good that the debugger is enabled at the shutdown stage?

Why the code of the never used asynchronous generator is executed at all?
Date User Action Args
2018-04-22 05:45:39serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, yselivanov, Ricyteach
2018-04-22 05:45:39serhiy.storchakasetmessageid: <>
2018-04-22 05:45:39serhiy.storchakalinkissue33328 messages
2018-04-22 05:45:38serhiy.storchakacreate