acidjunk / acidjunk/fortigate-config-parser

configparser issue in Python2 and Python3

Abierto
#2 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
23
Forks
9
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.