-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tried to run with pycharm, got 'NoneType' object has no attribute 'read' #51
Comments
Pulled to latest?
|
What? |
It looks like I ran it without the |
Ah I maybe missed something there, will check later.
|
Looks like a simple fix. I edited the code and changed around line 50: config = None
if args.config:
config.read(args.config)
else:
with open('shreddit.yml', 'r') as fh:
config = yaml.safe_load(fh)
if config is None:
raise Exception("No config options passed!") to: config = None
if args.config:
with open(args.config, 'r') as fh:
config = yaml.safe_load(fh)
#config.read(args.config)
else:
with open('shreddit.yml', 'r') as fh:
config = yaml.safe_load(fh)
if config is None:
raise Exception("No config options passed!") Note that adding the "with open(args.config, 'r' as fh:" line will open the config file you pass. |
Hey there, this should be fixed by #54 |
Merged (can't test at the moment but looks like it should work). Pull again @vizakenjaro and see if that works for you. Thanks as well @Tjololo12. |
I placed shreddit.cfg and shreddit.py on the desktop folder (OS X).
Then run it under IDE environment called PyCharm.
Installed modules yaml and praw.
Got error:
(line 50 in shreddit.py)
config.read(args.config)
AttributeError: 'NoneType' object has no attribute 'read'
The text was updated successfully, but these errors were encountered: