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

Badfiles: 'utf-8' codec can't decode byte on import #5599

Open
Morikko opened this issue Jan 15, 2025 · 0 comments
Open

Badfiles: 'utf-8' codec can't decode byte on import #5599

Morikko opened this issue Jan 15, 2025 · 0 comments

Comments

@Morikko
Copy link

Morikko commented Jan 15, 2025

Problem

Importing with the following config a file where the path contains unicode characters:

badfiles:
    check_on_import: yes
$> beet imp -m 'A unicode Ǝ string ñ'

Led to this problem:

Traceback (most recent call last):
  File ".local/bin/beet", line 8, in <module>
    sys.exit(main())
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/ui/__init__.py", line 1865, in main
    _raw_main(args)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/ui/__init__.py", line 1852, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/ui/commands.py", line 1395, in import_func
    import_files(lib, paths, query)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/ui/commands.py", line 1326, in import_files
    session.run()
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/importer.py", line 360, in run
    pl.run_parallel(QUEUE_SIZE)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/util/pipeline.py", line 447, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/util/pipeline.py", line 195, in coro
    func(*(args + (task,)))
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/importer.py", line 1490, in lookup_candidates
    plugins.send("import_task_start", session=session, task=task)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/plugins.py", line 507, in send
    result = handler(**arguments)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beetsplug/badfiles.py", line 175, in on_import_task_start
    error_lines = self.check_item(item)
  File ".local/share/pipx/venvs/beets/lib/python3.10/site-packages/beetsplug/badfiles.py", line 128, in check_item
    path = item.path.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 86: invalid continuation byte

Setup

  • OS: Ubuntu 24.04
  • Python version: 3.10
  • beets version: 2.0.0

It seems a similar issue than: #2168

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

No branches or pull requests

1 participant