Giter Club home page Giter Club logo

pysnoonotes's People

Contributors

mmshivesh avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pysnoonotes's Issues

a JSON decode error

Heya, I wanted to let you know about this:

['x']
{'NoteTypeID': x, 'SubName': 'x', 'Message': 'x', 'AppliesToUsername': 'x', 'Url': 'x'}
Traceback (most recent call last):
  File "C:\Users\x\Desktop\reddit-bot\x\bot.py", line 101, in <module>
    add_decay(author, subid)
  File "C:\Users\x\Desktop\reddit-bot\x\bot.py", line 87, in add_decay
    sn.add_note_for_user(author, 2310, "x", f"[{amoun}] x", f"x{subid}")
  File "C:\Users\x\Desktop\reddit-bot\x\pysnoonotes\core.py", line 61, in add_note_for_user
    self._authed_request("POST", "/api/note", data={
  File "C:\Users\x\Desktop\reddit-bot\x\pysnoonotes\core.py", line 48, in _authed_request
    return r.json()
  File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[Finished in 77.891s]

I added a print(data) below line 38 in core.py to get some context for this. The first line in my copypaste is my request for a user's snoonotes (their username), and below that is my request to POST a new note. I've substituted a lot of info with x, sorry about that.

It posts the note just fine though.

I added a

            try:
                return r.json()
            except Exception as e:
                print(e)

below the if r.ok:, and it now just occasionally prints Expecting value: line 1 column 1 (char 0).

Thanks for writing this, it's been great so far!

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.