Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors while running #54

Open
ghost opened this issue Feb 13, 2019 · 4 comments
Open

Errors while running #54

ghost opened this issue Feb 13, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2019

The following errors occur for the program when I run it. Previously it was running perfectly fine but now it doesn't get corrected.
Does anyone have any ideas on how to correct these?

Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\HTC\python-evtx\scripts\evtx_filter_records.py", line 65, in <module>
    main()
  File "C:\Users\Admin\Desktop\HTC\python-evtx\scripts\evtx_filter_records.py", line 56, in main
    for node, err in xml_records(args.evtx):
  File "C:\Users\Admin\Desktop\HTC\python-evtx\scripts\evtx_filter_records.py", line 30, in xml_records
    yield to_lxml(xml), None
  File "C:\Users\Admin\Desktop\HTC\python-evtx\scripts\evtx_filter_records.py", line 15, in to_lxml
    record_xml)
  File "src\lxml\etree.pyx", line 3211, in lxml.etree.fromstring
  File "src\lxml\parser.pxi", line 1872, in lxml.etree._parseMemoryDocument
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
@williballenthin
Copy link
Owner

what changed since the last time it was running fine?

@ghost
Copy link
Author

ghost commented Feb 14, 2019

nothing actually. I didn't run it for a few days and the next time I did, it shows these errors

@ghost
Copy link
Author

ghost commented Mar 20, 2019

Hey, anyone else who had this issue? Did it get rectified??

@IceM4nn
Copy link

IceM4nn commented Nov 8, 2019

Add .encode('utf-8') at line 15 file evtx_filter_records.py after record_xml like so:

    return etree.fromstring("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>%s" %
                         record_xml.encode('utf-8'))

This fixes the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants