x89 / Shreddit

Remove your comment history on Reddit as deleting an account does not do so.
Other
1k stars 134 forks source link

Deprecation in arrow causes shreddit not to work #145

Closed japanoise closed 5 years ago

japanoise commented 5 years ago

reproduce

  1. Clean python environment/venv
  2. pip3 install shreddit
  3. cd into directory with configs that work on another computer
  4. shreddit

expected

shreddit loads my config and runs as normal

actual

INFO:shreddit:Logged in as ****.
Traceback (most recent call last):
  File "/home/KonaKona/bin/shreddit", line 10, in <module>
    sys.exit(main())
  File "/home/KonaKona/.local/lib/python3.5/site-packages/shreddit/app.py", line 44, in main
    shredder = Shredder(default_config, args.user)
  File "/home/KonaKona/.local/lib/python3.5/site-packages/shreddit/shredder.py", line 33, in __init__
    self._recent_cutoff = arrow.now().replace(hours=-self._hours)
  File "/home/KonaKona/.local/lib/python3.5/site-packages/arrow/arrow.py", line 603, in replace
    raise AttributeError('unknown attribute: "{}"'.format(key))
AttributeError: unknown attribute: "hours"

possible fix

Googling found me this: https://github.com/crsmithdev/arrow/issues/638

japanoise commented 5 years ago

Confirmed locally that changing it to shift from replace fixed the issue and seemed to work fine.

japanoise commented 5 years ago

Apologies, this is a duplicate of https://github.com/x89/Shreddit/issues/141