python-xbrl
python-xbrl copied to clipboard
TypeError: '_io.TextIOWrapper' object is not callable
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
https://stackoverflow.com/questions/33421209/typeerror-io-textiowrapper-object-is-not-callable-creating-text-file-error