mirror of
https://github.com/beetbox/beets.git
synced 2026-01-06 07:53:40 +01:00
Echonest conversion command: only use byte strings
Temp file name was unicode, so if other parts of the command were utf8-encoded non-ascii strings the command would fail (in beets.util.command_output()). Requesting a temp file with a byte string path fixes the issue. Fix #1407.
This commit is contained in:
parent
7ac6ba53ff
commit
882844bc77
2 changed files with 7 additions and 1 deletions
|
|
@ -289,7 +289,7 @@ class EchonestMetadataPlugin(plugins.BeetsPlugin):
|
|||
pending.
|
||||
This is stolen from Jakob Schnitzers convert plugin.
|
||||
"""
|
||||
fd, dest = tempfile.mkstemp(u'.ogg')
|
||||
fd, dest = tempfile.mkstemp(b'.ogg')
|
||||
os.close(fd)
|
||||
|
||||
self._log.info(u'encoding {0} to {1}',
|
||||
|
|
|
|||
|
|
@ -109,6 +109,12 @@ class EchonestCliTest(unittest.TestCase, TestHelper):
|
|||
self.assertNotEqual(item.path,
|
||||
echonest_track.call_args[1]['filename'])
|
||||
|
||||
@patch('pyechonest.song.search')
|
||||
@patch('beetsplug.echonest.CONVERT_COMMAND', 'cp $source $dest')
|
||||
def test_analyze_convert2(self, echonest_search):
|
||||
self.add_item(format='FLAC', path=b'm\xc3\xacn.flac')
|
||||
self.run_command('echonest')
|
||||
|
||||
@patch('pyechonest.song.profile')
|
||||
@patch('pyechonest.song.search')
|
||||
@patch('pyechonest.track.track_from_filename')
|
||||
|
|
|
|||
Loading…
Reference in a new issue