[issue38990] Import genericpath fails with python -S

Brittany Reynoso report at bugs.python.org
Fri Dec 6 16:42:19 EST 2019


New submission from Brittany Reynoso <breynoso at fb.com>:

When running python -S, attempting to run "import genericpath" fails with an attribute error due to a circular dependency between posixpath and genericpath that's triggered when "import os" is called from within genericpath.py. 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/fbcode/platform007/lib/python3.7/genericpath.py", line 6, in <module>
    import os
  File "/usr/local/fbcode/platform007/lib/python3.7/os.py", line 57, in <module>
    import posixpath as path
  File "/usr/local/fbcode/platform007/lib/python3.7/posixpath.py", line 130, in <module>
    splitext.__doc__ = genericpath._splitext.__doc__
AttributeError: module 'genericpath' has no attribute '_splitext'

----------
components: Library (Lib)
messages: 357947
nosy: brittanyrey
priority: normal
severity: normal
status: open
title: Import genericpath fails with python -S
type: crash
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38990>
_______________________________________


More information about the Python-bugs-list mailing list