fbchat icon indicating copy to clipboard operation
fbchat copied to clipboard

Error with logout function

Open Callen93 opened this issue 4 years ago • 0 comments

Description of the problem

When trying to logout an active session created from session cookies, an error occurs.

Code to reproduce

session = fbchat.Session.from_cookies(cookie)
client = fbchat.Client(session=session)
session.logout()  

Traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../fbchat-master/fbchat/_session.py", line 289, in logout
    logout_h = re.search(r'name=\\"h\\" value=\\"(.*?)\\"', h_r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Environment information

  • Python3.5
  • fbchat 2.0.0a2

This error is not exclusive to v2. I'm getting same error using version 1.8.1 of fbchat. However I don't know if this error already existed or if a modification of fb handling of logout broke something (I've never used this functionality).

Callen93 avatar Apr 19 '20 13:04 Callen93