Skip to content
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

Bug in Read_config? #13

Open
BertVano opened this issue Jun 16, 2014 · 6 comments
Open

Bug in Read_config? #13

BertVano opened this issue Jun 16, 2014 · 6 comments

Comments

@BertVano
Copy link

When I try to run the unstable version of PirateRadio.py on my Raspberry pi I get the following error:
TypeError: get() got an unexpected keyword argument 'fallback'

Is it possible to solve this? Thanks!

@zerotri
Copy link
Contributor

zerotri commented Jun 18, 2014

Thank you for letting me know. This is definitely something I would like to find the time to look into. Which version of python are you running? Could it be 2.6?

It looks like the ConfigParser module in 2.6 doesn't support the fallback argument. If I can find the time soon I'll try and rewrite the config section to work pre 2.7.

If you aren't running a python version <2.7 then this is an unusual issue.

@BertVano
Copy link
Author

I think I know what the issue here is, could it be that I'm reading from the wrong directory? Could you give me an example how all the files are divided in directories?

@R03LTjuh
Copy link

python ./PirateRadio.py

Error reading from config file.
('Playing songs to frequency ', '100.0')
Shuffle is off
Repeat All is off

and quits

@cydactyl
Copy link
Contributor

@R03LTjuh can you try my answer on Issue #19?

@n-dim
Copy link

n-dim commented Mar 14, 2015

I get the same error.

The code is using from /usr/lib/python3.2/configparser.py:
get(section, option, raw=False, vars=None, fallback=_UNSET)

In /usr/lib/python2.6/ConfigParser.py there is no fallback argument:
get(section, option, raw=False, vars=None)

On my system there is no configparser.py in python 2.7 or 3, so it falls back on ConfigParser.py in python 2.6. So I think the argument fallback can only be used with python 3.2.

I have python 3.2 installed, but the script is using python 2.7 by default (I guess 2.7 is my system default). If I change the first line to #!/usr/bin/env python3.2 I get no errors.

@bliz937
Copy link

bliz937 commented Jun 9, 2015

I'm running Arch Linux on the pi 2.

I changed line 162 to fm_process = subprocess.Popen(["./pifm","-"

It ran afterwards without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants