Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can't concat str to bytes #4993

Closed
vpier111 opened this issue Nov 10, 2023 · 2 comments
Closed

TypeError: can't concat str to bytes #4993

vpier111 opened this issue Nov 10, 2023 · 2 comments

Comments

@vpier111
Copy link

vpier111 commented Nov 10, 2023

Problem

Running the command:

C:\Users\viper>beet import -A C:\Users\viper\Music

Led to this problem:

Microsoft Windows [Version 10.0.19045.3570]
(c) Microsoft Corporation. All rights reserved.

C:\Users\viper>beet import -A C:\Users\viper\Music
C:\Users\viper\Music\Australian Army Band\Australian Army Band - National Anthems (2002) [FLAC] [16B-44.1kHz]
C:\Users\viper\Music\BAP\BAP - Dreimal Zehn Jahre (2005) [FLAC] [16B-44.1kHz]\CD1; C:\Users\viper\Music\BAP\BAP - Dreimal Zehn Jahre (2005) [FLAC] [16B-44.1kHz]\CD2
C:\Users\viper\Music\BAP\BAP - Dreimal zehn Jahre (iTunes Exklusiv Konzert) (2005) [ALAC] [16B-44.1kHz]
Traceback (most recent call last):
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\util\__init__.py", line 496, in move
    os.replace(path, dest)
OSError: [WinError 17] The system cannot move the file to a different disk drive: '\\\\?\\C:\\Users\\viper\\Music\\Australian Army Band\\Australian Army Band - National Anthems (2002) [FLAC] [16B-44.1kHz]\\01. Advance Australia Fair (Australia).flac' -> '\\\\?\\D:\\Music\\Australian Army Band\\National Anthems\\01 Advance Australia Fair (Australia).flac'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\viper\AppData\Local\Programs\Python\Python39-32\Scripts\beet-script.py", line 33, in <module>
    sys.exit(load_entry_point('beets==1.6.0', 'console_scripts', 'beet')())
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\ui\__init__.py", line 1285, in main
    _raw_main(args)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\ui\__init__.py", line 1272, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\ui\commands.py", line 973, in import_func
    import_files(lib, paths, query)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\ui\commands.py", line 943, in import_files
    session.run()
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\importer.py", line 340, in run
    pl.run_parallel(QUEUE_SIZE)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\util\pipeline.py", line 446, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\util\pipeline.py", line 358, in run
    self.coro.send(msg)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\util\pipeline.py", line 170, in coro
    task = func(*(args + (task,)))
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\importer.py", line 1566, in manipulate_files
    task.manipulate_files(
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\importer.py", line 757, in manipulate_files
    item.move(operation)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\library.py", line 922, in move
    self.move_file(dest, operation)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\library.py", line 821, in move_file
    util.move(self.path, dest)
  File "c:\users\viper\appdata\local\programs\python\python39-32\lib\site-packages\beets\util\__init__.py", line 499, in move
    prefix=py3_path(b'.' + os.path.basename(dest)),
TypeError: can't concat str to bytes

C:\Users\viper>

Here's a link to the music files that trigger the bug (if relevant):
It happens with all files

Setup

  • OS: Windows 10 Pro 22H2 19045.3570
  • Python version: Python 3.9.0
  • beets version: beets version 1.6.0 - no plugins loaded
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

directory: D:\Music
library: D:\Music\musiclibrary.db

import:
    move: yes
@JOJ0
Copy link
Member

JOJ0 commented Nov 10, 2023

Thanks for the report. Does it happen with the latest beets version as well? https://beets.readthedocs.io/en/latest/contributing.html#getting-the-source

@wisp3rwind
Copy link
Member

Should be fixed in #4209. If not (i.e. if this error still occurs with the latest beets version, as pointed out by @JOJ0, please re-open this issue.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants