mpenning / ciscoconfparse

Parse, Audit, Query, Build, and Modify Arista / Cisco / Juniper / Palo Alto / F5 configurations.
http://www.pennington.net/py/ciscoconfparse/
GNU General Public License v3.0
799 stars 220 forks source link

[Bug]: Version 1.6.41 is broken and should be yanked from pypi #289

Closed mpenning closed 1 year ago

mpenning commented 1 year ago

Contact Details

mike@pennington.net

What happened?

 $ pip install ciscoconfparse==1.6.41
Collecting ciscoconfparse==1.6.41
  Downloading ciscoconfparse-1.6.41-py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 1.0 MB/s eta 0:00:00
Requirement already satisfied: dnspython<3.0.0,>=2.1.0 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (2.4.2)
Collecting loguru==0.6.0 (from ciscoconfparse==1.6.41)
  Downloading loguru-0.6.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 871.4 kB/s eta 0:00:00
Requirement already satisfied: passlib<2.0.0,>=1.7.4 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (1.7.4)
Requirement already satisfied: toml==0.10.2 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (0.10.2)
Installing collected packages: loguru, ciscoconfparse
  Attempting uninstall: loguru
    Found existing installation: loguru 0.7.2
    Uninstalling loguru-0.7.2:
      Successfully uninstalled loguru-0.7.2
Successfully installed ciscoconfparse-1.6.41 loguru-0.6.0
 py310_test  SSH  ~  fixme 
 $ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ciscoconfparse import CiscoConfParse
>>> parse = CiscoConfParse("sample_01.ios")
2023-10-31 06:08:28.868 | ERROR    | ciscoconfparse.ciscoconfparse:__init__:485 - An error has been caught in function '__init__', process 'MainProcess' (267409), thread 'MainThread' (140164799891264):
Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
> File "/opt/virtual_env/py310_test/lib/python3.9/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>)]>
             │    │                       └ 'sample_01.ios'
             │    └ <function CiscoConfParse.get_config_lines at 0x7f7aa7ed5c10>
             └ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
  File "/opt/virtual_env/py310_test/lib/python3.9/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 0x7f7aa7ed8040>
              │         └ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
              └ 'sample_01.ios'

TypeError: io.open() argument after ** must be a mapping, not method
 $ 

CiscoConfParse Version

1.6.41

What Operating System are you using?

Microsoft Windows

What Python version(s) have this problem?

Python 3.9

Show us how to reproduce the problem. Please tell us if the problem is specific to certain inputs or situations.

$ pip install ciscoconfparse==1.6.41
Collecting ciscoconfparse==1.6.41
  Downloading ciscoconfparse-1.6.41-py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 1.0 MB/s eta 0:00:00
Requirement already satisfied: dnspython<3.0.0,>=2.1.0 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (2.4.2)
Collecting loguru==0.6.0 (from ciscoconfparse==1.6.41)
  Downloading loguru-0.6.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 871.4 kB/s eta 0:00:00
Requirement already satisfied: passlib<2.0.0,>=1.7.4 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (1.7.4)
Requirement already satisfied: toml==0.10.2 in /opt/virtual_env/py310_test/lib/python3.9/site-packages (from ciscoconfparse==1.6.41) (0.10.2)
Installing collected packages: loguru, ciscoconfparse
  Attempting uninstall: loguru
    Found existing installation: loguru 0.7.2
    Uninstalling loguru-0.7.2:
      Successfully uninstalled loguru-0.7.2
Successfully installed ciscoconfparse-1.6.41 loguru-0.6.0
 py310_test  SSH  ~  fixme 
 $ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ciscoconfparse import CiscoConfParse
>>> parse = CiscoConfParse("sample_01.ios")
2023-10-31 06:08:28.868 | ERROR    | ciscoconfparse.ciscoconfparse:__init__:485 - An error has been caught in function '__init__', process 'MainProcess' (267409), thread 'MainThread' (140164799891264):
Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
> File "/opt/virtual_env/py310_test/lib/python3.9/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>)]>
             │    │                       └ 'sample_01.ios'
             │    └ <function CiscoConfParse.get_config_lines at 0x7f7aa7ed5c10>
             └ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
  File "/opt/virtual_env/py310_test/lib/python3.9/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 0x7f7aa7ed8040>
              │         └ <CiscoConfParse: None lines / syntax: ios / comment delimiter: '!' / factory: False / encoding: 'UTF-8'>
              └ 'sample_01.ios'

TypeError: io.open() argument after ** must be a mapping, not method
 $

Python tracebacks

See above

Relevant log output

No response

Code of Conduct

mpenning commented 1 year ago

This is fixed in version 1.6.42. I yanked version 1.6.41 from pypi.