Our support for the very basic built-in modules, like sys, os etc. is currently read from the files python uses too, i.e. /usr/lib/pythonx.y/os.py. That works to varying degrees -- for example, os.gecwd() is imported in a fancy way from the C POSIX builtins, and is thus not there. A clever, but a bit complicated way to solve this would be: 1) Add a file called os.py to documentation_files/. In there, do "from os import *", and then "def getcwd(): return str()" or something. 2) Hack ContextBuilder::findModulePath (kdev-python/duchain/contextbuilder.cpp) to search in the system directories *before* those from Helper::getDataDirs() in case the currently parsed file is in those data dirs already. That'll ensure the "from os import *" will indeed pick up the system's os module. A simpler solution, which might also be ok for different, smaller modules than os is just copying the system file to documentation_files and modifying it there, or just creating a new "pseudo" implementation of the module which just defines the functions and has docstrings, but doesn't actually implement anything. Reproducible: Always
Next in list: sys. sys.stdin and stuff should really work properly.
sys is done now, another one which is always shaky is re.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.