mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 19:12:40 +01:00
py3: Use import argument paths as bytestrings
This commit is contained in:
parent
9577a511cb
commit
2f2388fc2c
1 changed files with 7 additions and 0 deletions
|
|
@ -934,6 +934,13 @@ def import_func(lib, opts, args):
|
|||
if not paths:
|
||||
raise ui.UserError(u'no path specified')
|
||||
|
||||
# On Python 2, we get filenames as raw bytes, which is what we
|
||||
# need. On Python 3, we need to undo the "helpful" conversion to
|
||||
# Unicode strings to get the real bytestring filename.
|
||||
if not six.PY2:
|
||||
paths = [p.encode(util.arg_encoding(), 'surrogateescape')
|
||||
for p in paths]
|
||||
|
||||
import_files(lib, paths, query)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue