RealTimeWeb / reddit

Connect to the popular link-sharing website Reddit to download posts and comments.
MIT License
6 stars 6 forks source link

Problem with reddit.disconnect() #1

Open pconrad opened 10 years ago

pconrad commented 10 years ago

Problem with reddit.disconnect()

I just dropped reddit.py in a directory, and tried using the reddit object as shown on the readme.rst

However, I got this result:

>>> reddit.disconnect()
Traceback (most recent call last):
  File "./reddit.py", line 135, in disconnect
    with open(filename, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'weatherservice/cache.js on'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./reddit.py", line 138, in disconnect
    raise WeatherException("The cache file '{}' was not found.".format(filename) )
NameError: global name 'WeatherException' is not defined
>>>
KeyboardInterrupt
>>>

Am I just doing it wrong, or is there a bug?

acbart commented 10 years ago

Bug! That code is auxliary and was copied over from the weather library carelessly. Pushing the fixed lines now...

acbart commented 10 years ago

Okay, that should fix it. Just creating the wrong exception.