x89 / Shreddit

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

Stopped working after python 3.8 upgrade #149

Closed gwstorm closed 4 years ago

gwstorm commented 4 years ago

Arch Linux recently upgraded to Python 3.8 and after that, the following error is produced -

Traceback (most recent call last):
  File "/usr/bin/shreddit", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3251, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3263, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'shreddit==6.0.7' distribution was not found and is required by the application
ctbull2 commented 4 years ago

I'm not sure if this is really maintained anymore, but I fixed this on Arch by upgrading shreddit: pip install shreddit --upgrade

I just mindlessly without reading the error messages, but it looks like you actually just need to reinstall since shreddit likely lived in the python3.7 directory before.

I also had to change lines 33 & 34 of /usr/lib/python3.8/site-packages/shreddit/shredder.py to: self._recent_cutoff = arrow.now().shift(hours=-self._hours) self._nuke_cutoff = arrow.now().shift(hours=-self._nuke_hours)

gwstorm commented 4 years ago

You put me on the right path. Thanks! I use the python-shreddit-git AUR package simply because I've had issues with pip and system upgrade conflicts... Even though python-pip is a make depend. Either way, you're suggestions got me there.

I had already tried upgrading and I had also tried symlinking to the python3.8 folder, but ultimately, I just had to remove the package and do a clean build and It was reinstalled properly in the 3.8 folder.