greedo / python-xbrl

xbrl parser written in Python :bulb:
https://pypi.python.org/pypi/python-xbrl
Apache License 2.0
220 stars 76 forks source link

TypeError: '_io.TextIOWrapper' object is not callable #49

Open sagarsea opened 4 years ago

sagarsea commented 4 years ago

Great library, but I need help with the following error when executing my code `for filename in reversed(filelist): print("filename", filename)

print("index", index)

this_file = {}
thisfilename = os.path.join(this_path, filename)
with open(thisfilename, 'r', encoding='utf-8') as file:
    print(thisfilename)
    this10q = file.read()
    xbrl_parser = XBRLParser()
    xbrl = xbrl_parser.parse(file(thisfilename))`

Error message is detailed below : Traceback (most recent call last): File "C:/Users/sagar/Documents/DEAR/analysis-automation-master/my-analyzer/secfilingextraction.py", line 21, in <module> xbrl = xbrl_parser.parse(file(thisfilename)) TypeError: '_io.TextIOWrapper' object is not callable

Masoud-Karami commented 4 years ago

https://stackoverflow.com/questions/33421209/typeerror-io-textiowrapper-object-is-not-callable-creating-text-file-error