Giter Club home page Giter Club logo

Comments (8)

Zulex avatar Zulex commented on July 26, 2024 2

Fix is written here : #77

from fbchat.

DanMossa avatar DanMossa commented on July 26, 2024

I just get this error

Traceback (most recent call last):
  File "/opt/pycharm-com-eap/helpers/pydev/pydevd.py", line 1581, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/opt/pycharm-com-eap/helpers/pydev/pydevd.py", line 964, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/daniel/Dropbox/Code/Python/TesFBChat.py", line 19, in <module>
    bot.listen()
  File "/home/daniel/.local/lib/python2.7/site-packages/fbchat/client.py", line 544, in listen
    sticky, pool = self._getSticky()
  File "/home/daniel/.local/lib/python2.7/site-packages/fbchat/client.py", line 468, in _getSticky
    j = get_json(r.text)
  File "/home/daniel/.local/lib/python2.7/site-packages/fbchat/utils.py", line 18, in get_json
    return json.loads(re.sub(r"^[^{]*", '', text, 1))
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

from fbchat.

trirpi avatar trirpi commented on July 26, 2024

I have the same issue

from fbchat.

dstelzer avatar dstelzer commented on July 26, 2024

I'm getting a similar but slightly different error.

>>> c = fbchat.Client('EMAIL', 'PASSWORD')
Logging in...
login successful
>>> c.listen()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/fbchat/client.py", line 544, in listen
    sticky, pool = self._getSticky()
  File "/usr/local/lib/python3.5/dist-packages/fbchat/client.py", line 468, in _getSticky
    j = get_json(r.text)
  File "/usr/local/lib/python3.5/dist-packages/fbchat/utils.py", line 18, in get_json
    return json.loads(re.sub(r"^[^{]*", '', text, 1))
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

from fbchat.

vincent-lg avatar vincent-lg commented on July 26, 2024

Thanks @Zulex, it seems to fix the bug. I hope it will be merged soon.

from fbchat.

tshrjn avatar tshrjn commented on July 26, 2024

Getting the same error as @dstelzer , and @Zulex , the fix you specified does not help either.

Here's the detailed traceback:

JSONDecodeError                           Traceback (most recent call last)
<ipython-input-116-c759cb92fbd3> in <module>()
----> 1 bot.listen()

/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/client.py in listen(self, markAlive)
    542                 # ex_type, ex, tb = sys.exc_info()
    543                 self.on_message_error(sys.exc_info(), m)
--> 544 
    545 
    546     def listen(self, markAlive=True):

/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/client.py in _getSticky(self)
    466             "msgs_recv": 0,
    467             "channel": self.user_channel,
--> 468             "clientid": self.client_id
    469         }
    470 

/Users/tshrjn/anaconda3/lib/python3.5/site-packages/fbchat/utils.py in get_json(text)
     16 
     17 def get_json(text):
---> 18     return json.loads(re.sub(r"^[^{]*", '', text, 1))
     19 
     20 def digit_to_char(digit):

/Users/tshrjn/anaconda3/lib/python3.5/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    317             parse_int is None and parse_float is None and
    318             parse_constant is None and object_pairs_hook is None and not kw):
--> 319         return _default_decoder.decode(s)
    320     if cls is None:
    321         cls = JSONDecoder

/Users/tshrjn/anaconda3/lib/python3.5/json/decoder.py in decode(self, s, _w)
    337 
    338         """
--> 339         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    340         end = _w(s, end).end()
    341         if end != len(s):

/Users/tshrjn/anaconda3/lib/python3.5/json/decoder.py in raw_decode(self, s, idx)
    355             obj, end = self.scan_once(s, idx)
    356         except StopIteration as err:
--> 357             raise JSONDecodeError("Expecting value", s, err.value) from None
    358         return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

from fbchat.

vincent-lg avatar vincent-lg commented on July 26, 2024

from fbchat.

carpedm20 avatar carpedm20 commented on July 26, 2024

Merged #77

from fbchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.