We uses Python in our application. The current version of python we are using is 3.10.6 and I want to upgrade to the newer version 3.11.x. But there is an issue I am facing with 3.11.x version. We launch Visual studio code from our application by running python scripts. But with version 3.11.x the visual studio was not getting launch. The below is the traceback of the error.
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\public_api.py", line 31, in wrapper
return wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\server\api.py", line 143, in debug
log.reraise_exception("{0}() failed:", func.__name__, level="info")
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\server\api.py", line 141, in debug
return func(address, settrace_kwargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\server\api.py", line 282, in listen
_settrace(
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\server\api.py", line 45, in _settrace
return pydevd.settrace(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd.py", line 2821, in settrace
_locked_settrace(
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd.py", line 2881, in _locked_settrace
py_db = PyDB()
^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd.py", line 535, in __init__
self._files_filtering = FilesFiltering()
^^^^^^^^^^^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_filtering.py", line 117, in __init__
library_roots = self._get_default_library_roots()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\singng\.vscode\extensions\ms-python.python-2023.6.1\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_filtering.py", line 159, in _get_default_library_roots
roots.append(os.path.dirname(os.__file__))
^^^^^^^^^^^
AttributeError: module 'os' has no attribute '__file__'
As per trace back there is no __file__
attribute in os module. Does python 3.11.1 removed __file__
atrribute from os module? How can I fix this issue? since the error i am getting on on vscode extensions file i cannot make any changes on it.