I'm wondering if I should report this as a bug. I've used this Python module before (ciscoconfparse) and haven't had a problem. I recently switched to a MacBook and I get an error just trying to open a file using the syntax recommended in the documentation. I always get this same error.
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 "<stdin>", line 1, in <module>
> 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)
│ │ │ └ <loguru.logger handlers=[(id=1, level=10, sink=<stdout>)]>
│ │ └ 'test.txt'
│ └ <function CiscoConfParse.get_config_lines at 0x103f653f0>
└ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
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:
│ │ └ <function Logger.catch.<locals>.Catcher.__call__.<locals>.catch_wrapper at 0x103f657e0>
│ └ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
└ '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