New issue 82 by oce...@gmail.com: Error when config.MP3_BITRATE is not set
http://code.google.com/p/echo-nest-remix/issues/detail?id=82
What steps will reproduce the problem?
1. Checkout code
2. Go to examples/videx
3. Run remix/examples/videx$ python vdissoc.py /tmp/tmp3RMWUT vdissoc.mpg #
Or type in any You Tube URL instaed of /tmp/...
What is the expected output? What do you see instead?
Error:
Traceback (most recent call last):
File "vdissoc.py", line 110, in <module>
main(inputFilename, outputFilename, variation)
File "vdissoc.py", line 88, in main
out.save(outfile)
File "/usr/local/lib/python2.7/dist-packages/echonest/video.py", line
184, in save
res = sequencetomovie(filename, self.video, audioout)
File "/usr/local/lib/python2.7/dist-packages/echonest/video.py", line
316, in sequencetomovie
cmd += " -ab %dk " % getattr(config, 'MP3_BITRATE', '64')
TypeError: %d format: a number is required, not str
What version of the product are you using? On what operating system?
Python 2.7 / Ubuntu 10.10
Please provide any additional information below.
The problem happens when pyechonest.config module does not have the
MP3_BITRATE attribute set.
Then, getattr(config, 'MP3_BITRATE', '64') returns a string ('64'), instead
of an int, and this (%d) fails:
cmd += " -ab %dk " % getattr(config, 'MP3_BITRATE', '64')
- To solve it I edited:
sequencetomovie.py:316
cmd += " -ab %dk " % getattr(config, 'MP3_BITRATE', 64)
#ocelma '64' -> 64
And now it works fine!