alextricity25 / parse_apache_configs

A simple python library that will parse apache configs and convert them to a python dictionary.
Other
8 stars 4 forks source link

issue parsing config as both file path or string #9

Open naphta opened 8 years ago

naphta commented 8 years ago

Getting an exception from pyparsing:

Exception:

pyparsing.ParseException: Expected {Group:({"</" W:(ABCD...) ">" LineEnd}) ^ Group:({"<" {{W:(ABCD...) <SPC><TAB><CR><LF> <= | >= | == | != | < | > | ~ <SPC><TAB><CR><LF> W:(ABCD...)} | {W:(ABCD...)}...} ">" LineEnd}) ^ Group:({W:(ABCD...) Suppress:(<SPC><TAB><CR><LF>) W:(0123...) LineEnd}) ^ Group:({{"#" LineEnd} ^ {"#" {W:(ABCD...)}... LineEnd}}) ^ Group:(LineEnd)} (at char 19), (line:1, col:20)

My code:

f = open(file, 'r')
fs = str(f.read())
apache_parse_obj = parse_config.ParseApacheConfig(apache_file_as_string=fs)
apache_config = apache_parse_obj.parse_config()```
bcarroll commented 5 years ago

pull request #10 may resolve this error