mschiffm / cvrfparse

CVRF parsing/validation utility
MIT License
31 stars 11 forks source link

Supporting Python 2.7.6 #1

Open ahmadnazir opened 10 years ago

ahmadnazir commented 10 years ago

Hi,

I am running into a few errors when running with python 2.7.6 which is most certainly because the tool was developed using an earlier python version. Can you please share the version of python that was used to develop this tool?

More specifically, I am using Python 2.7.6. and I get the following error when I try to parse the cvrf elements:

./cvrfparse.py -f sample-xml/CVRF-1.1-cisco-sa-20110525-rvs4000.xml  --vuln all
Traceback (most recent call last):
  File "./cvrfparse.py", line 286, in <module>
    main(progname)
  File "./cvrfparse.py", line 281, in main
    cvrf_dispatch(cvrf_doc, parsables, collate_vuln=args.collate_vuln, strip_ns=args.strip_ns)
  File "./cvrfparse.py", line 151, in cvrf_dispatch
    cvrf_dump(results, strip_ns)
  File "./cvrfparse.py", line 130, in cvrf_dump
    f = codecs.EncodedFile(sys.stdout, input="UTF-8")
TypeError: EncodedFile() got an unexpected keyword argument 'input'
cvrfparse.py: TypeError: EncodedFile() got an unexpected keyword argument 'input'

This can easily be fixed fixed by changing the keyword to 'data_encoding' (or having no keyword at all which would make the tool backwards compatible.).

I would be happy to create a pull request for this change.

Thanks, Ahmad

mschiffm commented 10 years ago

Good morning Ahmad. It was built and tested on Python 2.7.5. I’ll upgrade my python install and verify this bug — in the meantime, please do submit a PR. Thank you!

Flectere si nequeo superos, Achaeronta movebo

On Mar 19, 2014, at 8:32 AM, Ahmad Nazir Raja notifications@github.com wrote:

Hi,

I am running into a few errors when running with python 2.7.6 which is most certainly because the tool was developed using an earlier python version. Can you please share the version of python that was used to develop this tool?

More specifically, I am using Pythin 2.7.6. and I get the following error when I try to parse the cvrf elements:

./cvrfparse.py -f sample-xml/CVRF-1.1-cisco-sa-20110525-rvs4000.xml --vuln all Traceback (most recent call last): File "./cvrfparse.py", line 286, in main(progname) File "./cvrfparse.py", line 281, in main cvrf_dispatch(cvrf_doc, parsables, collate_vuln=args.collate_vuln, strip_ns=args.strip_ns) File "./cvrfparse.py", line 151, in cvrf_dispatch cvrf_dump(results, strip_ns) File "./cvrfparse.py", line 130, in cvrf_dump f = codecs.EncodedFile(sys.stdout, input="UTF-8") TypeError: EncodedFile() got an unexpected keyword argument 'input' cvrfparse.py: TypeError: EncodedFile() got an unexpected keyword argument 'input' This can easily be fixed fixed by changing the keyword to 'data_encoding' (or having no keyword at all which would make the tool backwards compatible.).

I would be happy to create a pull request for this change.

Thanks, Ahmad

— Reply to this email directly or view it on GitHub.

iamparas commented 8 years ago

Hey Mike, I have the same error and I am trying to incorporate cvrfparser in my application. Since, there is not update on this issue I will submit the pull request by incorporating changes mentioned above.