Make-Magazine / PirateRadio

Raspberry Pi Automated FM Radio Script
459 stars 156 forks source link

Bug in Read_config? #13

Open BertVano opened 10 years ago

BertVano commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

python ./PirateRadio.py

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

and quits

cydactyl commented 10 years ago

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

n-dim commented 9 years ago

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 commented 9 years ago

I'm running Arch Linux on the pi 2.

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

It ran afterwards without errors.