beets-copyartifacts icon indicating copy to clipboard operation
beets-copyartifacts copied to clipboard

copyartifacts stops copying when it throws exception

Open jojojames opened this issue 7 years ago • 9 comments

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 124, in wrapper
    return func(*args, **kwargs)
TypeError: process_events() got an unexpected keyword argument 'lib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\Scripts\beet-script.py", line 11, in <module>
    load_entry_point('beets==1.4.5', 'console_scripts', 'beet')()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\ui\__init__.py", line 1256, in main
    _raw_main(args)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\ui\__init__.py", line 1245, in _raw_main
    plugins.send('cli_exit', lib=lib)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 452, in send
    result = handler(**arguments)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\plugins.py", line 130, in wrapper
    return func(*args, **kwargs)
  File "c:\program files (x86)\python36-32\lib\site-packages\beets_copyartifacts-0.1.2-py3.6.egg\beetsplug\copyartifacts.py", line 127, in process_events
  File "c:\program files (x86)\python36-32\lib\site-packages\beets_copyartifacts-0.1.2-py3.6.egg\beetsplug\copyartifacts.py", line 161, in process_artifacts
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\beets\util\__init__.py", line 536, in unique_path
    match = re.search(br'\.(\d)+$', base)
  File "C:\Program Files (x86)\Python36-32\lib\re.py", line 182, in search
    return _compile(pattern, flags).search(string)
TypeError: cannot use a bytes pattern on a string-like object
PS C:\Users\james>

jojojames avatar Nov 05 '17 18:11 jojojames

Duplicate of #31

thomwiggers avatar Nov 06 '17 15:11 thomwiggers

@thomwiggers Are you sure it's a dup? The last comment indicates the development version works.

I believe I cloned the repo to get copyartifacts.

jojojames avatar Nov 06 '17 15:11 jojojames

"TypeError: cannot use a bytes pattern on a string-like object" is a typical "trying to use python 2 code under python 3"-problem. Clearly Python 3 still isn't fully supported.

thomwiggers avatar Nov 06 '17 15:11 thomwiggers

This could be something missed in the test coverage in the development version.

@jojojames, could you paste your copyartifacts config?

sbarakat avatar Nov 06 '17 16:11 sbarakat

copyartifacts: extensions: .* print_ignored: yes

https://github.com/jojojames/beets/blob/master/config.yaml

jojojames avatar Nov 06 '17 16:11 jojojames

The main problem is that the process_events method does not support the lib kwargs of cli_exit. That kwarg has been added in 2013 by this commit: beetbox/beets@2ad5b4c665bd270243d7e31f77680e969d7cb315 A fix should be trivial.

Holzhaus avatar Dec 25 '18 11:12 Holzhaus

I just triggered this bug when updating a massive library. It was quite annoying since all the music files were moved but all the artifacts were left in the original folders, requiring manual movement. Maybe #43 could be merged easily, since it's a one-word fix.

Ruin0x11 avatar Jan 17 '19 22:01 Ruin0x11

I had the same issue with my recent massive library update.

steelwolf avatar Sep 12 '19 14:09 steelwolf

Is this ever going to be fixed? I've had to deal with this problem numerous times because I've had to reinstall multiple versions of Python, and the buggy version is installed from pip every time. I would gladly volunteer to merge the patches if it were possible.

Ruin0x11 avatar Apr 16 '20 00:04 Ruin0x11