acidjunk / acidjunk/fortigate-config-parser

configparser issue in Python2 and Python3

Ouverte
#2 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
23
Forks
9
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.