acidjunk / acidjunk/fortigate-config-parser

configparser issue in Python2 and Python3

Offen
#2 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
23
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

I am facing issues in using this parser in both python 2 & 3.

In python2, I am having issues in installing `configparser` module.

```sh
E:\anand\py> .\Miniconda2\python.exe .\Miniconda2\pkgs\configparser-3.5.0.tar\dist\configparser-3.5.0\setup.py install

error in configparser setup command: Distribution contains no modules or packages for namespace package 'backports'
```
In python3, I am having issues in using `configparser` module. This issue is common in both Windows and Linux.

```py
>>> from configparser import ConfigParser
>>> with open(r'E:\anand\fg_master\tests\unit_tests\fortigate_parser\config_examples\example.conf','r') as f:
... config = f.read()
...
>>> fortigate = ConfigParser(config)
Traceback (most recent call last):
File "", line 1, in
File "E:\anand\py\Miniconda3\lib\configparser.py", line 614, in __init__
for key, value in defaults.items():
AttributeError: 'str' object has no attribute 'items'
```

My skills are insufficient to find a fix for this. I tried to google a lot but couldn't find a solution that I could understand and implement.

Please help. Thank you.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.