0

I'm working on someone else's code, and it's throwing an error that 'InputStreamError' is not defined. I'm new to python and am not sure how to tell where InputStreamError is defined and how to reference it from the code.

This is what I've got at the moment:

from hachoir_core.error import HachoirError
from hachoir_core.cmd_line import unicodeFilename
from hachoir_parser import createParser
from hachoir_core.tools import makePrintable
from metadata import extractMetadata
from hachoir_core.i18n import getTerminalCharset
from sys import argv, stderr, exit

def getMetadata(inputFilename):
    filename, realname = unicodeFilename(inputFilename), inputFilename

    try:
        parser = createParser(filename, realname)
    except InputStreamError:
        print "File cannot be found."
        return
    ...

anyone have any ideas on how I could sort this out?

1 Answer 1

2

Try adding a

from hachoir_core.stream.input import InputStreamError
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.