Код: Выделить всё
Python 3.10.7 (v3.10.7:6cc6b13308, Sep 5 2022, 14:02:52) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ciscoconfparse import CiscoConfParse
>>>
>>> parse = CiscoConfParse('test.txt')
2022-09-22 11:37:54.599 | ERROR | ciscoconfparse.ciscoconfparse:__init__:485 - An error has been caught in function '__init__', process 'MainProcess' (32493), thread 'MainThread' (4336010624):
Traceback (most recent call last):
File "", line 1, in
> File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ciscoconfparse/ciscoconfparse.py", line 485, in __init__
config = self.get_config_lines(config=config, logger=logger)
│ │ │ └
│ │ └ 'test.txt'
│ └
└
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/ciscoconfparse/ciscoconfparse.py", line 582, in get_config_lines
with open(config, **self.openargs) as fh:
│ │ └
│ └
└ 'test.txt'
TypeError: io.open() argument after ** must be a mapping, not method
- ciscoconfparse v1.6.41
- Python 3.10.7
- macOS Monterey 12.6
Подробнее здесь: https://stackoverflow.com/questions/738 ... figuration