Hi,
I want to write my documentation with Sphinx and in my file I am using 
ConfigParser to set different variables out of a config file.
When referencing a function in my Python file from Sphinx it is always 
throwing an error.

This is the extract from the code as an example:


*config_ini = 
configparser.ConfigParser()config_ini.read(os.path.abspath("config.ini"))*
*VIP_SW = config_ini['VIP']['SW']*

And I get the following error: 

WARNING: autodoc: failed to import function 'get_HW_version' from module 
'QNX_Testclient_TCP'; the following exception was raised:
Traceback (most recent call last):
  File "C:\Users\crost\OneDrive - 
Visteon\01_Projects\09_Scania\01_DDU_CDC_2023\24_SW\99_Flash\10_Testing\lib\site-packages\sphinx\ext\autodoc\importer.py",
 
line 60, in import_module  
    return importlib.import_module(modname)
  File "C:\Program Files\Python39\lib\importlib\__init__.py", line 127, in 
import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in 
_call_with_frames_removed
  File "C:\Users\crost\OneDrive - 
Visteon\01_Projects\09_Scania\01_DDU_CDC_2023\24_SW\99_Flash\10_Testing\QNX_Testclient_TCP.py",
 
line 20, in <module>
    VIP_SW = config_ini['VIP']['SW']
  File "C:\Program Files\Python39\lib\configparser.py", line 963, in 
__getitem__
    raise KeyError(key)
KeyError: 'VIP'


Has anybody an idea on how to solve it?

Thx.

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/52524a1a-b265-4326-838c-fb132580a316n%40googlegroups.com.

Reply via email to