Code Monkey home page Code Monkey logo

constantine's People

Contributors

cronym avatar jcsalterego avatar thefeloniousmonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

constantine's Issues

delete_hellthreads.py errors out

I succesfully setup a local copy of Constantine in WSL2 and was able to use get_helltheads.py just fine but when i call delete_hellthreads.py stublad.renoproject.org, it attempts to delete a post and then dies.

I'm using WSL2 and Python 3.10.6.

Here's the output:

Stu@StuLaptop:~/Constantine$ ./delete_hellthreads.py stublad.renoproject.org
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
1135 posts total
80 hellthread posts total
Deleting https://bsky.app/profile/<scrubbed>
Traceback (most recent call last):
  File "/home/Stu/.local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/Stu/Constantine/./delete_hellthreads.py", line 142, in <module>
    main()
  File "/home/Stu/Constantine/./delete_hellthreads.py", line 128, in main
    results = delete_post(session, uri)
  File "/home/Stu/Constantine/./delete_hellthreads.py", line 95, in delete_post
    return post_xrpc(session, "com.atproto.repo.deleteRecord", json=json)
  File "/home/Stu/Constantine/constantine.py", line 58, in post_xrpc
    return response.json()
  File "/home/Stu/.local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)```

Filtering by date errors on Python < 3.11

When parsing the date of a post for filtering (link), datetime.fromisoformat is used. In versions of Python before 3.11, the timestamps returned from the Bluesky API cannot be parsed. This change is mentioned in the datetime docs

Python 3.10 running on ubuntu:

>>> datetime.fromisoformat("2023-07-03T20:34:46.264Z")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid isoformat string: '2023-07-03T20:34:46.264Z'

Python 3.11 running on the same instance:

>>> datetime.fromisoformat("2023-07-03T20:34:46.264Z")
datetime.datetime(2023, 7, 3, 20, 34, 46, 264000, tzinfo=datetime.timezone.utc)

Updating the workflow files to explicitly use 3.11 fixes this. Alternatively, a different datetime parsing method could be used to support older versions of Python.

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.