mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 23:43:31 +01:00
add py3_path to NamedTemporaryFile suffixes
This commit is contained in:
parent
915ec59500
commit
527b51147e
2 changed files with 4 additions and 3 deletions
|
|
@ -52,7 +52,7 @@ def temp_file_for(path):
|
|||
specified path.
|
||||
"""
|
||||
ext = os.path.splitext(path)[1]
|
||||
with NamedTemporaryFile(suffix=ext, delete=False) as f:
|
||||
with NamedTemporaryFile(suffix=util.py3_path(ext), delete=False) as f:
|
||||
return util.bytestring_path(f.name)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from beets import config
|
|||
from beets.mediafile import _image_mime_type
|
||||
from beets.util.artresizer import ArtResizer
|
||||
from beets.util import confit
|
||||
from beets.util import syspath, bytestring_path
|
||||
from beets.util import syspath, bytestring_path, py3_path
|
||||
import six
|
||||
|
||||
try:
|
||||
|
|
@ -270,7 +270,8 @@ class RemoteArtSource(ArtSource):
|
|||
u'to {}',
|
||||
ct, real_ct, ext)
|
||||
|
||||
with NamedTemporaryFile(suffix=ext, delete=False) as fh:
|
||||
suffix = py3_path(ext)
|
||||
with NamedTemporaryFile(suffix=suffix, delete=False) as fh:
|
||||
# write the first already loaded part of the image
|
||||
fh.write(header)
|
||||
# download the remaining part of the image
|
||||
|
|
|
|||
Loading…
Reference in a new issue