You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AttributeError: Response content isn't text
File "scrapy/utils/signal.py", line 32, in send_catch_log
response = robustApply(receiver, signal=signal, sender=sender, *arguments, **named)
File "pydispatch/robustapply.py", line 55, in robustApply
return receiver(*arguments, **named)
File "sentry_scrapy/extension.py", line 39, in spider_error
scope.set_extra('response', response_to_dict(response))
File "sentry_scrapy/utils.py", line 12, in response_to_dict
'body': response.text,
File "scrapy/http/response/__init__.py", line 108, in text
raise AttributeError("Response content isn't text")
My manky path:
def_manky_path_sentry_scrapy_utils():
fromscrapy.httpimportTextResponsedefresponse_to_dict(response):
""" Convert a `scrapy.http.Response` to a dictionnary. """fields= {
'status': response.status,
'url': response.url,
'headers': response.headers.to_unicode_dict(),}
ifisinstance(response, TextResponse):
fields.update(body=response.text)
returnfieldsfromsentry_scrapyimportutilsresponse_to_dict.__module__=utilsutils.response_to_dict=response_to_dict
The text was updated successfully, but these errors were encountered:
My manky path:
The text was updated successfully, but these errors were encountered: