mirror of
https://github.com/beetbox/beets.git
synced 2026-02-03 14:01:49 +01:00
convert: playlist: Use normpath for playlist file
Fixes FileNotFoundError when for example a tilde (~) characteris used for a --dest path.
This commit is contained in:
parent
068208f71e
commit
20a0012f79
2 changed files with 4 additions and 3 deletions
|
|
@ -15,7 +15,7 @@
|
|||
"""Provides utilities to read, write an manipulate m3u playlist files."""
|
||||
|
||||
|
||||
from beets.util import syspath
|
||||
from beets.util import syspath, normpath
|
||||
|
||||
|
||||
class EmptyPlaylistError(Exception):
|
||||
|
|
@ -70,6 +70,6 @@ class M3UFile():
|
|||
if not self.media_list:
|
||||
raise EmptyPlaylistError
|
||||
contents = header + self.media_list
|
||||
with open(syspath(self.path), "w", encoding="utf-8") as playlist_file:
|
||||
with open(syspath(normpath(self.path)), "w", encoding="utf-8") as playlist_file:
|
||||
playlist_file.writelines('\n'.join(contents))
|
||||
playlist_file.write('\n') # Final linefeed to prevent noeol file.
|
||||
|
|
|
|||
|
|
@ -483,7 +483,8 @@ class ConvertPlugin(BeetsPlugin):
|
|||
# media file paths to be unicode. Additionally we use relative
|
||||
# paths to ensure readability of the playlist on remote
|
||||
# computers.
|
||||
self._log.info("Creating playlist file: {0}", playlist)
|
||||
self._log.info("Creating playlist file: {0}",
|
||||
util.normpath(playlist))
|
||||
items_paths = [
|
||||
util.syspath(item.destination(
|
||||
basedir=dest, path_formats=path_formats, fragment=True
|
||||
|
|
|
|||
Loading…
Reference in a new issue