0

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
  • Can you provide us with some example content that reproduces these errors when you attempt to parse it? – larsks Sep 22 '22 at 17:52
  • Such a basic error never would have gotten out of the gates. I suspect it's a version mismatch problem. – Barmar Sep 22 '22 at 17:59
  • But you have the latest versions of both ciscoconfparse and python – Barmar Sep 22 '22 at 18:00
  • 1
    Try downgrading to a slightly older version of `ciscoconfparse`, the current version is simply broken (due to a misplaced decorator added 13 days ago). Notice that the status for this package on pypi currently shows "Tests: failing". – jasonharper Sep 22 '22 at 19:13
  • a downgrade to 1.6.40 doesn't produce the same error. – Kilowatt123 Sep 22 '22 at 21:04

0 Answers0