echonest / remix

Echo Nest Remix: The Internet Synthesizer
http://echonest.github.com/remix
414 stars 90 forks source link

Legacy: Issue 82: Error when config.MP3_BITRATE is not set #6

Closed tkell closed 11 years ago

tkell commented 12 years ago

ocelma: 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 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')

sequencetomovie.py:316 cmd += " -ab %dk " % getattr(config, 'MP3_BITRATE', 64) #ocelma '64' -> 64

And now it works fine!

tkell commented 11 years ago

Closing - pyechonest no longer has an MP3_BITWARE attribute.