I am writing a chatbot program with python and when I run my code I get the following error.
Traceback (most recent call last):
File "C:/Users/stephen/AppData/Local/Programs/Python/Python35/chatbot.py", line 97, in <module>
with bz2.open("C:/RC_{}".format(timeframe.split('-')[0],timeframe), buffering=1000) as f:
TypeError: open() got an unexpected keyword argument 'buffering'
Could not find any information online regarding error. All I saw was maybe that it was a bug and I should report it to python. Currently running python3.5.3. This is the part of the code that gets the error.
with bz2.open("C:/RC_{}".format(timeframe.split('-')[0],timeframe), buffering=1000) as f:
for row in f:
row_counter += 1
parent_id = row['parent_id']
body = format_data(row['body'])
created_utc = row['created_utc']
score = row['score']
comment_id = row['name']
subreddit = row['subreddit']
parent_data = find_parent(parent_id)
The error is very explicit:
A simple check of the documentation for
bz2.open
would then show you that this function does not take abuffering
argument.So simply remove it.